diff options
author | fenner <fenner@FreeBSD.org> | 2003-01-26 01:21:53 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 2003-01-26 01:21:53 +0000 |
commit | 84873f87eebd4e808f0f6e053cf2c7cf006a3093 (patch) | |
tree | c3d9775a4050dac5b69fcd191fe0c0410ff29e7c /contrib | |
parent | e3b499182e0d845807379fcfa83a8abf4c50f461 (diff) | |
download | FreeBSD-src-84873f87eebd4e808f0f6e053cf2c7cf006a3093.zip FreeBSD-src-84873f87eebd4e808f0f6e053cf2c7cf006a3093.tar.gz |
Merge multi-DLT support.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/libpcap/gencode.c | 7 | ||||
-rw-r--r-- | contrib/libpcap/pcap-int.h | 2 | ||||
-rw-r--r-- | contrib/libpcap/pcap.3 | 30 | ||||
-rw-r--r-- | contrib/libpcap/pcap.h | 2 |
4 files changed, 41 insertions, 0 deletions
diff --git a/contrib/libpcap/gencode.c b/contrib/libpcap/gencode.c index ea622de..211e863 100644 --- a/contrib/libpcap/gencode.c +++ b/contrib/libpcap/gencode.c @@ -567,6 +567,11 @@ init_linktype(type) off_nl = 6; /* XXX in reality, variable! */ return; + case DLT_IEEE802_11: + off_linktype = 30; /* XXX variable */ + off_nl = 32; + return; + case DLT_EN10MB: off_linktype = 12; off_nl = 14; @@ -662,6 +667,7 @@ init_linktype(type) off_nl = 22; return; +#ifdef notdef case DLT_IEEE802_11: /* * 802.11 doesn't really have a link-level type field. @@ -678,6 +684,7 @@ init_linktype(type) off_linktype = 24; off_nl = 30; return; +#endif case DLT_PRISM_HEADER: /* diff --git a/contrib/libpcap/pcap-int.h b/contrib/libpcap/pcap-int.h index dbac588..7e54052 100644 --- a/contrib/libpcap/pcap-int.h +++ b/contrib/libpcap/pcap-int.h @@ -106,6 +106,8 @@ struct pcap { struct bpf_program fcode; char errbuf[PCAP_ERRBUF_SIZE]; + int dlt_count; + int *dlt_list; }; /* diff --git a/contrib/libpcap/pcap.3 b/contrib/libpcap/pcap.3 index 76a8855..6ee773d 100644 --- a/contrib/libpcap/pcap.3 +++ b/contrib/libpcap/pcap.3 @@ -84,6 +84,8 @@ u_char *pcap_next(pcap_t *p, struct pcap_pkthdr *h) .LP .ft B int pcap_datalink(pcap_t *p) +int pcap_list_datalinks(pcap_t *p, int **dlt_buf); +int pcap_set_datalink(pcap_t *p, int dlt); int pcap_snapshot(pcap_t *p) int pcap_is_swapped(pcap_t *p) int pcap_major_version(pcap_t *p) @@ -665,6 +667,34 @@ header or 4 for frames beginning with an 802.2 LLC header. Apple LocalTalk; the packet begins with an AppleTalk LLAP header .RE .PP +.B pcap_list_datalinks() +is used to get a list of the supported data link types of the interface +associated with the pcap descriptor. +.B pcap_list_datalinks() +allocates an array to hold the list and sets +.IR *dlt_buf . +The caller is responsible for freeing the array. +.B \-1 +is returned on failure; +otherwise, the number of data link types in the array is returned. +.PP +.B pcap_set_datalink() +is used to set the current data link type of the pcap descriptor +to the type specified by +.IR dlt . +.B \-1 +is returned on failure. +.PP +.B pcap_datalink_name_to_val() +translates a data link type name, which is a +.B DLT_ +name with the +.B DLT_ +removed, to the corresponding data link type value. The translation +is case-insensitive. +is used to set the current data link type of the pcap descriptor +NULL is returned on failure. +.PP .B pcap_snapshot() returns the snapshot length specified when .B pcap_open_live diff --git a/contrib/libpcap/pcap.h b/contrib/libpcap/pcap.h index e4ea023..aeaae49 100644 --- a/contrib/libpcap/pcap.h +++ b/contrib/libpcap/pcap.h @@ -183,6 +183,8 @@ int pcap_compile_nopcap(int, int, struct bpf_program *, char *, int, bpf_u_int32); void pcap_freecode(struct bpf_program *); int pcap_datalink(pcap_t *); +int pcap_list_datalinks(pcap_t *, int **); +int pcap_set_datalink(pcap_t *, int); int pcap_snapshot(pcap_t *); int pcap_is_swapped(pcap_t *); int pcap_major_version(pcap_t *); |