aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/libpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-03-15 09:11:03 +0000
committerGuy Harris <guy@alum.mit.edu>2001-03-15 09:11:03 +0000
commit7ecac8fbd047f9bfaefd05287e1e6916c3d85bd9 (patch)
treecf8e3945012163e0e15fde35c4e967ef6ebd56c6 /wiretap/libpcap.c
parent56d199c7ff62eab6b942177adf69ff0a2392707b (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/libpcap.c')
-rw-r--r--wiretap/libpcap.c22
1 files changed, 14 insertions, 8 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