aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ospf.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-01-22 03:33:45 +0000
committerGuy Harris <guy@alum.mit.edu>2001-01-22 03:33:45 +0000
commit9f2c88966a252520a4bafaa5fee36cf39c1eb85a (patch)
treed6278fa82b47a9aa4ce9153dbf718e6cfc6b8fdc /packet-ospf.c
parent79e1fdb9e56339d8d7e8d9df090dc0386cf4131e (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. svn path=/trunk/; revision=2929
Diffstat (limited to 'packet-ospf.c')
-rw-r--r--packet-ospf.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/packet-ospf.c b/packet-ospf.c
index 09c03e230c..d618e3a82d 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.35 2001/01/09 06:31:40 guy Exp $
+ * $Id: packet-ospf.c,v 1.36 2001/01/22 03:33:45 guy Exp $
*
* At this time, this module is able to analyze OSPF
* packets as specified in RFC2328. MOSPF (RFC1584) and other
@@ -171,14 +171,13 @@ dissect_ospf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
char auth_data[8];
int crypto_len;
- CHECK_DISPLAY_AS_DATA(proto_ospf, tvb, pinfo, tree);
-
- pinfo->current_proto = "OSPF";
+ if (check_col(pinfo->fd, COL_PROTOCOL))
+ col_set_str(pinfo->fd, COL_PROTOCOL, "OSPF");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
version = tvb_get_guint8(tvb, 0);
packet_type = tvb_get_guint8(tvb, 1);
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_set_str(pinfo->fd, COL_PROTOCOL, "OSPF");
if (check_col(pinfo->fd, COL_INFO)) {
col_add_str(pinfo->fd, COL_INFO,
val_to_str(packet_type, pt_vals, "Unknown (%u)"));