aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-12-17 17:21:50 +0100
committerStapleButter <thetotalworm@gmail.com>2017-12-17 17:21:50 +0100
commit17087a1eceb262da0db2a592f21b8ea1fa3eb279 (patch)
tree60b1320605343c80dabe379ad33027c71f09e1d2 /src/libui_sdl
parente4e8d775c00b8a1c33d4830422f1ccabe39ab126 (diff)
start work on libpcap shit
Diffstat (limited to 'src/libui_sdl')
-rw-r--r--src/libui_sdl/Platform.cpp32
1 files changed, 32 insertions, 0 deletions
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 <stdlib.h>
#include <string.h>
#include <SDL2/SDL.h>
+#include <pcap/pcap.h>
#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()
+{
+ //
+}
+
+
}