diff options
author | Guy Harris <guy@alum.mit.edu> | 1998-11-05 10:16:59 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1998-11-05 10:16:59 +0000 |
commit | 24f375d9285e613ae367a517203d4b3444557adb (patch) | |
tree | 178d816dab14219849584b8cff18614aed36cba1 /packet-ppp.c | |
parent | d07cba10c1f05d221fdb2e7403d61269751548c9 (diff) | |
download | wireshark-24f375d9285e613ae367a517203d4b3444557adb.tar.gz wireshark-24f375d9285e613ae367a517203d4b3444557adb.tar.bz2 wireshark-24f375d9285e613ae367a517203d4b3444557adb.zip |
Add in a bunch of #defines for packet types.
Show the packet type as a string, as well as a hex number, in the detail
display. Show the packet type as a hex number in the summary display if
it's not a packet type we know about.
Don't put the "N on link, M captured" stuff in the PPP detail display,
as that's now in the frame detail display.
Handle IPv6, Appletalk, IPX, and Vines.
svn path=/trunk/; revision=79
Diffstat (limited to 'packet-ppp.c')
-rw-r--r-- | packet-ppp.c | 53 |
1 files changed, 48 insertions, 5 deletions
diff --git a/packet-ppp.c b/packet-ppp.c index 4da140ded6..3118dfc16e 100644 --- a/packet-ppp.c +++ b/packet-ppp.c @@ -1,7 +1,7 @@ /* packet-ppp.c * Routines for ppp packet disassembly * - * $Id: packet-ppp.c,v 1.5 1998/10/10 03:32:14 gerald Exp $ + * $Id: packet-ppp.c,v 1.6 1998/11/05 10:16:59 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -39,10 +39,40 @@ #include "ethereal.h" #include "packet.h" +/* Protocol types, from Linux "ppp_defs.h" and + + http://www.isi.edu/in-notes/iana/assignments/ppp-numbers + + */ +#define PPP_IP 0x21 /* Internet Protocol */ +#define PPP_AT 0x29 /* AppleTalk Protocol */ +#define PPP_IPX 0x2b /* IPX protocol */ +#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ +#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ +#define PPP_VINES 0x35 /* Banyan Vines */ +#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ +#define PPP_COMP 0xfd /* compressed packet */ +#define PPP_IPCP 0x8021 /* IP Control Protocol */ +#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ +#define PPP_IPXCP 0x802b /* IPX Control Protocol */ +#define PPP_CCP 0x80fd /* Compression Control Protocol */ +#define PPP_LCP 0xc021 /* Link Control Protocol */ +#define PPP_PAP 0xc023 /* Password Authentication Protocol */ +#define PPP_LQR 0xc025 /* Link Quality Report protocol */ +#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ +#define PPP_CBCP 0xc029 /* Callback Control Protocol */ + void dissect_ppp( const u_char *pd, frame_data *fd, GtkTree *tree ) { e_ppphdr ph; GtkWidget *ti, *fh_tree; + static const value_string ppp_vals[] = { + {PPP_IP, "IP" }, + {PPP_AT, "Appletalk" }, + {PPP_IPX, "Netware IPX/SPX"}, + {PPP_VINES, "Vines" }, + {PPP_IPV6, "IPv6" }, + {0, NULL } }; ph.ppp_addr = pd[0]; ph.ppp_ctl = pd[1]; @@ -61,21 +91,34 @@ dissect_ppp( const u_char *pd, frame_data *fd, GtkTree *tree ) { layer (ie none) */ if(tree) { ti = add_item_to_tree( GTK_WIDGET(tree), 0, 4, - "Point-to-Point Protocol (%d on link, %d captured)", fd->pkt_len, - fd->cap_len ); + "Point-to-Point Protocol" ); fh_tree = gtk_tree_new(); add_subtree(ti, fh_tree, ETT_PPP); add_item_to_tree(fh_tree, 0, 1, "Address: %02x", ph.ppp_addr); add_item_to_tree(fh_tree, 1, 1, "Control: %02x", ph.ppp_ctl); - add_item_to_tree(fh_tree, 2, 2, "Protocol: %04x", ph.ppp_prot); + add_item_to_tree(fh_tree, 2, 2, "Protocol: %s (0x%04x)", + val_to_str(ph.ppp_prot, ppp_vals, "Unknown"), ph.ppp_prot); } switch (ph.ppp_prot) { - case 0x0021: + case PPP_IP: dissect_ip(pd, 4, fd, tree); break; + case PPP_AT: + dissect_ddp(pd, 4, fd, tree); + break; + case PPP_IPX: + dissect_ipx(pd, 4, fd, tree); + break; + case PPP_VINES: + dissect_vines(pd, 4, fd, tree); + break; + case PPP_IPV6: + dissect_ipv6(pd, 4, fd, tree); + break; default: dissect_data(pd, 4, fd, tree); + if (fd->win_info[COL_NUM]) { sprintf(fd->win_info[COL_PROTOCOL], "0x%04x", ph.ppp_prot); } break; } } |