2021-05-10 15:37:23 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2011, 2014 André Hentschel
|
|
|
|
* Copyright 2021 Hans Leidekker for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct pcap_if_hdr
|
|
|
|
{
|
|
|
|
struct pcap_if_hdr *next;
|
|
|
|
char *name;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct handler_callback
|
|
|
|
{
|
|
|
|
void (CALLBACK *callback)( unsigned char *, const void *, const unsigned char * );
|
|
|
|
void *user;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pcap_funcs
|
|
|
|
{
|
2021-05-10 15:37:24 +02:00
|
|
|
int (CDECL *activate)( void * );
|
2021-05-10 15:37:23 +02:00
|
|
|
void (CDECL *breakloop)( void * );
|
2021-05-10 15:37:24 +02:00
|
|
|
int (CDECL *can_set_rfmon)( void * );
|
2021-05-10 15:37:23 +02:00
|
|
|
void (CDECL *close)( void * );
|
|
|
|
int (CDECL *compile)( void *, void *, const char *, int, unsigned int );
|
2021-05-10 15:37:24 +02:00
|
|
|
void * (CDECL *create)( const char *, char * );
|
2021-05-10 15:37:23 +02:00
|
|
|
int (CDECL *datalink)( void * );
|
|
|
|
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 *),
|
|
|
|
unsigned char * );
|
|
|
|
void (CDECL *dump)( unsigned char *, const void *, const unsigned char * );
|
|
|
|
void * (CDECL *dump_open)( void *, const char * );
|
|
|
|
int (CDECL *findalldevs)( struct pcap_if_hdr **, char * );
|
2021-05-10 15:37:24 +02:00
|
|
|
void (CDECL *free_datalinks)( int * );
|
|
|
|
void (CDECL *free_tstamp_types)( int * );
|
2021-05-10 15:37:23 +02:00
|
|
|
void (CDECL *freealldevs)( struct pcap_if_hdr * );
|
|
|
|
void (CDECL *freecode)( void * );
|
2021-05-10 15:37:24 +02:00
|
|
|
int (CDECL *get_tstamp_precision)( void * );
|
2021-05-10 15:37:23 +02:00
|
|
|
char * (CDECL *geterr)( void * );
|
|
|
|
int (CDECL *getnonblock)( void *, char * );
|
|
|
|
const char * (CDECL *lib_version)( void );
|
|
|
|
int (CDECL *list_datalinks)( void *, int ** );
|
2021-05-10 15:37:24 +02:00
|
|
|
int (CDECL *list_tstamp_types)( void *, int ** );
|
2021-05-10 15:37:23 +02:00
|
|
|
int (CDECL *lookupnet)( const char *, unsigned int *, unsigned int *, char * );
|
|
|
|
int (CDECL *loop)( void *, 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 );
|
2021-05-10 15:37:24 +02:00
|
|
|
int (CDECL *set_buffer_size)( void *, int );
|
2021-05-10 15:37:23 +02:00
|
|
|
int (CDECL *set_datalink)( void *, int );
|
2021-05-10 15:37:24 +02:00
|
|
|
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 );
|
2021-05-10 15:37:23 +02:00
|
|
|
int (CDECL *setfilter)( void *, void * );
|
|
|
|
int (CDECL *setnonblock)( void *, int, char * );
|
|
|
|
int (CDECL *snapshot)( void * );
|
|
|
|
int (CDECL *stats)( void *, void * );
|
2021-05-10 15:37:24 +02:00
|
|
|
const char * (CDECL *statustostr)( int );
|
|
|
|
int (CDECL *tstamp_type_name_to_val)( const char * );
|
|
|
|
const char * (CDECL *tstamp_type_val_to_description)( int );
|
|
|
|
const char * (CDECL *tstamp_type_val_to_name)( int );
|
2021-05-10 15:37:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct pcap_callbacks
|
|
|
|
{
|
|
|
|
void (CDECL *handler)( struct handler_callback *, const void *, const unsigned char * );
|
|
|
|
};
|