From 562499a65ddb30de198356ebedff6d9790f59e67 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 7 Jun 2002 04:17:15 +0000 Subject: [PATCH] Reserve a DLT_ value for Frame Relay, and map BSD/OS's DLT_FR to it. --- bpf/net/bpf.h | 8 +++++++- pcap-bpf.c | 4 ++-- savefile.c | 10 +++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/bpf/net/bpf.h b/bpf/net/bpf.h index 9ddf855..9cf140d 100644 --- a/bpf/net/bpf.h +++ b/bpf/net/bpf.h @@ -37,7 +37,7 @@ * * @(#)bpf.h 7.1 (Berkeley) 5/7/91 * - * @(#) $Header: /tcpdump/master/libpcap/bpf/net/Attic/bpf.h,v 1.57 2002-06-06 08:57:04 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/libpcap/bpf/net/Attic/bpf.h,v 1.58 2002-06-07 04:17:15 guy Exp $ (LBL) */ #ifndef BPF_MAJOR_VERSION @@ -346,6 +346,12 @@ struct bpf_hdr { */ #define DLT_SUNATM 123 /* Solaris+SunATM */ +/* + * Reserved for Frame Relay; BSD/OS has a DLT_FR, with a value of 11, + * but that collides with other values. + */ +#define DLT_FRELAY 124 + /* * The instruction encodings. */ diff --git a/pcap-bpf.c b/pcap-bpf.c index 0ee7325..85f9804 100644 --- a/pcap-bpf.c +++ b/pcap-bpf.c @@ -20,7 +20,7 @@ */ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.49 2002-05-31 10:59:43 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.50 2002-06-07 04:17:15 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -313,7 +313,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf) break; case 11: /*DLT_FR*/ - v = DLT_RAW; /*XXX*/ + v = DLT_FRELAY; break; case 12: /*DLT_C_HDLC*/ diff --git a/savefile.c b/savefile.c index 541f222..42376af 100644 --- a/savefile.c +++ b/savefile.c @@ -30,7 +30,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.61 2002-06-06 08:57:03 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.62 2002-06-07 04:17:15 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -177,6 +177,7 @@ static const char rcsid[] = #define LINKTYPE_HHDLC 121 /* Siemens HiPath HDLC */ #define LINKTYPE_IP_OVER_FC 122 /* RFC 2625 IP-over-Fibre Channel */ #define LINKTYPE_SUNATM 123 /* Solaris+SunATM */ +#define LINKTYPE_FRELAY 124 /* Frame Relay */ static struct linktype_map { int dlt; @@ -204,6 +205,10 @@ static struct linktype_map { * have values that should never be equal to any DLT_* * code. */ +#ifdef DLT_FR + /* BSD/OS Frame Relay */ + { DLT_FR, LINKTYPE_FRELAY }, +#endif { DLT_ATM_RFC1483, LINKTYPE_ATM_RFC1483 }, { DLT_RAW, LINKTYPE_RAW }, { DLT_SLIP_BSDOS, LINKTYPE_SLIP_BSDOS }, @@ -261,6 +266,9 @@ static struct linktype_map { /* Solaris+SunATM */ { DLT_SUNATM, LINKTYPE_SUNATM }, + /* Frame Relay */ + { DLT_FRELAY, LINKTYPE_FRELAY }, + /* * Any platform that defines additional DLT_* codes should: *