aboutsummaryrefslogtreecommitdiffstats
path: root/packet-igrp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-01-22 03:33:45 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-01-22 03:33:45 +0000
commitfd8ce4ea9bd10ffcc82c58b7346a5ffdffd8171b (patch)
treed6278fa82b47a9aa4ce9153dbf718e6cfc6b8fdc /packet-igrp.c
parent243514726a3775cf75887bd69d37dd9f0a5acf06 (diff)
Remove more "CHECK_DISPLAY_AS_DATA()" calls and "pinfo->current_proto ="
statements. Move the setting of the Protocol column in various dissectors before anything is fetched from the packet, and also clear the Info column at that point in those and some other dissectors, so that if an exception is thrown, the columns don't reflect the previous protocol. Make the IP dissector static, as it's called only via dissector tables or dissector handles. Also make the "dissect the TOS field as the DiffServ DS field" flag static, as it's not referred to outside of "packet-ip.c". In the NCP dissector, refer to the port type through "pinfo" rather than through the global "pi", as it's a tvbuffified dissector. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2929 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-igrp.c')
-rw-r--r--packet-igrp.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/packet-igrp.c b/packet-igrp.c
index 6b2ad76e94..86a31f1b3e 100644
--- a/packet-igrp.c
+++ b/packet-igrp.c
@@ -2,7 +2,7 @@
* Routines for IGRP dissection
* Copyright 2000, Paul Ionescu <paul@acorp.ro>
*
- * $Id: packet-igrp.c,v 1.4 2001/01/09 06:31:36 guy Exp $
+ * $Id: packet-igrp.c,v 1.5 2001/01/22 03:33:45 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -60,18 +60,16 @@ static void dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *igrp_tree, *igrp_vektor_tree;
tvbuff_t *next_tvb;
- CHECK_DISPLAY_AS_DATA(proto_igrp, tvb, pinfo, tree);
-
- pinfo->current_proto = "IGRP";
-
+ if (check_col(pinfo->fd, COL_PROTOCOL))
+ col_set_str(pinfo->fd, COL_PROTOCOL, "IGRP");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
+
ver_and_opcode = tvb_get_guint8(tvb,0);
update = tvb_get_guint8(tvb,1);
as = tvb_get_ntohs(tvb,2);
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_set_str(pinfo->fd, COL_PROTOCOL, "IGRP");
-
if (check_col(pinfo->fd, COL_INFO)) {
switch (ver_and_opcode) {
case 0x11:
@@ -207,7 +205,7 @@ void proto_register_igrp(void)
void
proto_reg_handoff_igrp(void)
{
- dissector_add("ip.proto", IP_PROTO_IGRP , dissect_igrp, proto_igrp);
+ dissector_add("ip.proto", IP_PROTO_IGRP, dissect_igrp, proto_igrp);
}
/* IGRP Packet structure: