diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-07-29 05:47:07 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-07-29 05:47:07 +0000 |
commit | 7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3 (patch) | |
tree | 3e8a46fe6f7bb69698edb1187655e445bbfda37c | |
parent | 6f1d3a3be830da628246f7cea77fe9c491470d17 (diff) |
Made the protocol (but not the fields) use the new proto_tree routine,
allowing users to filter on the existence of these protocols. I also
added packet-clip.c to the Nmake makefile.
svn path=/trunk/; revision=402
-rw-r--r-- | Makefile.nmake | 62 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | packet-aarp.c | 18 | ||||
-rw-r--r-- | packet-arp.c | 20 | ||||
-rw-r--r-- | packet-atalk.c | 16 | ||||
-rw-r--r-- | packet-bootp.c | 18 | ||||
-rw-r--r-- | packet-cdp.c | 19 | ||||
-rw-r--r-- | packet-data.c | 5 | ||||
-rw-r--r-- | packet-dns.c | 17 | ||||
-rw-r--r-- | packet-eth.c | 16 | ||||
-rw-r--r-- | packet-fddi.c | 14 | ||||
-rw-r--r-- | packet-ftp.c | 21 | ||||
-rw-r--r-- | packet-giop.c | 20 | ||||
-rw-r--r-- | packet-gre.c | 22 | ||||
-rw-r--r-- | packet-http.c | 19 | ||||
-rw-r--r-- | packet-icmpv6.c | 19 | ||||
-rw-r--r-- | packet-ip.c | 48 | ||||
-rw-r--r-- | packet-ipsec.c | 22 | ||||
-rw-r--r-- | packet-ipv6.c | 17 | ||||
-rw-r--r-- | packet-ipx.c | 22 | ||||
-rw-r--r-- | packet-isakmp.c | 18 | ||||
-rw-r--r-- | packet-llc.c | 14 | ||||
-rw-r--r-- | packet-nbipx.c | 20 | ||||
-rw-r--r-- | packet-nbns.c | 29 | ||||
-rw-r--r-- | packet-ncp.c | 19 | ||||
-rw-r--r-- | packet-nntp.c | 19 | ||||
-rw-r--r-- | packet-null.c | 10 | ||||
-rw-r--r-- | packet-osi.c | 35 | ||||
-rw-r--r-- | packet-ospf.c | 17 | ||||
-rw-r--r-- | packet-pop.c | 21 | ||||
-rw-r--r-- | packet-ppp.c | 20 | ||||
-rw-r--r-- | packet-rip.c | 17 | ||||
-rw-r--r-- | packet-rsvp.c | 19 | ||||
-rw-r--r-- | packet-rtsp.c | 19 | ||||
-rw-r--r-- | packet-sdp.c | 19 | ||||
-rw-r--r-- | packet-smb.c | 19 | ||||
-rw-r--r-- | packet-snmp.c | 22 | ||||
-rw-r--r-- | packet-telnet.c | 21 | ||||
-rw-r--r-- | packet-tftp.c | 19 | ||||
-rw-r--r-- | packet-tr.c | 44 | ||||
-rw-r--r-- | packet-trmac.c | 26 | ||||
-rw-r--r-- | proto.c | 72 |
42 files changed, 721 insertions, 217 deletions
diff --git a/Makefile.nmake b/Makefile.nmake index 57e90f7f22..6083603e7f 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -23,19 +23,55 @@ CFLAGS=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) /I$(GLIB_DIR) /I$(GTK_DIR) /Iwiretap \ OBJECTS=capture.obj column.obj dfilter-grammar.obj dfilter.obj \ display.obj ethereal.obj ethertype.obj file.obj filter.obj \ follow.obj gtkpacket.obj menu.obj \ - packet-aarp.obj packet-arp.obj \ - packet-atalk.obj packet-bootp.obj packet-cdp.obj packet-data.obj \ - packet-dns.obj packet-eth.obj packet-fddi.obj packet-ftp.obj \ - packet-giop.obj packet-gre.obj packet-http.obj packet-icmpv6.obj \ - packet-ip.obj packet-ipsec.obj packet-ipv6.obj packet-ipx.obj \ - packet-isakmp.obj packet-llc.obj packet-lpd.obj packet-nbipx.obj \ - packet-nbns.obj packet-ncp.obj packet-nntp.obj packet-null.obj \ - packet-osi.obj packet-ospf.obj packet-pop.obj packet-ppp.obj \ - packet-pppoe.obj packet-pptp.obj packet-radius.obj packet-raw.obj \ - packet-rip.obj packet-rsvp.obj packet-rtsp.obj packet-sdp.obj \ - packet-smb.obj packet-snmp.obj packet-tcp.obj packet-telnet.obj \ - packet-tftp.obj packet-tr.obj packet-trmac.obj packet-udp.obj \ - packet-vines.obj packet.obj prefs.obj print.obj proto.obj ps.obj \ + packet-aarp.obj \ + packet-arp.obj \ + packet-atalk.obj \ + packet-bootp.obj \ + packet-cdp.obj \ + packet-clip.obj \ + packet-data.obj \ + packet-dns.obj \ + packet-eth.obj \ + packet-fddi.obj \ + packet-ftp.obj \ + packet-giop.obj \ + packet-gre.obj \ + packet-http.obj \ + packet-icmpv6.obj \ + packet-ip.obj \ + packet-ipsec.obj \ + packet-ipv6.obj \ + packet-ipx.obj \ + packet-isakmp.obj \ + packet-llc.obj \ + packet-lpd.obj \ + packet-nbipx.obj \ + packet-nbns.obj \ + packet-ncp.obj \ + packet-nntp.obj \ + packet-null.obj \ + packet-osi.obj \ + packet-ospf.obj \ + packet-pop.obj \ + packet-ppp.obj \ + packet-pppoe.obj \ + packet-pptp.obj \ + packet-radius.obj \ + packet-raw.obj \ + packet-rip.obj \ + packet-rsvp.obj \ + packet-rtsp.obj \ + packet-sdp.obj \ + packet-smb.obj \ + packet-snmp.obj \ + packet-tcp.obj \ + packet-telnet.obj \ + packet-tftp.obj \ + packet-tr.obj \ + packet-trmac.obj \ + packet-udp.obj \ + packet-vines.obj \ + packet.obj prefs.obj print.obj proto.obj ps.obj \ resolv.obj snprintf.obj strerror.obj summary.obj util.obj LIBS= wiretap\libwtap.lib wsock32.lib \ @@ -6,6 +6,10 @@ Overview of changes in Ethereal 0.7.0: * Display filter text-entry does auto-reload (Guy) * Now compiles on Win32 (Gilbert) * Removed support for GTK+-1.[01].x (Gilbert) +* Column re-sizing changes (Guy) +* Linux ATM Classical IP support (Theirry) +* X.25 support in wiretap iptrace routine (Olivier) +* Wiretap fix for "-S" ethereal option (Laurent) Overview of changes in Ethereal 0.6.3: * Capture dialogue window data bug-fix (Guy) diff --git a/packet-aarp.c b/packet-aarp.c index 053ab0b3ba..148dd93ceb 100644 --- a/packet-aarp.c +++ b/packet-aarp.c @@ -31,6 +31,8 @@ #include "packet.h" #include "etypes.h" +static int proto_aarp = -1; + typedef struct _e_ether_aarp { guint16 htype, ptype; guint8 halen, palen; @@ -96,9 +98,9 @@ dissect_aarp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { if (tree) { if ((op_str = match_strval(ea.op, op_vals))) - ti = proto_tree_add_text(tree, offset, 28, op_str); + ti = proto_tree_add_item_format(tree, proto_aarp, offset, 28, NULL, op_str); else - ti = proto_tree_add_text(tree, offset, 28, + ti = proto_tree_add_item_format(tree, proto_aarp, offset, 28, NULL, "Unknown AARP (opcode 0x%04x)", ea.op); aarp_tree = proto_item_add_subtree(ti, ETT_AARP); proto_tree_add_text(aarp_tree, offset, 2, @@ -145,3 +147,15 @@ dissect_aarp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { } } } + +void +proto_register_aarp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "aarp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_aarp = proto_register_protocol("Appletalk Address Resolution Protocol", "aarp"); + /* proto_register_field_array(proto_aarp, hf, array_length(hf));*/ +} diff --git a/packet-arp.c b/packet-arp.c index b3ddf2149d..4ae66b30ca 100644 --- a/packet-arp.c +++ b/packet-arp.c @@ -1,7 +1,7 @@ /* packet-arp.c * Routines for ARP packet disassembly * - * $Id: packet-arp.c,v 1.14 1999/07/07 22:51:40 gram Exp $ + * $Id: packet-arp.c,v 1.15 1999/07/29 05:46:52 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -35,6 +35,8 @@ #include "packet.h" #include "etypes.h" +static int proto_arp = -1; + /* Definitions taken from Linux "linux/if_arp.h" header file, and from http://www.isi.edu/in-notes/iana/assignments/arp-parameters @@ -216,10 +218,10 @@ dissect_arp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { if (tree) { if ((op_str = match_strval(ar_op, op_vals))) - ti = proto_tree_add_text(tree, offset, 8 + 2*ar_hln + 2*ar_pln, + ti = proto_tree_add_item_format(tree, proto_arp, offset, 8 + 2*ar_hln + 2*ar_pln, op_str); else - ti = proto_tree_add_text(tree, offset, 8 + 2*ar_hln + 2*ar_pln, + ti = proto_tree_add_item_format(tree, proto_arp, offset, 8 + 2*ar_hln + 2*ar_pln, "Unknown ARP (opcode 0x%04x)", ar_op); arp_tree = proto_item_add_subtree(ti, ETT_ARP); proto_tree_add_text(arp_tree, offset + AR_HRD, 2, @@ -242,3 +244,15 @@ dissect_arp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { "Target protocol address: %s", tpa_str); } } + +void +proto_register_arp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "arp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_arp = proto_register_protocol("Address Resolution Protocol", "arp"); + /* proto_register_field_array(proto_arp, hf, array_length(hf));*/ +} diff --git a/packet-atalk.c b/packet-atalk.c index 726d91cde4..27dd684483 100644 --- a/packet-atalk.c +++ b/packet-atalk.c @@ -35,6 +35,8 @@ extern packet_info pi; +static int proto_ddp = -1; + /* P = Padding, H = Hops, L = Len */ #if BYTE_ORDER == BIG_ENDIAN /* PPHHHHLL LLLLLLLL */ @@ -91,7 +93,7 @@ dissect_ddp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { val_to_str(ddp.type, op_vals, "Unknown DDP protocol (%02x)")); if (tree) { - ti = proto_tree_add_text(tree, offset, 13, "Datagram Delivery Protocol"); + ti = proto_tree_add_item(tree, proto_ddp, offset, 13, NULL); ddp_tree = proto_item_add_subtree(ti, ETT_IP); proto_tree_add_text(ddp_tree, offset, 1, "Hop count: %d", ddp_hops(ddp.hops_len)); proto_tree_add_text(ddp_tree, offset, 2, "Datagram length: %d", ddp_len(ddp.hops_len)); @@ -108,3 +110,15 @@ dissect_ddp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { offset += 13; } + +void +proto_register_atalk(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "ddp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_ddp = proto_register_protocol("Datagram Delivery Protocol", "ddp"); + /* proto_register_field_array(proto_ddp, hf, array_length(hf));*/ +} diff --git a/packet-bootp.c b/packet-bootp.c index 19fcf4f4dc..94d13636f3 100644 --- a/packet-bootp.c +++ b/packet-bootp.c @@ -2,7 +2,7 @@ * Routines for BOOTP/DHCP packet disassembly * Gilbert Ramirez <gram@verdict.uthscsa.edu> * - * $Id: packet-bootp.c,v 1.17 1999/07/07 22:51:40 gram Exp $ + * $Id: packet-bootp.c,v 1.18 1999/07/29 05:46:52 gram Exp $ * * The information used comes from: * RFC 2132: DHCP Options and BOOTP Vendor Extensions @@ -40,6 +40,8 @@ #include <glib.h> #include "packet.h" +static int proto_bootp = -1; + enum field_type { none, ipv4, string, toggle, yes_no, special, opaque, time_in_secs, val_u_byte, val_u_short, val_u_long, @@ -452,8 +454,7 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (tree) { - ti = proto_tree_add_text(tree, offset, END_OF_FRAME, - "Bootstrap Protocol"); + ti = proto_tree_add_item(tree, proto_bootp, offset, END_OF_FRAME, NULL); bp_tree = proto_item_add_subtree(ti, ETT_BOOTP); proto_tree_add_text(bp_tree, offset, 1, pd[offset] == 1 ? @@ -524,3 +525,14 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } } +void +proto_register_bootp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "bootp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_bootp = proto_register_protocol("Bootstrap Protocol", "bootp"); + /* proto_register_field_array(proto_bootp, hf, array_length(hf));*/ +} diff --git a/packet-cdp.c b/packet-cdp.c index 8874e048e2..7d545cacd1 100644 --- a/packet-cdp.c +++ b/packet-cdp.c @@ -2,7 +2,7 @@ * Routines for the disassembly of the "Cisco Discovery Protocol" * (c) Copyright Hannes R. Boehm <hannes@boehm.org> * - * $Id: packet-cdp.c,v 1.9 1999/07/07 22:51:41 gram Exp $ + * $Id: packet-cdp.c,v 1.10 1999/07/29 05:46:52 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -40,6 +40,8 @@ #define TLV_TYPE 0 #define TLV_LENGTH 2 +static int proto_cdp = -1; + static void add_multi_line_string_to_tree(proto_tree *tree, gint start, gint len, const gchar *prefix, const gchar *string); @@ -66,8 +68,7 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { col_add_str(fd, COL_INFO, "Cisco Discovery Protocol"); if(tree){ - ti = proto_tree_add_text(tree, offset, (fd->cap_len - offset), - "Cisco Discovery Protocol"); + ti = proto_tree_add_item(tree, proto_cdp, offset, (fd->cap_len - offset), NULL); cdp_tree = proto_item_add_subtree(ti, ETT_CDP); /* CDP header */ @@ -187,3 +188,15 @@ add_multi_line_string_to_tree(proto_tree *tree, gint start, gint len, prefix = blanks; } } + +void +proto_register_cdp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "cdp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_cdp = proto_register_protocol("Cisco Discovery Protocol", "cdp"); + /* proto_register_field_array(proto_cdp, hf, array_length(hf));*/ +} diff --git a/packet-data.c b/packet-data.c index f28300f16a..ef719327c3 100644 --- a/packet-data.c +++ b/packet-data.c @@ -2,7 +2,7 @@ * Routines for raw data (default case) * Gilbert Ramirez <gram@verdict.uthscsa.edu> * - * $Id: packet-data.c,v 1.9 1999/07/07 22:51:41 gram Exp $ + * $Id: packet-data.c,v 1.10 1999/07/29 05:46:53 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -35,6 +35,9 @@ #include <glib.h> #include "packet.h" +/* proto_data cannot be static because it's referenced in the + * print routines + */ int proto_data = -1; void diff --git a/packet-dns.c b/packet-dns.c index 66eec34107..7ff4b7f113 100644 --- a/packet-dns.c +++ b/packet-dns.c @@ -1,7 +1,7 @@ /* packet-dns.c * Routines for DNS packet disassembly * - * $Id: packet-dns.c,v 1.19 1999/07/07 22:51:41 gram Exp $ + * $Id: packet-dns.c,v 1.20 1999/07/29 05:46:53 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -40,6 +40,7 @@ #include "packet-dns.h" #include "util.h" +static int proto_dns = -1; /* DNS structs and definitions */ @@ -706,7 +707,7 @@ dissect_dns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { } if (tree) { - ti = proto_tree_add_text(tree, offset, 4, + ti = proto_tree_add_item_format(tree, proto_dns, offset, 4, NULL, (flags & F_RESPONSE) ? "DNS response" : "DNS query"); dns_tree = proto_item_add_subtree(ti, ETT_DNS); @@ -781,3 +782,15 @@ dissect_dns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { dns_tree, "Additional records"); } } + +void +proto_register_dns(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "dns.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_dns = proto_register_protocol("Domain Name Service", "dns"); + /* proto_register_field_array(proto_dns, hf, array_length(hf));*/ +} diff --git a/packet-eth.c b/packet-eth.c index af24e3bb88..3a06b413cc 100644 --- a/packet-eth.c +++ b/packet-eth.c @@ -1,7 +1,7 @@ /* packet-eth.c * Routines for ethernet packet disassembly * - * $Id: packet-eth.c,v 1.12 1999/07/15 15:32:40 gram Exp $ + * $Id: packet-eth.c,v 1.13 1999/07/29 05:46:54 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -39,13 +39,13 @@ extern const value_string etype_vals[]; /* protocols and header fields */ -int proto_eth = -1; -int hf_eth_dst = -1; -int hf_eth_dst_vendor = -1; -int hf_eth_src = -1; -int hf_eth_src_vendor = -1; -int hf_eth_len = -1; -int hf_eth_type = -1; +static int proto_eth = -1; +static int hf_eth_dst = -1; +static int hf_eth_dst_vendor = -1; +static int hf_eth_src = -1; +static int hf_eth_src_vendor = -1; +static int hf_eth_len = -1; +static int hf_eth_type = -1; #define IEEE_802_3_MAX_LEN 1500 diff --git a/packet-fddi.c b/packet-fddi.c index 32a4f1a1d4..159024dcf8 100644 --- a/packet-fddi.c +++ b/packet-fddi.c @@ -3,7 +3,7 @@ * * Laurent Deniel <deniel@worldnet.fr> * - * $Id: packet-fddi.c,v 1.14 1999/07/15 15:32:41 gram Exp $ + * $Id: packet-fddi.c,v 1.15 1999/07/29 05:46:54 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -37,12 +37,12 @@ #include "packet.h" #include "resolv.h" -int proto_fddi = -1; -int hf_fddi_fc = -1; -int hf_fddi_dst = -1; -int hf_fddi_dst_vendor = -1; -int hf_fddi_src = -1; -int hf_fddi_src_vendor = -1; +static int proto_fddi = -1; +static int hf_fddi_fc = -1; +static int hf_fddi_dst = -1; +static int hf_fddi_dst_vendor = -1; +static int hf_fddi_src = -1; +static int hf_fddi_src_vendor = -1; /* FDDI Frame Control values */ diff --git a/packet-ftp.c b/packet-ftp.c index 7dddacd7a3..9db88105eb 100644 --- a/packet-ftp.c +++ b/packet-ftp.c @@ -2,7 +2,7 @@ * Routines for ftp packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-ftp.c,v 1.4 1999/07/07 22:51:43 gram Exp $ + * $Id: packet-ftp.c,v 1.5 1999/07/29 05:46:54 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -46,6 +46,8 @@ extern packet_info pi; +static int proto_ftp = -1; + void dissect_ftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int max_data) { @@ -92,8 +94,7 @@ dissect_ftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int if (tree) { - ti = proto_tree_add_text(tree, offset, END_OF_FRAME, - "File Transfer Protocol"); + ti = proto_tree_add_item(tree, proto_ftp, offset, END_OF_FRAME, NULL); ftp_tree = proto_item_add_subtree(ti, ETT_FTP); if (pi.match_port == pi.destport) { /* Request */ @@ -135,8 +136,14 @@ dissect_ftpdata(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, } } +void +proto_register_ftp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "ftp.abbreviation", TYPE, VALS_POINTER }}, + };*/ - - - - + proto_ftp = proto_register_protocol("File Transfer Protocol", "ftp"); + /* proto_register_field_array(proto_ftp, hf, array_length(hf));*/ +} diff --git a/packet-giop.c b/packet-giop.c index 376afe8cba..45558b667b 100644 --- a/packet-giop.c +++ b/packet-giop.c @@ -3,7 +3,7 @@ * * Laurent Deniel <deniel@worldnet.fr> * - * $Id: packet-giop.c,v 1.3 1999/07/07 22:51:43 gram Exp $ + * $Id: packet-giop.c,v 1.4 1999/07/29 05:46:54 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -40,6 +40,8 @@ #include <glib.h> #include "packet.h" +static int proto_giop = -1; + /* * GIOP / IIOP types definition - OMG CORBA 2.x / GIOP 1.[01] * See OMG WEB site <http://www.omg.org> - CORBA+IIOP 2.2 (98-02-01.ps) @@ -258,9 +260,8 @@ void dissect_giop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree } if (tree) { - ti = proto_tree_add_text(tree, offset, - GIOP_HEADER_SIZE + message_size, - "General Inter-ORB Protocol"); + ti = proto_tree_add_item(tree, proto_giop, offset, + GIOP_HEADER_SIZE + message_size, NULL); clnp_tree = proto_item_add_subtree(ti, ETT_GIOP); proto_tree_add_text(clnp_tree, offset, 4, "Magic number: %s", GIOP_MAGIC); @@ -696,3 +697,14 @@ void dissect_giop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree } /* dissect_giop */ +void +proto_register_giop(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "giop.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_giop = proto_register_protocol("General Inter-ORB Protocol", "giop"); + /* proto_register_field_array(proto_giop, hf, array_length(hf));*/ +} diff --git a/packet-gre.c b/packet-gre.c index 5dc3204797..21d3b02ef4 100644 --- a/packet-gre.c +++ b/packet-gre.c @@ -2,7 +2,7 @@ * Routines for the Generic Routing Encapsulation (GRE) protocol * Brad Robel-Forrest <brad.robel-forrest@watchguard.com> * - * $Id: packet-gre.c,v 1.3 1999/07/13 02:52:51 gram Exp $ + * $Id: packet-gre.c,v 1.4 1999/07/29 05:46:55 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -38,6 +38,8 @@ #include <glib.h> #include "packet.h" +static int proto_gre = -1; + /* bit positions for flags in header */ #define GH_B_C 0x8000 #define GH_B_R 0x4000 @@ -82,15 +84,14 @@ dissect_gre(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { if (type == GRE_PPP) { is_ppp = 1; - ti = proto_tree_add_text(tree, offset, calc_len(flags_and_ver, 1), - "Generic Routing Encapsulation (PPP)"); + ti = proto_tree_add_item_format(tree, proto_gre, offset, calc_len(flags_and_ver, 1), + NULL, "Generic Routing Encapsulation (PPP)"); gre_tree = proto_item_add_subtree(ti, ETT_GRE); add_flags_and_ver(gre_tree, flags_and_ver, offset, 1); } else { is_ppp = 0; - ti = proto_tree_add_text(tree, offset, calc_len(flags_and_ver, 1), - "Generic Routing Encapsulation"); + ti = proto_tree_add_item(tree, proto_gre, offset, calc_len(flags_and_ver, 1), NULL); gre_tree = proto_item_add_subtree(ti, ETT_GRE); add_flags_and_ver(gre_tree, flags_and_ver, offset, 0); } @@ -234,3 +235,14 @@ add_flags_and_ver(proto_tree *tree, guint16 flags_and_ver, int offset, int is_pp "Version: %u")); } +void +proto_register_gre(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "gre.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_gre = proto_register_protocol("Generic Routing Encapsulation", "gre"); + /* proto_register_field_array(proto_gre, hf, array_length(hf));*/ +} diff --git a/packet-http.c b/packet-http.c index b904329978..816cf4571e 100644 --- a/packet-http.c +++ b/packet-http.c @@ -3,7 +3,7 @@ * * Guy Harris <guy@netapp.com> * - * $Id: packet-http.c,v 1.5 1999/07/13 02:52:51 gram Exp $ + * $Id: packet-http.c,v 1.6 1999/07/29 05:46:55 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -41,6 +41,8 @@ #include <glib.h> #include "packet.h" +static int proto_http = -1; + static int is_http_request_or_reply(const u_char *data, int linelen); void dissect_http(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) @@ -72,8 +74,7 @@ void dissect_http(const u_char *pd, int offset, frame_data *fd, proto_tree *tree } if (tree) { - ti = proto_tree_add_text(tree, offset, END_OF_FRAME, - "Hypertext Transfer Protocol"); + ti = proto_tree_add_item(tree, proto_http, offset, END_OF_FRAME, NULL); http_tree = proto_item_add_subtree(ti, ETT_HTTP); while (data < dataend) { @@ -207,3 +208,15 @@ is_http_request_or_reply(const u_char *data, int linelen) } return FALSE; } + +void +proto_register_http(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "http.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_http = proto_register_protocol("Hyptertext Transfer Protocol", "http"); + /* proto_register_field_array(proto_http, hf, array_length(hf));*/ +} diff --git a/packet-icmpv6.c b/packet-icmpv6.c index e7a5615a26..f4c734c77d 100644 --- a/packet-icmpv6.c +++ b/packet-icmpv6.c @@ -1,7 +1,7 @@ /* packet-icmpv6.c * Routines for ICMPv6 packet disassembly * - * $Id: packet-icmpv6.c,v 1.6 1999/07/28 02:32:25 gerald Exp $ + * $Id: packet-icmpv6.c,v 1.7 1999/07/29 05:46:55 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -63,6 +63,8 @@ #define offsetof(type, member) ((size_t)(&((type *)0)->member)) #endif +static int proto_icmpv6 = -1; + static void dissect_icmpv6opt(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { @@ -336,8 +338,7 @@ dissect_icmpv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { /* !!! specify length */ - ti = proto_tree_add_text(tree, offset, len, - "ICMPv6"); + ti = proto_tree_add_item(tree, proto_icmpv6, offset, len, NULL); icmp6_tree = proto_item_add_subtree(ti, ETT_ICMPv6); proto_tree_add_text(icmp6_tree, @@ -565,3 +566,15 @@ dissect_icmpv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } } } + +void +proto_register_icmpv6(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "icmpv6.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_icmpv6 = proto_register_protocol("ICMPv6", "icmpv6"); + /* proto_register_field_array(proto_icmpv6, hf, array_length(hf));*/ +} diff --git a/packet-ip.c b/packet-ip.c index 1ed42f6697..ddf05cbe99 100644 --- a/packet-ip.c +++ b/packet-ip.c @@ -1,7 +1,7 @@ /* packet-ip.c * Routines for IP and miscellaneous IP protocol packet disassembly * - * $Id: packet-ip.c,v 1.30 1999/07/17 04:19:03 gram Exp $ + * $Id: packet-ip.c,v 1.31 1999/07/29 05:46:55 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -48,23 +48,26 @@ extern packet_info pi; -int proto_ip = -1; -int hf_ip_version = -1; -int hf_ip_hdr_len = -1; -int hf_ip_tos = -1; -int hf_ip_tos_precedence = -1; -int hf_ip_len = -1; -int hf_ip_id = -1; -int hf_ip_dst = -1; -int hf_ip_src = -1; -int hf_ip_addr = -1; - -int proto_igmp = -1; -int hf_igmp_version = -1; -int hf_igmp_type = -1; -int hf_igmp_unused = -1; -int hf_igmp_checksum = -1; -int hf_igmp_group = -1; +static int proto_ip = -1; +static int hf_ip_version = -1; +static int hf_ip_hdr_len = -1; +static int hf_ip_tos = -1; +static int hf_ip_tos_precedence = -1; +static int hf_ip_len = -1; +static int hf_ip_id = -1; +static int hf_ip_dst = -1; +static int hf_ip_src = -1; +static int hf_ip_addr = -1; + +static int proto_igmp = -1; +static int hf_igmp_version = -1; +static int hf_igmp_type = -1; +static int hf_igmp_unused = -1; +static int hf_igmp_checksum = -1; +static int hf_igmp_group = -1; + +static int proto_icmp = -1; + /* ICMP structs and definitions */ typedef struct _e_icmp { @@ -911,8 +914,7 @@ dissect_icmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { col_add_str(fd, COL_INFO, type_str); if (tree) { - ti = proto_tree_add_text(tree, offset, 4, - "Internet Control Message Protocol"); + ti = proto_tree_add_item(tree, proto_icmp, offset, 4, NULL); icmp_tree = proto_item_add_subtree(ti, ETT_ICMP); proto_tree_add_text(icmp_tree, offset, 1, "Type: %d (%s)", ih.icmp_type, type_str); @@ -1136,3 +1138,9 @@ proto_register_ip(void) proto_ip = proto_register_protocol ("Internet Protocol", "ip"); proto_register_field_array(proto_ip, hf, array_length(hf)); } + +void +proto_register_icmp(void) +{ + proto_icmp = proto_register_protocol ("Internet Control Message Protocol", "icmp"); +} diff --git a/packet-ipsec.c b/packet-ipsec.c index c4b54e4e5f..c525d11426 100644 --- a/packet-ipsec.c +++ b/packet-ipsec.c @@ -1,7 +1,7 @@ /* packet-ipsec.c * Routines for IPsec packet disassembly * - * $Id: packet-ipsec.c,v 1.2 1999/07/07 22:51:45 gram Exp $ + * $Id: packet-ipsec.c,v 1.3 1999/07/29 05:46:56 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -41,6 +41,9 @@ #include "packet.h" #include "resolv.h" +static int proto_ah = -1; +static int proto_esp = -1; + struct newah { guint8 ah_nxt; /* Next Header */ guint8 ah_len; /* Length of data + 1, in 32bit */ @@ -85,7 +88,7 @@ dissect_ah(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { /* !!! specify length */ - ti = proto_tree_add_text(tree, offset, advance, "Authentication Header"); + ti = proto_tree_add_item(tree, proto_ah, offset, advance, NULL); ah_tree = proto_item_add_subtree(ti, ETT_AH); proto_tree_add_text(ah_tree, offset + offsetof(struct newah, ah_nxt), 1, @@ -129,7 +132,7 @@ dissect_esp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) * (ie none) */ if(tree) { - ti = proto_tree_add_text(tree, 0, 0, "Encapsulated Security Payload"); + ti = proto_tree_add_item(tree, proto_esp, 0, 0, NULL); esp_tree = proto_item_add_subtree(ti, ETT_ESP); proto_tree_add_text(esp_tree, offset + offsetof(struct newesp, esp_spi), 4, "SPI: %08x", (guint32)ntohl(esp.esp_spi)); @@ -137,3 +140,16 @@ dissect_esp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) "Sequence?: %08x", (guint32)ntohl(esp.esp_seq)); } } + +void +proto_register_ipsec(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "ah.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_ah = proto_register_protocol("Authentication Header", "ah"); + proto_esp = proto_register_protocol("Encapsulated Security Payload", "esp"); + /* proto_register_field_array(proto_ah, hf, array_length(hf));*/ +} diff --git a/packet-ipv6.c b/packet-ipv6.c index c88fd1b8dd..70d367d024 100644 --- a/packet-ipv6.c +++ b/packet-ipv6.c @@ -1,7 +1,7 @@ /* packet-ipv6.c * Routines for IPv6 packet disassembly * - * $Id: packet-ipv6.c,v 1.10 1999/07/13 02:52:52 gram Exp $ + * $Id: packet-ipv6.c,v 1.11 1999/07/29 05:46:56 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -48,6 +48,8 @@ #include "etypes.h" #include "resolv.h" +static int proto_ipv6 = -1; + #ifndef offsetof #define offsetof(type, member) ((size_t)(&((type *)0)->member)) #endif @@ -127,7 +129,7 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { if (tree) { /* !!! specify length */ - ti = proto_tree_add_text(tree, offset, 40, "Internet Protocol Version 6"); + ti = proto_tree_add_item(tree, proto_ipv6, offset, 40, NULL); ipv6_tree = proto_item_add_subtree(ti, ETT_IPv6); /* !!! warning: version also contains 4 Bit priority */ @@ -402,3 +404,14 @@ inet_ntop6(src, dst, size) return (dst); } +void +proto_register_ipv6(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "ipv6.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_ipv6 = proto_register_protocol("Internet Protocol Version 6", "ipv6"); + /* proto_register_field_array(proto_ipv6, hf, array_length(hf));*/ +} diff --git a/packet-ipx.c b/packet-ipx.c index 641fb80f58..8490555de8 100644 --- a/packet-ipx.c +++ b/packet-ipx.c @@ -2,7 +2,7 @@ * Routines for NetWare's IPX * Gilbert Ramirez <gram@verdict.uthscsa.edu> * - * $Id: packet-ipx.c,v 1.23 1999/07/20 02:56:44 gram Exp $ + * $Id: packet-ipx.c,v 1.24 1999/07/29 05:46:57 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -49,16 +49,16 @@ */ -int proto_ipx = -1; -int hf_ipx_checksum = -1; -int hf_ipx_len = -1; -int hf_ipx_hops = -1; -int hf_ipx_dnode = -1; -int hf_ipx_snode = -1; - -int proto_spx = -1; -int proto_ipxrip = -1; -int proto_sap = -1; +static int proto_ipx = -1; +static int hf_ipx_checksum = -1; +static int hf_ipx_len = -1; +static int hf_ipx_hops = -1; +static int hf_ipx_dnode = -1; +static int hf_ipx_snode = -1; + +static int proto_spx = -1; +static int proto_ipxrip = -1; +static int proto_sap = -1; static void dissect_spx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int max_data); diff --git a/packet-isakmp.c b/packet-isakmp.c index 5e2b936ec7..c6267a0904 100644 --- a/packet-isakmp.c +++ b/packet-isakmp.c @@ -2,7 +2,7 @@ * Routines for the Internet Security Association and Key Management Protocol (ISAKMP) * Brad Robel-Forrest <brad.robel-forrest@watchguard.com> * - * $Id: packet-isakmp.c,v 1.6 1999/07/13 02:52:52 gram Exp $ + * $Id: packet-isakmp.c,v 1.7 1999/07/29 05:46:57 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -50,6 +50,8 @@ # include "snprintf.h" #endif +static int proto_isakmp = -1; + #define NUM_PROTO_TYPES 5 #define proto2str(t) \ ((t < NUM_PROTO_TYPES) ? prototypestr[t] : "UNKNOWN-PROTO-TYPE") @@ -291,8 +293,7 @@ void dissect_isakmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tr proto_item * ti; proto_tree * isakmp_tree; - ti = proto_tree_add_text(tree, offset, len, - "Internet Security Association and Key Management Protocol"); + ti = proto_tree_add_item(tree, proto_isakmp, offset, len, NULL); isakmp_tree = proto_item_add_subtree(ti, ETT_ISAKMP); proto_tree_add_text(isakmp_tree, offset, sizeof(hdr->icookie), @@ -1049,3 +1050,14 @@ num2str(const guint8 *pd, guint16 len) { return numstr; } +void +proto_register_isakmp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "isakmp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_isakmp = proto_register_protocol("Internet Security Association and Key Management Protocol", "isakmp"); + /* proto_register_field_array(proto_isakmp, hf, array_length(hf));*/ +} diff --git a/packet-llc.c b/packet-llc.c index edbdf2c227..afd9bc20cc 100644 --- a/packet-llc.c +++ b/packet-llc.c @@ -2,7 +2,7 @@ * Routines for IEEE 802.2 LLC layer * Gilbert Ramirez <gramirez@tivoli.com> * - * $Id: packet-llc.c,v 1.16 1999/07/15 15:32:42 gram Exp $ + * $Id: packet-llc.c,v 1.17 1999/07/29 05:46:58 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -35,12 +35,12 @@ #include <glib.h> #include "packet.h" -int proto_llc = -1; -int hf_llc_dsap = -1; -int hf_llc_ssap = -1; -int hf_llc_ctrl = -1; -int hf_llc_type = -1; -int hf_llc_oui = -1; +static int proto_llc = -1; +static int hf_llc_dsap = -1; +static int hf_llc_ssap = -1; +static int hf_llc_ctrl = -1; +static int hf_llc_type = -1; +static int hf_llc_oui = -1; typedef void (capture_func_t)(const u_char *, int, guint32, packet_counts *); typedef void (dissect_func_t)(const u_char *, int, frame_data *, proto_tree *); diff --git a/packet-nbipx.c b/packet-nbipx.c index 8a2b973f40..4555d26791 100644 --- a/packet-nbipx.c +++ b/packet-nbipx.c @@ -2,7 +2,7 @@ * Routines for NetBIOS over IPX packet disassembly * Gilbert Ramirez <gram@verdict.uthscsa.edu> * - * $Id: packet-nbipx.c,v 1.8 1999/07/07 22:51:47 gram Exp $ + * $Id: packet-nbipx.c,v 1.9 1999/07/29 05:46:58 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -32,11 +32,12 @@ # include <sys/types.h> #endif -/*#include <memory.h>*/ #include <glib.h> #include "packet.h" #include "packet-ipx.h" /* for ipxnet_to_string() */ +static int proto_nbipx = -1; + enum nbipx_protocol { NETBIOS_NETWARE, NETBIOS_NWLINK @@ -141,8 +142,7 @@ nbipx_ns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, } if (tree) { - ti = proto_tree_add_text(tree, offset, 68, - "NetBIOS over IPX"); + ti = proto_tree_add_item(tree, proto_nbipx, offset, 68, NULL); nbipx_tree = proto_item_add_subtree(ti, ETT_NBIPX); if (header.packet_type <= 1) { @@ -194,6 +194,14 @@ nbipx_ns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, } } +void +proto_register_nbipx(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "nbipx.abbreviation", TYPE, VALS_POINTER }}, + };*/ - - + proto_nbipx = proto_register_protocol("NetBIOS over IPX", "nbipx"); + /* proto_register_field_array(proto_nbipx, hf, array_length(hf));*/ +} diff --git a/packet-nbns.c b/packet-nbns.c index c44de19a97..cbc3514c82 100644 --- a/packet-nbns.c +++ b/packet-nbns.c @@ -4,7 +4,7 @@ * Gilbert Ramirez <gram@verdict.uthscsa.edu> * Much stuff added by Guy Harris <guy@netapp.com> * - * $Id: packet-nbns.c,v 1.22 1999/07/07 22:51:47 gram Exp $ + * $Id: packet-nbns.c,v 1.23 1999/07/29 05:46:58 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -41,6 +41,10 @@ #include "packet-dns.h" #include "util.h" +static int proto_nbns = -1; +static int proto_nbdgm = -1; +static int proto_nbss = -1; + /* Packet structure taken from RFC 1002. See also RFC 1001. * Opcode, flags, and rcode treated as "flags", similarly to DNS, * to make it easier to lift the dissection code from "packet-dns.c". */ @@ -906,8 +910,7 @@ dissect_nbns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (tree) { - ti = proto_tree_add_text(tree, offset, END_OF_FRAME, - "NetBIOS Name Service"); + ti = proto_tree_add_item(tree, proto_nbns, offset, END_OF_FRAME, NULL); nbns_tree = proto_item_add_subtree(ti, ETT_NBNS); proto_tree_add_text(nbns_tree, offset + NBNS_ID, 2, @@ -1045,8 +1048,7 @@ dissect_nbdgm(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, } if (tree) { - ti = proto_tree_add_text(tree, offset, header.dgm_length, - "NetBIOS Datagram Service"); + ti = proto_tree_add_item(tree, proto_nbdgm, offset, header.dgm_length, NULL); nbdgm_tree = proto_item_add_subtree(ti, ETT_NBDGM); proto_tree_add_text(nbdgm_tree, offset, 1, "Message Type: %s", @@ -1184,8 +1186,7 @@ dissect_nbss_packet(const u_char *pd, int offset, frame_data *fd, proto_tree *tr length += 65536; if (tree) { - ti = proto_tree_add_text(tree, offset, length + 4, - "NetBIOS Session Service"); + ti = proto_tree_add_item(tree, proto_nbss, offset, length + 4, NULL); nbss_tree = proto_item_add_subtree(ti, ETT_NBSS); proto_tree_add_text(nbss_tree, offset, 1, "Message Type: %s", @@ -1289,3 +1290,17 @@ dissect_nbss(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int } } + +void +proto_register_nbt(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "nbipx.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_nbns = proto_register_protocol("NetBIOS Name Service", "nbns"); + proto_nbdgm = proto_register_protocol("NetBIOS Datagram Service", "nbdgm"); + proto_nbss = proto_register_protocol("NetBIOS Session Service", "nbss"); + /* proto_register_field_array(proto_nbipx, hf, array_length(hf));*/ +} diff --git a/packet-ncp.c b/packet-ncp.c index 6b2d9225bb..cc17ed6687 100644 --- a/packet-ncp.c +++ b/packet-ncp.c @@ -2,7 +2,7 @@ * Routines for NetWare Core Protocol * Gilbert Ramirez <gram@verdict.uthscsa.edu> * - * $Id: packet-ncp.c,v 1.17 1999/07/13 02:52:52 gram Exp $ + * $Id: packet-ncp.c,v 1.18 1999/07/29 05:46:59 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -43,6 +43,8 @@ #include "packet-ipx.h" #include "packet-ncp.h" +static int proto_ncp = -1; + struct svc_record; static void @@ -449,8 +451,7 @@ dissect_ncp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, nw_ncp_type = header.type; if (tree) { - ti = proto_tree_add_text(tree, offset, END_OF_FRAME, - "NetWare Core Protocol"); + ti = proto_tree_add_item(tree, proto_ncp, offset, END_OF_FRAME, NULL); ncp_tree = proto_item_add_subtree(ti, ETT_NCP); proto_tree_add_text(ncp_tree, offset, 2, @@ -847,3 +848,15 @@ ncp_completion_code(guint8 ccode, enum nfamily family) return "I don't know how to parse this completion code. Please send this packet trace to Gilbert Ramirez <gram@xiexie.org> for analysis"; } } + +void +proto_register_ncp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "ncp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_ncp = proto_register_protocol("NetWare Core Protocol", "ncp"); + /* proto_register_field_array(proto_ncp, hf, array_length(hf));*/ +} diff --git a/packet-nntp.c b/packet-nntp.c index d4fd4900aa..01dd9da4d5 100644 --- a/packet-nntp.c +++ b/packet-nntp.c @@ -2,7 +2,7 @@ * Routines for nntp packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-nntp.c,v 1.2 1999/07/07 22:51:49 gram Exp $ + * $Id: packet-nntp.c,v 1.3 1999/07/29 05:47:00 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -43,6 +43,8 @@ extern packet_info pi; +static int proto_nntp = -1; + void dissect_nntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int max_data) { @@ -77,8 +79,7 @@ dissect_nntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int if (tree) { - ti = proto_tree_add_text(tree, offset, END_OF_FRAME, - "Network News Transfer Protocol"); + ti = proto_tree_add_item(tree, proto_nntp, offset, END_OF_FRAME, NULL); nntp_tree = proto_item_add_subtree(ti, ETT_NNTP); /* @@ -106,3 +107,15 @@ dissect_nntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int } } } + +void +proto_register_nntp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "nntp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_nntp = proto_register_protocol("Network News Transfer Protocol", "nntp"); + /* proto_register_field_array(proto_nntp, hf, array_length(hf));*/ +} diff --git a/packet-null.c b/packet-null.c index ec43d1bc69..493012bab0 100644 --- a/packet-null.c +++ b/packet-null.c @@ -1,7 +1,7 @@ /* packet-null.c * Routines for null packet disassembly * - * $Id: packet-null.c,v 1.9 1999/07/13 02:52:53 gram Exp $ + * $Id: packet-null.c,v 1.10 1999/07/29 05:47:00 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -40,10 +40,10 @@ #include "packet.h" -int proto_null = -1; -int hf_null_next = -1; -int hf_null_len = -1; -int hf_null_family = -1; +static int proto_null = -1; +static int hf_null_next = -1; +static int hf_null_len = -1; +static int hf_null_family = -1; /* Null/loopback structs and definitions */ diff --git a/packet-osi.c b/packet-osi.c index 933811b1ee..79672c6d92 100644 --- a/packet-osi.c +++ b/packet-osi.c @@ -1,7 +1,7 @@ /* packet-osi.c * Routines for ISO/OSI network and transport protocol packet disassembly * - * $Id: packet-osi.c,v 1.7 1999/07/07 22:51:49 gram Exp $ + * $Id: packet-osi.c,v 1.8 1999/07/29 05:47:00 gram Exp $ * Laurent Deniel <deniel@worldnet.fr> * * Ethereal - Network traffic analyzer @@ -45,6 +45,8 @@ #include <glib.h> #include "packet.h" +static int proto_osi = 1; + /* Network layer protocol identifiers */ #define ISO8473_CLNP 0x81 @@ -245,7 +247,7 @@ static int osi_decode_DR(const u_char *pd, int offset, src_ref, dst_ref); if (tree) { - ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP"); + ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL); cotp_tree = proto_item_add_subtree(ti, ETT_COTP); proto_tree_add_text(cotp_tree, offset, 1, "Length indicator: %d", li); @@ -337,7 +339,7 @@ static int osi_decode_DT(const u_char *pd, int offset, (fragment)? "(fragment)" : ""); if (tree) { - ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP"); + ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL); cotp_tree = proto_item_add_subtree(ti, ETT_COTP); proto_tree_add_text(cotp_tree, offset, 1, "Length indicator: %d", li); @@ -471,7 +473,7 @@ static int osi_decode_ED(const u_char *pd, int offset, col_add_fstr(fd, COL_INFO, "ED TPDU (%d) dst-ref: 0x%04x", tpdu_nr, dst_ref); if (tree) { - ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP"); + ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL); cotp_tree = proto_item_add_subtree(ti, ETT_COTP); proto_tree_add_text(cotp_tree, offset, 1, "Length indicator: %d", li); @@ -553,7 +555,7 @@ static int osi_decode_RJ(const u_char *pd, int offset, col_add_fstr(fd, COL_INFO, "RJ TPDU (%d) dst-ref: 0x%04x", tpdu_nr, dst_ref); if (tree) { - ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP"); + ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL); cotp_tree = proto_item_add_subtree(ti, ETT_COTP); proto_tree_add_text(cotp_tree, offset, 1, "Length indicator: %d", li); @@ -641,7 +643,7 @@ static int osi_decode_CC(const u_char *pd, int offset, dst_ref); if (tree) { - ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP"); + ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL); cotp_tree = proto_item_add_subtree(ti, ETT_COTP); proto_tree_add_text(cotp_tree, offset, 1, "Length indicator: %d", li); @@ -913,7 +915,7 @@ static int osi_decode_DC(const u_char *pd, int offset, dst_ref); if (tree) { - ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP"); + ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL); cotp_tree = proto_item_add_subtree(ti, ETT_COTP); proto_tree_add_text(cotp_tree, offset, 1, "Length indicator: %d", li); @@ -966,7 +968,7 @@ static int osi_decode_AK(const u_char *pd, int offset, tpdu_nr, dst_ref); if (tree) { - ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP"); + ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL); cotp_tree = proto_item_add_subtree(ti, ETT_COTP); proto_tree_add_text(cotp_tree, offset, 1, "Length indicator: %d", li); @@ -1072,7 +1074,7 @@ static int osi_decode_AK(const u_char *pd, int offset, tpdu_nr, dst_ref); if (tree) { - ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP"); + ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL); cotp_tree = proto_item_add_subtree(ti, ETT_COTP); proto_tree_add_text(cotp_tree, offset, 1, "Length indicator: %d", li); @@ -1224,7 +1226,7 @@ static int osi_decode_EA(const u_char *pd, int offset, col_add_fstr(fd, COL_INFO, "EA TPDU (%d) dst-ref: 0x%04x", tpdu_nr, dst_ref); if (tree) { - ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP"); + ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL); cotp_tree = proto_item_add_subtree(ti, ETT_COTP); proto_tree_add_text(cotp_tree, offset, 1, "Length indicator: %d", li); @@ -1309,7 +1311,7 @@ static int osi_decode_ER(const u_char *pd, int offset, col_add_fstr(fd, COL_INFO, "ER TPDU dst-ref: 0x%04x", dst_ref); if (tree) { - ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP"); + ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL); cotp_tree = proto_item_add_subtree(ti, ETT_COTP); proto_tree_add_text(cotp_tree, offset, 1, "Length indicator: %d", li); @@ -1603,3 +1605,14 @@ void dissect_osi(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } /* dissect_osi */ +void +proto_register_osi(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "osi.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_osi = proto_register_protocol("ISO COTP", "osi"); + /* proto_register_field_array(proto_osi, hf, array_length(hf));*/ +} diff --git a/packet-ospf.c b/packet-ospf.c index f4fd8b2584..fe5d6f0d7a 100644 --- a/packet-ospf.c +++ b/packet-ospf.c @@ -2,7 +2,7 @@ * Routines for OSPF packet disassembly * (c) Copyright Hannes R. Boehm <hannes@boehm.org> * - * $Id: packet-ospf.c,v 1.11 1999/07/07 22:51:50 gram Exp $ + * $Id: packet-ospf.c,v 1.12 1999/07/29 05:47:01 gram Exp $ * * At this time, this module is able to analyze OSPF * packets as specified in RFC2328. MOSPF (RFC1584) and other @@ -50,6 +50,7 @@ #include "packet.h" #include "packet-ospf.h" +static int proto_ospf = -1; void dissect_ospf(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { @@ -80,7 +81,7 @@ dissect_ospf(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { } if (tree) { - ti = proto_tree_add_text(tree, offset, ntohs(ospfh.length), "Open Shortest Path First"); + ti = proto_tree_add_item(tree, proto_ospf, offset, ntohs(ospfh.length), NULL); ospf_tree = proto_item_add_subtree(ti, ETT_OSPF); ti = proto_tree_add_text(ospf_tree, offset, OSPF_HEADER_LENGTH, "OSPF Header"); @@ -572,3 +573,15 @@ dissect_ospf_lsa(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, /* return the length of this LSA */ return ntohs(lsa_hdr.length); } + +void +proto_register_ospf(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "ospf.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_ospf = proto_register_protocol("Open Shortest Path First", "ospf"); + /* proto_register_field_array(proto_ospf, hf, array_length(hf));*/ +} diff --git a/packet-pop.c b/packet-pop.c index 6a0485b2bd..ff8547639b 100644 --- a/packet-pop.c +++ b/packet-pop.c @@ -2,7 +2,7 @@ * Routines for pop packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-pop.c,v 1.4 1999/07/07 22:51:50 gram Exp $ + * $Id: packet-pop.c,v 1.5 1999/07/29 05:47:01 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -46,6 +46,8 @@ extern packet_info pi; +static int proto_pop = -1; + void dissect_pop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int max_data) { @@ -81,8 +83,7 @@ dissect_pop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int if (tree) { - ti = proto_tree_add_text(tree, offset, END_OF_FRAME, - "Post Office Protocol"); + ti = proto_tree_add_item(tree, proto_pop, offset, END_OF_FRAME, NULL); pop_tree = proto_item_add_subtree(ti, ETT_POP); if (pi.match_port == pi.destport) { /* Request */ @@ -102,8 +103,14 @@ dissect_pop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int } } +void +proto_register_pop(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "pop.abbreviation", TYPE, VALS_POINTER }}, + };*/ - - - - + proto_pop = proto_register_protocol("Post Office Protocol", "pop"); + /* proto_register_field_array(proto_pop, hf, array_length(hf));*/ +} diff --git a/packet-ppp.c b/packet-ppp.c index 4dc8cc2c1e..9fdd14bb03 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.12 1999/07/07 22:51:50 gram Exp $ + * $Id: packet-ppp.c,v 1.13 1999/07/29 05:47:01 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -35,6 +35,8 @@ #include <glib.h> #include "packet.h" +static int proto_ppp = -1; + /* PPP structs and definitions */ typedef struct _e_ppphdr { @@ -274,7 +276,7 @@ dissect_payload_ppp( const u_char *pd, int offset, frame_data *fd, proto_tree *t /* populate a tree in the second pane with the status of the link layer (ie none) */ if(tree) { - ti = proto_tree_add_text(tree, 0+offset, 2, "Point-to-Point Protocol" ); + ti = proto_tree_add_item(tree, proto_ppp, 0+offset, 2, NULL); fh_tree = proto_item_add_subtree(ti, ETT_PPP); proto_tree_add_text(fh_tree, 0+offset, 2, "Protocol: %s (0x%04x)", val_to_str(ph.ppp_prot, ppp_vals, "Unknown"), ph.ppp_prot); @@ -344,7 +346,7 @@ dissect_ppp( const u_char *pd, frame_data *fd, proto_tree *tree ) { /* populate a tree in the second pane with the status of the link layer (ie none) */ if(tree) { - ti = proto_tree_add_text(tree, 0, 4, "Point-to-Point Protocol" ); + ti = proto_tree_add_item(tree, proto_ppp, 0, 4, NULL); fh_tree = proto_item_add_subtree(ti, ETT_PPP); proto_tree_add_text(fh_tree, 0, 1, "Address: %02x", ph.ppp_addr); proto_tree_add_text(fh_tree, 1, 1, "Control: %02x", ph.ppp_ctl); @@ -375,3 +377,15 @@ dissect_ppp( const u_char *pd, frame_data *fd, proto_tree *tree ) { break; } } + +void +proto_register_ppp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "ppp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_ppp = proto_register_protocol("Point-to-Point Protocol", "ppp"); + /* proto_register_field_array(proto_ppp, hf, array_length(hf));*/ +} diff --git a/packet-rip.c b/packet-rip.c index 7d1a780638..9b05d3e8bb 100644 --- a/packet-rip.c +++ b/packet-rip.c @@ -2,7 +2,7 @@ * Routines for RIPv1 and RIPv2 packet disassembly * (c) Copyright Hannes R. Boehm <hannes@boehm.org> * - * $Id: packet-rip.c,v 1.9 1999/07/07 22:51:52 gram Exp $ + * $Id: packet-rip.c,v 1.10 1999/07/29 05:47:02 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -38,6 +38,8 @@ #include "packet.h" #include "packet-rip.h" +static int proto_rip = -1; + static void dissect_ip_rip_vektor(guint8 version, const e_rip_vektor *rip_vektor, int offset, proto_tree *tree); static void dissect_rip_authentication(const e_rip_authentication *rip_authentication, @@ -90,7 +92,7 @@ dissect_rip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { col_add_str(fd, COL_INFO, packet_type[rip_header.command]); if (tree) { - ti = proto_tree_add_text(tree, offset, (fd->cap_len - offset), "Routing Information Protocol"); + ti = proto_tree_add_item(tree, proto_rip, offset, (fd->cap_len - offset), NULL); rip_tree = proto_item_add_subtree(ti, ETT_RIP); proto_tree_add_text(rip_tree, offset, 1, "Command: %d (%s)", rip_header.command, packet_type[rip_header.command]); @@ -175,3 +177,14 @@ dissect_rip_authentication(const e_rip_authentication *rip_authentication, rip_authentication->authentication); } +void +proto_register_rip(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "rip.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_rip = proto_register_protocol("Routing Information Protocol", "rip"); + /* proto_register_field_array(proto_rip, hf, array_length(hf));*/ +} diff --git a/packet-rsvp.c b/packet-rsvp.c index 9a6af6f33c..eebedd0cf4 100644 --- a/packet-rsvp.c +++ b/packet-rsvp.c @@ -3,7 +3,7 @@ * * (c) Copyright Ashok Narayanan <ashokn@cisco.com> * - * $Id: packet-rsvp.c,v 1.3 1999/07/13 02:52:55 gram Exp $ + * $Id: packet-rsvp.c,v 1.4 1999/07/29 05:47:02 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -72,6 +72,8 @@ #include "packet-ipv6.h" #include "packet-rsvp.h" +static int proto_rsvp = -1; + /* Stuff for IEEE float handling */ #define IEEE_NUMBER_WIDTH 32 /* bits in number */ @@ -164,8 +166,7 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { msg_length = pntohs(pd+offset+6); - ti = proto_tree_add_text(tree, offset, msg_length, - "Resource ReserVation Protocol (RSVP)"); + ti = proto_tree_add_item(tree, proto_rsvp, offset, msg_length, NULL); rsvp_tree = proto_item_add_subtree(ti, ETT_RSVP); ti = proto_tree_add_text(rsvp_tree, offset, @@ -844,3 +845,15 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } } } + +void +proto_register_rsvp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "rsvp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_rsvp = proto_register_protocol("Resource ReserVation Protocol (RSVP)", "rsvp"); + /* proto_register_field_array(proto_rsvp, hf, array_length(hf));*/ +} diff --git a/packet-rtsp.c b/packet-rtsp.c index 350286306a..e546068d33 100644 --- a/packet-rtsp.c +++ b/packet-rtsp.c @@ -4,7 +4,7 @@ * Jason Lango <jal@netapp.com> * Liberally copied from packet-http.c, by Guy Harris <guy@netapp.com> * - * $Id: packet-rtsp.c,v 1.2 1999/07/07 22:51:53 gram Exp $ + * $Id: packet-rtsp.c,v 1.3 1999/07/29 05:47:03 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -40,6 +40,8 @@ #include <glib.h> #include "packet.h" +static int proto_rtsp = -1; + static int is_rtsp_request_or_reply(const u_char *data, int linelen); static int @@ -104,8 +106,7 @@ void dissect_rtsp(const u_char *pd, int offset, frame_data *fd, rtsp_tree = NULL; if (tree) { - ti = proto_tree_add_text(tree, offset, END_OF_FRAME, - "Real Time Streaming Protocol"); + ti = proto_tree_add_item(tree, proto_rtsp, offset, END_OF_FRAME, NULL); rtsp_tree = proto_item_add_subtree(ti, ETT_RTSP); } @@ -238,3 +239,15 @@ is_rtsp_request_or_reply(const u_char *data, int linelen) return FALSE; } + +void +proto_register_rtsp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "rtsp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_rtsp = proto_register_protocol("Real Time Streaming Protocol", "rtsp"); + /* proto_register_field_array(proto_rtsp, hf, array_length(hf));*/ +} diff --git a/packet-sdp.c b/packet-sdp.c index c81554b712..8281e46321 100644 --- a/packet-sdp.c +++ b/packet-sdp.c @@ -4,7 +4,7 @@ * Jason Lango <jal@netapp.com> * Liberally copied from packet-http.c, by Guy Harris <guy@netapp.com> * - * $Id: packet-sdp.c,v 1.2 1999/07/07 22:51:53 gram Exp $ + * $Id: packet-sdp.c,v 1.3 1999/07/29 05:47:03 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -40,6 +40,8 @@ #include <glib.h> #include "packet.h" +static int proto_sdp = -1; + void dissect_sdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { @@ -68,8 +70,7 @@ void dissect_sdp(const u_char *pd, int offset, frame_data *fd, if (!tree) return; - ti = proto_tree_add_text(tree, offset, END_OF_FRAME, - "Session Description Protocol"); + ti = proto_tree_add_item(tree, proto_sdp, offset, END_OF_FRAME, NULL); sdp_tree = proto_item_add_subtree(ti, ETT_SDP); section = 0; @@ -173,3 +174,15 @@ void dissect_sdp(const u_char *pd, int offset, frame_data *fd, "Data (%d bytes)", END_OF_FRAME); } } + +void +proto_register_sdp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "sdp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_sdp = proto_register_protocol("Session Description Protocol", "sdp"); + /* proto_register_field_array(proto_sdp, hf, array_length(hf));*/ +} diff --git a/packet-smb.c b/packet-smb.c index 109486abe9..5844d41523 100644 --- a/packet-smb.c +++ b/packet-smb.c @@ -2,7 +2,7 @@ * Routines for smb packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-smb.c,v 1.20 1999/07/23 15:08:25 gram Exp $ + * $Id: packet-smb.c,v 1.21 1999/07/29 05:47:04 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -48,6 +48,8 @@ extern packet_info pi; +static int proto_smb = -1; + char *decode_smb_name(unsigned char); void (*dissect[256])(const u_char *, int, frame_data *, proto_tree *, int, int); @@ -3197,8 +3199,7 @@ dissect_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int if (tree) { - ti = proto_tree_add_text(tree, offset, END_OF_FRAME, - "Server Message Block Protocol"); + ti = proto_tree_add_item(tree, proto_smb, offset, END_OF_FRAME, NULL); smb_tree = proto_item_add_subtree(ti, ETT_SMB); /* 0xFFSMB is actually a 1 byte msg type and 3 byte server @@ -3404,3 +3405,15 @@ dissect_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int } + +void +proto_register_smb(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "smb.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_smb = proto_register_protocol("Server Message Block Protocol", "smb"); + /* proto_register_field_array(proto_smb, hf, array_length(hf));*/ +} diff --git a/packet-snmp.c b/packet-snmp.c index d7edc838e8..d1a78aa3bc 100644 --- a/packet-snmp.c +++ b/packet-snmp.c @@ -2,7 +2,7 @@ * Routines for SNMP (simple network management protocol) * D.Jorand (c) 1998 * - * $Id: packet-snmp.c,v 1.4 1999/07/07 22:51:54 gram Exp $ + * $Id: packet-snmp.c,v 1.5 1999/07/29 05:47:05 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -63,6 +63,8 @@ #include <ucd-snmp/snmp_impl.h> #include <ucd-snmp/mib.h> +static int proto_snmp = -1; + typedef long SNMP_INT; typedef unsigned long SNMP_UINT; #define OID_FORMAT_STRING "%ld" @@ -449,10 +451,10 @@ dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) "Unknown PDU type %#x"); if (check_col(fd, COL_INFO)) col_add_str(fd, COL_INFO, pdu_type_string); - if(tree) { + if (tree) { /* all_length=header_length+pdu_type_length+request_id_length+error_status_length+error_index_length; */ all_length=fd->pkt_len-offset; - item = proto_tree_add_text(tree, offset, all_length, "Simple Network Management Protocol"); + item = proto_tree_add_item(tree, proto_snmp, offset, all_length, NULL); snmp_tree = proto_item_add_subtree(item, ETT_SNMP); proto_tree_add_text(snmp_tree, offset, header_length, "Community: \"%s\", Version: %s", community, val_to_str(version, versions, "Unknown version %#x")); offset+=header_length; @@ -480,7 +482,7 @@ dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) col_add_str(fd, COL_INFO, pdu_type_string); if(tree) { all_length=fd->pkt_len-offset; - item = proto_tree_add_text(tree, offset, all_length, "Simple Network Management Protocol"); + item = proto_tree_add_item(tree, proto_snmp, offset, all_length, NULL); snmp_tree = proto_item_add_subtree(item, ETT_SNMP); proto_tree_add_text(snmp_tree, offset, header_length, "Community: \"%s\", Version: %s", community, val_to_str(version, versions, "Unknown version %#x")); offset+=header_length; @@ -856,4 +858,16 @@ dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } } +void +proto_register_snmp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "snmp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_snmp = proto_register_protocol("Simple Network Management Protocol", "snmp"); + /* proto_register_field_array(proto_snmp, hf, array_length(hf));*/ +} + #endif /* WITH_SNMP: CMU or UCD */ diff --git a/packet-telnet.c b/packet-telnet.c index 0f8d120496..b1bbbdf10f 100644 --- a/packet-telnet.c +++ b/packet-telnet.c @@ -2,7 +2,7 @@ * Routines for telnet packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-telnet.c,v 1.3 1999/07/07 22:51:55 gram Exp $ + * $Id: packet-telnet.c,v 1.4 1999/07/29 05:47:05 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -44,6 +44,8 @@ #include "packet.h" #include "etypes.h" +static int proto_telnet = -1; + /* Some defines for Telnet */ #define TN_IAC 255 @@ -331,8 +333,7 @@ dissect_telnet(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, i memcpy(rr, pd + offset, max_data); - ti = proto_tree_add_text(tree, offset, END_OF_FRAME, - "Telnet Protocol"); + ti = proto_tree_add_item(tree, proto_telnet, offset, END_OF_FRAME, NULL); telnet_tree = proto_item_add_subtree(ti, ETT_TELNET); i1 = i2 = i3 = 0; @@ -374,8 +375,14 @@ dissect_telnet(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, i } +void +proto_register_telnet(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "telnet.abbreviation", TYPE, VALS_POINTER }}, + };*/ - - - - + proto_telnet = proto_register_protocol("Telnet", "telnet"); + /* proto_register_field_array(proto_telnet, hf, array_length(hf));*/ +} diff --git a/packet-tftp.c b/packet-tftp.c index 221ef1ae9e..fd68155888 100644 --- a/packet-tftp.c +++ b/packet-tftp.c @@ -3,7 +3,7 @@ * * Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-tftp.c,v 1.4 1999/07/07 22:51:56 gram Exp $ + * $Id: packet-tftp.c,v 1.5 1999/07/29 05:47:06 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -41,6 +41,8 @@ #include <glib.h> #include "packet.h" +static int proto_tftp = -1; + #define RRQ 1 #define WRQ 2 #define DATA 3 @@ -88,8 +90,7 @@ dissect_tftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_text(tree, offset, END_OF_FRAME, - "Trivial File Transfer Protocol"); + ti = proto_tree_add_item(tree, proto_tftp, offset, END_OF_FRAME, NULL); tftp_tree = proto_item_add_subtree(ti, ETT_TFTP); switch (i1 = pntohs(pd+offset)) { @@ -142,3 +143,15 @@ dissect_tftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } } + +void +proto_register_tftp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "tftp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_tftp = proto_register_protocol("Trivial File Transfer Protocol", "tftp"); + /* proto_register_field_array(proto_tftp, hf, array_length(hf));*/ +} diff --git a/packet-tr.c b/packet-tr.c index 3aa811da3a..28051d30a1 100644 --- a/packet-tr.c +++ b/packet-tr.c @@ -2,7 +2,7 @@ * Routines for Token-Ring packet disassembly * Gilbert Ramirez <gram@verdict.uthscsa.edu> * - * $Id: packet-tr.c,v 1.16 1999/07/15 15:32:42 gram Exp $ + * $Id: packet-tr.c,v 1.17 1999/07/29 05:47:06 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -37,27 +37,27 @@ #include "packet.h" #include "etypes.h" -int proto_tr = -1; -int hf_tr_dst = -1; -int hf_tr_src = -1; -int hf_tr_dst_vendor = -1; -int hf_tr_src_vendor = -1; -int hf_tr_sr = -1; -int hf_tr_ac = -1; -int hf_tr_priority = -1; -int hf_tr_frame = -1; -int hf_tr_monitor_cnt = -1; -int hf_tr_priority_reservation = -1; -int hf_tr_fc = -1; -int hf_tr_fc_type = -1; -int hf_tr_fc_pcf = -1; -int hf_tr_rif_bytes = -1; -int hf_tr_broadcast = -1; -int hf_tr_max_frame_size = -1; -int hf_tr_direction = -1; -int hf_tr_rif = -1; -int hf_tr_rif_ring = -1; -int hf_tr_rif_bridge = -1; +static int proto_tr = -1; +static int hf_tr_dst = -1; +static int hf_tr_src = -1; +static int hf_tr_dst_vendor = -1; +static int hf_tr_src_vendor = -1; +static int hf_tr_sr = -1; +static int hf_tr_ac = -1; +static int hf_tr_priority = -1; +static int hf_tr_frame = -1; +static int hf_tr_monitor_cnt = -1; +static int hf_tr_priority_reservation = -1; +static int hf_tr_fc = -1; +static int hf_tr_fc_type = -1; +static int hf_tr_fc_pcf = -1; +static int hf_tr_rif_bytes = -1; +static int hf_tr_broadcast = -1; +static int hf_tr_max_frame_size = -1; +static int hf_tr_direction = -1; +static int hf_tr_rif = -1; +static int hf_tr_rif_ring = -1; +static int hf_tr_rif_bridge = -1; static const value_string ac_vals[] = { { 0, "Token" }, diff --git a/packet-trmac.c b/packet-trmac.c index ff58766fc8..67d6f04d5d 100644 --- a/packet-trmac.c +++ b/packet-trmac.c @@ -2,7 +2,7 @@ * Routines for Token-Ring Media Access Control * Gilbert Ramirez <gram@verdict.uthscsa.edu> * - * $Id: packet-trmac.c,v 1.12 1999/07/07 22:51:56 gram Exp $ + * $Id: packet-trmac.c,v 1.13 1999/07/29 05:47:06 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -35,6 +35,8 @@ #include <glib.h> #include "packet.h" +static int proto_trmac = -1; + /* Major Vector */ static value_string major_vectors[] = { { 0x00, "Response" }, @@ -252,12 +254,6 @@ dissect_trmac(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { mv_length = pntohs(&pd[offset]); - if (tree) { - ti = proto_tree_add_text(tree, offset, mv_length, - "Media Access Control"); - mac_tree = proto_item_add_subtree(ti, ETT_TR_MAC); - } - /* Interpret the major vector */ mv_text = val_to_str(pd[offset+3], major_vectors, "Unknown Major Vector: %d\n"); @@ -268,6 +264,10 @@ dissect_trmac(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { col_add_str(fd, COL_INFO, mv_text); if (tree) { + + ti = proto_tree_add_item(tree, proto_trmac, offset, mv_length, NULL); + mac_tree = proto_item_add_subtree(ti, ETT_TR_MAC); + if (mv_text) proto_tree_add_text(mac_tree, offset+3, 1, "Major Vector Command: %s", mv_text); @@ -298,3 +298,15 @@ dissect_trmac(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { } } } + +void +proto_register_trmac(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "trmac.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_trmac = proto_register_protocol("Token-Ring Media Access Control", "trmac"); + /* proto_register_field_array(proto_trmac, hf, array_length(hf));*/ +} @@ -1,7 +1,7 @@ /* proto.c * Routines for protocol tree * - * $Id: proto.c,v 1.4 1999/07/22 16:41:22 gram Exp $ + * $Id: proto.c,v 1.5 1999/07/29 05:47:07 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -80,17 +80,51 @@ static int proto_register_field_init(header_field_info *hfinfo, int parent); void dfilter_yacc_init(void); /* centralization of registration functions */ +void proto_register_aarp(void); +void proto_register_arp(void); +void proto_register_atalk(void); +void proto_register_bootp(void); +void proto_register_cdp(void); void proto_register_data(void); +void proto_register_dns(void); void proto_register_eth(void); void proto_register_fddi(void); void proto_register_frame(void); +void proto_register_ftp(void); +void proto_register_giop(void); +void proto_register_gre(void); +void proto_register_http(void); +void proto_register_icmp(void); +void proto_register_icmpv6(void); void proto_register_igmp(void); void proto_register_ip(void); +void proto_register_ipsec(void); +void proto_register_ipv6(void); void proto_register_ipx(void); +void proto_register_isakmp(void); void proto_register_llc(void); +void proto_register_nbipx(void); +void proto_register_nbt(void); +void proto_register_ncp(void); +void proto_register_nntp(void); void proto_register_null(void); +void proto_register_osi(void); +void proto_register_ospf(void); +void proto_register_pop(void); +void proto_register_ppp(void); +void proto_register_rip(void); +void proto_register_rsvp(void); +void proto_register_rtsp(void); +void proto_register_sdp(void); +void proto_register_smb(void); +#if defined(WITH_SNMP_CMU) || defined(WITH_SNMP_UCD) +void proto_register_snmp(void); +#endif +void proto_register_telnet(void); +void proto_register_tftp(void); void proto_register_tcp(void); void proto_register_tr(void); +void proto_register_trmac(void); void proto_register_udp(void); /* special-case header field used within proto.c */ @@ -138,17 +172,51 @@ proto_init(void) /* Have each dissector register its protocols and fields. The * order doesn't matter. Put the calls in alphabetical order * just to make it easy. */ + proto_register_aarp(); + proto_register_arp(); + proto_register_atalk(); + proto_register_bootp(); + proto_register_cdp(); proto_register_data(); + proto_register_dns(); proto_register_eth(); proto_register_fddi(); proto_register_frame(); + proto_register_ftp(); + proto_register_giop(); + proto_register_gre(); + proto_register_http(); + proto_register_icmp(); + proto_register_icmpv6(); proto_register_igmp(); proto_register_ip(); + proto_register_ipsec(); + proto_register_ipv6(); proto_register_ipx(); + proto_register_isakmp(); proto_register_llc(); + proto_register_nbipx(); + proto_register_nbt(); + proto_register_ncp(); + proto_register_nntp(); proto_register_null(); - proto_register_tr(); + proto_register_osi(); + proto_register_ospf(); + proto_register_pop(); + proto_register_ppp(); + proto_register_rip(); + proto_register_rsvp(); + proto_register_rtsp(); + proto_register_sdp(); + proto_register_smb(); +#if defined(WITH_SNMP_CMU) || defined(WITH_SNMP_UCD) + proto_register_snmp(); +#endif + proto_register_telnet(); + proto_register_tftp(); proto_register_tcp(); + proto_register_tr(); + proto_register_trmac(); proto_register_udp(); /* Register one special-case FT_TEXT_ONLY field for use when |