Load pcap_sendqueue functions on Windows
parent
8260149cb8
commit
8f6ff86448
|
|
@ -20,12 +20,12 @@ public:
|
||||||
typedef void(__cdecl* PCAPFREEDEVS)(pcap_if_t* alldevsp);
|
typedef void(__cdecl* PCAPFREEDEVS)(pcap_if_t* alldevsp);
|
||||||
typedef void(__cdecl* PCAPCLOSE)(pcap_t* p);
|
typedef void(__cdecl* PCAPCLOSE)(pcap_t* p);
|
||||||
typedef int(__cdecl* PCAPSTATS)(pcap_t* p, struct pcap_stat* ps);
|
typedef int(__cdecl* PCAPSTATS)(pcap_t* p, struct pcap_stat* ps);
|
||||||
typedef int(__cdecl* PCAPNEXTEX)(pcap_t* p, struct pcap_pkthdr** pkt_header, const u_char** pkt_data);
|
typedef int(__cdecl* PCAPNEXTEX)(pcap_t* p, struct pcap_pkthdr** pkt_header, const unsigned char** pkt_data);
|
||||||
typedef int(__cdecl* PCAPSENDPACKET)(pcap_t* p, const u_char* buf, int size);
|
typedef int(__cdecl* PCAPSENDPACKET)(pcap_t* p, const unsigned char* buf, int size);
|
||||||
// typedef pcap_send_queue*(__cdecl* PCAPSENDQUEUEALLOC)(u_int memsize);
|
typedef pcap_send_queue*(__cdecl* PCAPSENDQUEUEALLOC)(unsigned int memsize);
|
||||||
// typedef int(__cdecl* PCAPSENDQUEUEQUEUE)(pcap_send_queue* queue, const struct pcap_pkthdr* pkt_header, const u_char* pkt_data);
|
typedef int(__cdecl* PCAPSENDQUEUEQUEUE)(pcap_send_queue* queue, const struct pcap_pkthdr* pkt_header, const unsigned char* pkt_data);
|
||||||
// typedef void(__cdecl* PCAPSENDQUEUEDESTROY)(pcap_send_queue* queue);
|
typedef void(__cdecl* PCAPSENDQUEUEDESTROY)(pcap_send_queue* queue);
|
||||||
// typedef u_int(__cdecl* PCAPSENDQUEUETRANSMIT)(pcap_t* p, pcap_send_queue* queue, int sync);
|
typedef unsigned int(__cdecl* PCAPSENDQUEUETRANSMIT)(pcap_t* p, pcap_send_queue* queue, int sync);
|
||||||
typedef int(__cdecl* PCAPDATALINK)(pcap_t* p);
|
typedef int(__cdecl* PCAPDATALINK)(pcap_t* p);
|
||||||
typedef int(__cdecl* PCAPCREATESRCSTR)(char* source, int type, const char* host, const char* port, const char* name, char* errbuf);
|
typedef int(__cdecl* PCAPCREATESRCSTR)(char* source, int type, const char* host, const char* port, const char* name, char* errbuf);
|
||||||
typedef int(__cdecl* PCAPSETBUFF)(pcap_t* p, int dim);
|
typedef int(__cdecl* PCAPSETBUFF)(pcap_t* p, int dim);
|
||||||
|
|
@ -36,10 +36,10 @@ public:
|
||||||
PCAPSTATS stats;
|
PCAPSTATS stats;
|
||||||
PCAPNEXTEX next_ex;
|
PCAPNEXTEX next_ex;
|
||||||
PCAPSENDPACKET sendpacket;
|
PCAPSENDPACKET sendpacket;
|
||||||
// PCAPSENDQUEUEALLOC sendqueue_alloc;
|
PCAPSENDQUEUEALLOC sendqueue_alloc;
|
||||||
// PCAPSENDQUEUEQUEUE sendqueue_queue;
|
PCAPSENDQUEUEQUEUE sendqueue_queue;
|
||||||
// PCAPSENDQUEUEDESTROY sendqueue_destroy;
|
PCAPSENDQUEUEDESTROY sendqueue_destroy;
|
||||||
// PCAPSENDQUEUETRANSMIT sendqueue_transmit;
|
PCAPSENDQUEUETRANSMIT sendqueue_transmit;
|
||||||
PCAPDATALINK datalink;
|
PCAPDATALINK datalink;
|
||||||
PCAPCREATESRCSTR createsrcstr;
|
PCAPCREATESRCSTR createsrcstr;
|
||||||
PCAPSETBUFF setbuff;
|
PCAPSETBUFF setbuff;
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,10 @@ PCAPDLL::PCAPDLL()
|
||||||
stats = (PCAPSTATS)GetProcAddress(dll, "pcap_stats");
|
stats = (PCAPSTATS)GetProcAddress(dll, "pcap_stats");
|
||||||
next_ex = (PCAPNEXTEX)GetProcAddress(dll, "pcap_next_ex");
|
next_ex = (PCAPNEXTEX)GetProcAddress(dll, "pcap_next_ex");
|
||||||
sendpacket = (PCAPSENDPACKET)GetProcAddress(dll, "pcap_sendpacket");
|
sendpacket = (PCAPSENDPACKET)GetProcAddress(dll, "pcap_sendpacket");
|
||||||
// sendqueue_alloc = (PCAPSENDQUEUEALLOC)GetProcAddress(dll, "pcap_sendqueue_alloc");
|
sendqueue_alloc = (PCAPSENDQUEUEALLOC)GetProcAddress(dll, "pcap_sendqueue_alloc");
|
||||||
// sendqueue_queue = (PCAPSENDQUEUEQUEUE)GetProcAddress(dll, "pcap_sendqueue_queue");
|
sendqueue_queue = (PCAPSENDQUEUEQUEUE)GetProcAddress(dll, "pcap_sendqueue_queue");
|
||||||
// sendqueue_destroy = (PCAPSENDQUEUEDESTROY)GetProcAddress(dll, "pcap_sendqueue_destroy");
|
sendqueue_destroy = (PCAPSENDQUEUEDESTROY)GetProcAddress(dll, "pcap_sendqueue_destroy");
|
||||||
// sendqueue_transmit = (PCAPSENDQUEUETRANSMIT)GetProcAddress(dll, "pcap_sendqueue_transmit");
|
sendqueue_transmit = (PCAPSENDQUEUETRANSMIT)GetProcAddress(dll, "pcap_sendqueue_transmit");
|
||||||
datalink = (PCAPDATALINK)GetProcAddress(dll, "pcap_datalink");
|
datalink = (PCAPDATALINK)GetProcAddress(dll, "pcap_datalink");
|
||||||
createsrcstr = (PCAPCREATESRCSTR)GetProcAddress(dll, "pcap_createsrcstr");
|
createsrcstr = (PCAPCREATESRCSTR)GetProcAddress(dll, "pcap_createsrcstr");
|
||||||
setbuff = (PCAPSETBUFF)GetProcAddress(dll, "pcap_setbuff");
|
setbuff = (PCAPSETBUFF)GetProcAddress(dll, "pcap_setbuff");
|
||||||
|
|
@ -50,9 +50,9 @@ PCAPDLL::PCAPDLL()
|
||||||
freealldevs == NULL || close == NULL ||
|
freealldevs == NULL || close == NULL ||
|
||||||
stats == NULL || next_ex == NULL ||
|
stats == NULL || next_ex == NULL ||
|
||||||
sendpacket == NULL ||
|
sendpacket == NULL ||
|
||||||
// sendqueue_alloc == NULL ||
|
sendqueue_alloc == NULL ||
|
||||||
// sendqueue_queue == NULL || sendqueue_destroy == NULL ||
|
sendqueue_queue == NULL || sendqueue_destroy == NULL ||
|
||||||
// sendqueue_transmit == NULL ||
|
sendqueue_transmit == NULL ||
|
||||||
datalink == NULL ||
|
datalink == NULL ||
|
||||||
createsrcstr == NULL || setbuff == NULL) {
|
createsrcstr == NULL || setbuff == NULL) {
|
||||||
closeDLL();
|
closeDLL();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue