diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-03-15 09:11:03 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-03-15 09:11:03 +0000 |
commit | 7ecac8fbd047f9bfaefd05287e1e6916c3d85bd9 (patch) | |
tree | cf8e3945012163e0e15fde35c4e967ef6ebd56c6 /wiretap | |
parent | 56d199c7ff62eab6b942177adf69ff0a2392707b (diff) |
Add a new Wiretap encapsulation type for Cisco HDLC. Map the NetBSD
DLT_HDLC to it.
Make a separate dissector for Cisco HDLC, and add a dissector for Cisco
SLARP. Have the PPP dissector call the Cisco HDLC dissector if the
address field is the Cisco HDLC unicast or multicast address. Use the
Cisco HDLC dissector for the Cisco HDLC Wiretap encapsulation type.
Add a new dissector table "chdlctype", for Cisco HDLC packet types
(they're *almost* the same as Ethernet types, but 0x8035 is SLARP, not
Reverse ARP, and 0x2000 is the Cisco Discovery protocol, for example),
replacing "fr.chdlc".
Have a "chdlctype()" routine, similar to "ethertype()", used both by the
Cisco HDLC and Frame Relay dissectors. Have a "chdlc_vals[]"
"value_string" table for Cisco HDLC types and protocol names. Split the
packet type field in the Frame Relay dissector into separate SNAP and
Cisco HDLC fields, and give them the Ethernet type and Cisco HDLC type
"value_string" tables, respectively.
svn path=/trunk/; revision=3133
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/libpcap.c | 22 | ||||
-rw-r--r-- | wiretap/wtap.c | 5 | ||||
-rw-r--r-- | wiretap/wtap.h | 5 |
3 files changed, 21 insertions, 11 deletions
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c index 5f2067ef0a..b85d518e38 100644 --- a/wiretap/libpcap.c +++ b/wiretap/libpcap.c @@ -1,6 +1,6 @@ /* libpcap.c * - * $Id: libpcap.c,v 1.47 2001/03/11 02:51:05 guy Exp $ + * $Id: libpcap.c,v 1.48 2001/03/15 09:11:03 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -147,7 +147,11 @@ static const struct { #if defined(DLT_LOOP) && (DLT_LOOP == 12) { 12, WTAP_ENCAP_NULL }, #elif defined(DLT_C_HDLC) && (DLT_C_HDLC == 12) - /* Put entry for Cisco HDLC here */ + /* + * Put entry for Cisco HDLC here. + * XXX - is this just WTAP_ENCAP_CHDLC, i.e. does the frame + * start with a 4-byte Cisco HDLC header? + */ #else { 12, WTAP_ENCAP_RAW_IP }, #endif @@ -220,7 +224,7 @@ static const struct { { 16, WTAP_ENCAP_LINUX_ATM_CLIP }, #endif #if defined(DLT_HDLC) && (DLT_HDLC == 16) - { 16, WTAP_ENCAP_PPP }, + { 16, WTAP_ENCAP_CHDLC }, #endif /* @@ -296,6 +300,11 @@ static const struct { * WTAP_ENCAP_PPP now) and "PPP where there's either HDLC * encapsulation or Cisco PPP" (which is what DLT_PPP_SERIAL * is) at some point. + * + * XXX - NetBSD has DLT_HDLC, which appears to be used for + * Cisco HDLC. Ideally, they should use DLT_PPP_SERIAL + * only for real live HDLC-encapsulated PPP, not for Cisco + * HDLC. */ { 50, WTAP_ENCAP_PPP }, @@ -323,11 +332,8 @@ static const struct { /* * These ones are handled in Ethereal, though. - * (We currently handle Cisco HDLC like PPP; the PPP dissector - * distinguishes between HDLC-encapsulated PPP and Cisco HDLC - * by looking at the address field.) */ - { 104, WTAP_ENCAP_PPP }, /* Cisco HDLC */ + { 104, WTAP_ENCAP_CHDLC }, /* Cisco HDLC */ { 106, WTAP_ENCAP_LINUX_ATM_CLIP }, /* @@ -349,8 +355,8 @@ static const struct { { 109, WTAP_ENCAP_ENC }, /* OpenBSD IPSEC enc */ { 110, WTAP_ENCAP_LANE_802_3 },/* ATM LANE 802.3 */ { 111, WTAP_ENCAP_HIPPI }, /* NetBSD HIPPI */ - { 112, WTAP_ENCAP_HDLC }, /* NetBSD HDLC framing */ #endif + { 112, WTAP_ENCAP_CHDLC }, /* NetBSD HDLC framing */ /* * Linux "cooked mode" captures, used by the current CVS version diff --git a/wiretap/wtap.c b/wiretap/wtap.c index 8ea3ed0916..200d6420a3 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -1,6 +1,6 @@ /* wtap.c * - * $Id: wtap.c,v 1.51 2001/01/08 22:18:22 guy Exp $ + * $Id: wtap.c,v 1.52 2001/03/15 09:11:03 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -127,6 +127,9 @@ const static struct encap_type_info { /* WTAP_ENCAP_FRELAY */ { "Frame Relay", "frelay" }, + + /* WTAP_ENCAP_CHDLC */ + { "Cisco HDLC", "chdlc" }, }; /* Name that should be somewhat descriptive. */ diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 16d39eeb25..fe4f302e77 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -1,6 +1,6 @@ /* wtap.h * - * $Id: wtap.h,v 1.85 2001/02/22 22:03:31 guy Exp $ + * $Id: wtap.h,v 1.86 2001/03/15 09:11:03 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -97,9 +97,10 @@ #define WTAP_ENCAP_IEEE_802_11 18 #define WTAP_ENCAP_SLL 19 #define WTAP_ENCAP_FRELAY 20 +#define WTAP_ENCAP_CHDLC 21 /* last WTAP_ENCAP_ value + 1 */ -#define WTAP_NUM_ENCAP_TYPES 21 +#define WTAP_NUM_ENCAP_TYPES 22 /* File types that can be read by wiretap. We support writing some many of these file types, too, so we |