13 lines
727 B
C
13 lines
727 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#ifndef PCAP_DYN_H
|
|
#define PCAP_DYN_H
|
|
#include <sys/time.h>
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
/* Public libpcap ABI subset. No private structs are accessed. */
|
|
typedef struct pcap pcap_t;
|
|
struct pcap_pkthdr {struct timeval ts;uint32_t caplen,len;};
|
|
struct pcap_api {void *lib;pcap_t *(*open_live)(const char *,int,int,int,char *);int (*datalink)(pcap_t *);int (*setnonblock)(pcap_t *,int,char *);int (*setdirection)(pcap_t *,int);int (*get_selectable_fd)(pcap_t *);int (*next_ex)(pcap_t *,struct pcap_pkthdr **,const unsigned char **);int (*inject)(pcap_t *,const void *,size_t);char *(*geterr)(pcap_t *);void (*close)(pcap_t *);};
|
|
int pcap_load(struct pcap_api *);
|
|
#endif
|