From 17087a1eceb262da0db2a592f21b8ea1fa3eb279 Mon Sep 17 00:00:00 2001 From: StapleButter Date: Sun, 17 Dec 2017 17:21:50 +0100 Subject: start work on libpcap shit --- src/libui_sdl/Platform.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/Platform.cpp b/src/libui_sdl/Platform.cpp index 1d7438b..825ef81 100644 --- a/src/libui_sdl/Platform.cpp +++ b/src/libui_sdl/Platform.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "../Platform.h" #include "../Config.h" @@ -75,6 +76,17 @@ u8 PacketBuffer[2048]; #define NIFI_VER 1 +const char* PCapLibNames[] = +{ +#ifdef __WIN32__ + "wpcap.dll", +#else + // TODO: Linux lib names +#endif + NULL +}; + + void StopEmu() { Stop(true); @@ -259,4 +271,24 @@ int MP_RecvPacket(u8* data, bool block) } +// LAN interface. Currently powered by libpcap, may change. + +bool LAN_Init() +{ + for (int i = 0; PCapLibNames[i]; i++) + { + void* lib = SDL_LoadObject(PCapLibNames[i]); + if (!lib) continue; + + printf("loaded lib %s\n", PCapLibNames[i]); + SDL_UnloadObject(lib); + } +} + +void LAN_DeInit() +{ + // +} + + } -- cgit v1.2.3