Commit be936219 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wpcap: Wrap native handles in a structure.

parent d5c585c6
......@@ -23,6 +23,11 @@ struct pcap_if_hdr
char *name;
};
struct pcap
{
void *handle;
};
struct handler_callback
{
void (CALLBACK *callback)( unsigned char *, const void *, const unsigned char * );
......@@ -31,52 +36,54 @@ struct handler_callback
struct pcap_funcs
{
int (CDECL *activate)( void * );
void (CDECL *breakloop)( void * );
int (CDECL *can_set_rfmon)( void * );
void (CDECL *close)( void * );
int (CDECL *compile)( void *, void *, const char *, int, unsigned int );
void * (CDECL *create)( const char *, char * );
int (CDECL *datalink)( void * );
int (CDECL *activate)( struct pcap * );
void (CDECL *breakloop)( struct pcap * );
int (CDECL *can_set_rfmon)( struct pcap * );
void (CDECL *close)( struct pcap * );
int (CDECL *compile)( struct pcap *, void *, const char *, int, unsigned int );
struct pcap * (CDECL *create)( const char *, char * );
int (CDECL *datalink)( struct pcap * );
int (CDECL *datalink_name_to_val)( const char * );
const char * (CDECL *datalink_val_to_description)( int );
const char * (CDECL *datalink_val_to_name)( int );
int (CDECL *dispatch)( void *, int, void (CALLBACK *)(unsigned char *, const void *, const unsigned char *),
int (CDECL *dispatch)( struct pcap *, int,
void (CALLBACK *)(unsigned char *, const void *, const unsigned char *),
unsigned char * );
void (CDECL *dump)( unsigned char *, const void *, const unsigned char * );
void * (CDECL *dump_open)( void *, const char * );
void * (CDECL *dump_open)( struct pcap *, const char * );
int (CDECL *findalldevs)( struct pcap_if_hdr **, char * );
void (CDECL *free_datalinks)( int * );
void (CDECL *free_tstamp_types)( int * );
void (CDECL *freealldevs)( struct pcap_if_hdr * );
void (CDECL *freecode)( void * );
int (CDECL *get_tstamp_precision)( void * );
char * (CDECL *geterr)( void * );
int (CDECL *getnonblock)( void *, char * );
int (CDECL *get_tstamp_precision)( struct pcap * );
char * (CDECL *geterr)( struct pcap * );
int (CDECL *getnonblock)( struct pcap *, char * );
const char * (CDECL *lib_version)( void );
int (CDECL *list_datalinks)( void *, int ** );
int (CDECL *list_tstamp_types)( void *, int ** );
int (CDECL *list_datalinks)( struct pcap *, int ** );
int (CDECL *list_tstamp_types)( struct pcap *, int ** );
int (CDECL *lookupnet)( const char *, unsigned int *, unsigned int *, char * );
int (CDECL *loop)( void *, int, void (CALLBACK *)(unsigned char *, const void *, const unsigned char *),
int (CDECL *loop)( struct pcap *, int,
void (CALLBACK *)(unsigned char *, const void *, const unsigned char *),
unsigned char * );
int (CDECL *major_version)( void * );
int (CDECL *minor_version)( void * );
const unsigned char * (CDECL *next)( void *, void * );
int (CDECL *next_ex)( void *, void **, const unsigned char ** );
void * (CDECL *open_live)( const char *, int, int, int, char * );
int (CDECL *sendpacket)( void *, const unsigned char *, int );
int (CDECL *set_buffer_size)( void *, int );
int (CDECL *set_datalink)( void *, int );
int (CDECL *set_promisc)( void *, int );
int (CDECL *set_rfmon)( void *, int );
int (CDECL *set_snaplen)( void *, int );
int (CDECL *set_timeout)( void *, int );
int (CDECL *set_tstamp_precision)( void *, int );
int (CDECL *set_tstamp_type)( void *, int );
int (CDECL *setfilter)( void *, void * );
int (CDECL *setnonblock)( void *, int, char * );
int (CDECL *snapshot)( void * );
int (CDECL *stats)( void *, void * );
int (CDECL *major_version)( struct pcap * );
int (CDECL *minor_version)( struct pcap * );
const unsigned char * (CDECL *next)( struct pcap *, void * );
int (CDECL *next_ex)( struct pcap *, void **, const unsigned char ** );
struct pcap * (CDECL *open_live)( const char *, int, int, int, char * );
int (CDECL *sendpacket)( struct pcap *, const unsigned char *, int );
int (CDECL *set_buffer_size)( struct pcap *, int );
int (CDECL *set_datalink)( struct pcap *, int );
int (CDECL *set_promisc)( struct pcap *, int );
int (CDECL *set_rfmon)( struct pcap *, int );
int (CDECL *set_snaplen)( struct pcap *, int );
int (CDECL *set_timeout)( struct pcap *, int );
int (CDECL *set_tstamp_precision)( struct pcap *, int );
int (CDECL *set_tstamp_type)( struct pcap *, int );
int (CDECL *setfilter)( struct pcap *, void * );
int (CDECL *setnonblock)( struct pcap *, int, char * );
int (CDECL *snapshot)( struct pcap * );
int (CDECL *stats)( struct pcap *, void * );
const char * (CDECL *statustostr)( int );
int (CDECL *tstamp_type_name_to_val)( const char * );
const char * (CDECL *tstamp_type_val_to_description)( int );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment