mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-24 14:49:53 -06:00
start work on libpcap shit
This commit is contained in:
@ -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()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user