/* packet-arp.c
* Routines for ARP packet disassembly
*
- * $Id: packet-arp.c,v 1.38 2000/11/30 10:42:50 guy Exp $
+ * $Id: packet-arp.c,v 1.39 2000/12/29 04:16:57 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
pinfo->current_proto = "ARP";
+ /* Call it ARP, for now, so that if we throw an exception before
+ we decide whether it's ARP or RARP or IARP or ATMARP, it shows
+ up in the packet list as ARP.
+
+ Clear the Info column so that, if we throw an exception, it
+ shows up as a short or malformed ARP frame. */
+ if (check_col(pinfo->fd, COL_PROTOCOL))
+ col_set_str(pinfo->fd, COL_PROTOCOL, "ARP");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
+
ar_hrd = tvb_get_ntohs(tvb, AR_HRD);
if (ar_hrd == ARPHRD_ATM2225) {
dissect_atmarp(tvb, pinfo, tree);
*
* Top-most dissector. Decides dissector based on Wiretap Encapsulation Type.
*
- * $Id: packet-frame.c,v 1.4 2000/12/15 03:30:21 gerald Exp $
+ * $Id: packet-frame.c,v 1.5 2000/12/29 04:16:57 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
}
}
CATCH(BoundsError) {
+ if (check_col(pinfo->fd, COL_INFO))
+ col_append_str(pinfo->fd, COL_INFO, "[Short Frame]");
proto_tree_add_protocol_format(tree, proto_short, tvb, 0, 0,
"[Short Frame: %s]", pinfo->current_proto );
}
CATCH(ReportedBoundsError) {
+ if (check_col(pinfo->fd, COL_INFO))
+ col_append_str(pinfo->fd, COL_INFO, "[Malformed Frame]");
proto_tree_add_protocol_format(tree, proto_malformed, tvb, 0, 0,
"[Malformed Frame: %s]", pinfo->current_proto );
}
/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
- * $Id: packet-ip.c,v 1.114 2000/12/14 21:44:01 guy Exp $
+ * $Id: packet-ip.c,v 1.115 2000/12/29 04:16:57 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
pinfo->current_proto = "IP";
+ if (check_col(pinfo->fd, COL_PROTOCOL))
+ col_set_str(pinfo->fd, COL_PROTOCOL, "IP");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
+
/* Avoids alignment problems on many architectures. */
tvb_memcpy(tvb, (guint8 *)&iph, offset, sizeof(e_ip));
iph.ip_len = ntohs(iph.ip_len);
nxt = iph.ip_p;
if (iph.ip_off & IP_OFFSET) {
/* fragmented */
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_set_str(pinfo->fd, COL_PROTOCOL, "IP");
if (check_col(pinfo->fd, COL_INFO))
col_add_fstr(pinfo->fd, COL_INFO, "Fragmented IP protocol (proto=%s 0x%02x, off=%u)",
ipprotostr(iph.ip_p), iph.ip_p, (iph.ip_off & IP_OFFSET) * 8);
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
if (!dissector_try_port(ip_dissector_table, nxt, next_tvb, pinfo, tree)) {
/* Unknown protocol */
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_set_str(pinfo->fd, COL_PROTOCOL, "IP");
if (check_col(pinfo->fd, COL_INFO))
col_add_fstr(pinfo->fd, COL_INFO, "%s (0x%02x)", ipprotostr(iph.ip_p), iph.ip_p);
dissect_data(next_tvb, 0, pinfo, tree);
pinfo->current_proto = "ICMP";
+ if (check_col(pinfo->fd, COL_PROTOCOL))
+ col_set_str(pinfo->fd, COL_PROTOCOL, "ICMP");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
+
/* To do: check for runts, errs, etc. */
icmp_type = tvb_get_guint8(tvb, 0);
icmp_code = tvb_get_guint8(tvb, 1);
strcpy(type_str, "Unknown ICMP (obsolete or malformed?)");
}
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_set_str(pinfo->fd, COL_PROTOCOL, "ICMP");
if (check_col(pinfo->fd, COL_INFO))
col_add_str(pinfo->fd, COL_INFO, type_str);
CHECK_DISPLAY_AS_DATA(proto_igmp, tvb, pinfo, tree);
pinfo->current_proto = "IGMP";
+
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "IGMP");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
/* Avoids alignment problems on many architectures. */
memcpy(&ih, tvb_get_ptr(tvb, 0, sizeof(e_igmp)), sizeof(e_igmp));
* Routines for NetBIOS over IPX packet disassembly
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-nbipx.c,v 1.31 2000/12/06 04:19:44 guy Exp $
+ * $Id: packet-nbipx.c,v 1.32 2000/12/29 04:16:57 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "NBIPX");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
/*
* As said above, we look at the length of the packet to decide
* Gilbert Ramirez <gram@xiexie.org>
* Modified to allow NCP over TCP/IP decodes by James Coe <jammer@cin.net>
*
- * $Id: packet-ncp.c,v 1.41 2000/11/19 08:54:00 guy Exp $
+ * $Id: packet-ncp.c,v 1.42 2000/12/29 04:16:57 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
pinfo->current_proto = "NCP";
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "NCP");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
if ( pi.ptype == PT_TCP || pi.ptype == PT_UDP ) {
ncpiph.signature = tvb_get_ntohl(tvb, 0);