* Routines for IGRP dissection
* Copyright 2000, Paul Ionescu <paul@acorp.ro>
*
- * $Id: packet-igrp.c,v 1.1 2000/10/26 09:14:28 guy Exp $
+ * $Id: packet-igrp.c,v 1.12 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
*
* Copied from packet-syslog.c
#include <string.h>
#include <glib.h>
-#include "packet.h"
+#include <epan/packet.h>
+#include "ipproto.h"
-#define IP_PROTO_IGRP 9
#define IGRP_HEADER_LENGTH 12
#define IGRP_ENTRY_LENGTH 14
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->cinfo, COL_PROTOCOL))
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "IGRP");
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_clear(pinfo->cinfo, 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_add_str(pinfo->fd, COL_PROTOCOL, "IGRP");
-
- if (check_col(pinfo->fd, COL_INFO)) {
+ if (check_col(pinfo->cinfo, COL_INFO)) {
switch (ver_and_opcode) {
case 0x11:
- col_add_fstr(pinfo->fd, COL_INFO, "Response" );
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Response" );
break;
case 0x12:
- col_add_fstr(pinfo->fd, COL_INFO, "Request" );
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Request" );
break;
default:
- col_add_fstr(pinfo->fd, COL_INFO, "Unknown version or opcode");
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown version or opcode");
}
}
if (tree) {
- ti = proto_tree_add_protocol_format(tree, proto_igrp, tvb, 0,
- tvb_length(tvb), "Cisco IGRP ");
+ ti = proto_tree_add_protocol_format(tree, proto_igrp, tvb, 0, -1,
+ "Cisco IGRP");
igrp_tree = proto_item_add_subtree(ti, ett_igrp);
{ &hf_igrp_update,
{ "Update Release", "igrp.update",
FT_UINT8, BASE_DEC, NULL, 0x0 ,
- "Update Release number" },
+ "Update Release number", HFILL }
},
{ &hf_igrp_as,
{ "Autonomous System", "igrp.as",
FT_UINT16, BASE_DEC, NULL, 0x0 ,
- "Autonomous System number" }
+ "Autonomous System number", HFILL }
}
};
};
/* Register the protocol name and description */
- proto_igrp = proto_register_protocol("Cisco Interior Gateway Routing Protocol", "igrp");
+ proto_igrp = proto_register_protocol("Cisco Interior Gateway Routing Protocol",
+ "IGRP", "igrp");
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_igrp, hf, array_length(hf));
void
proto_reg_handoff_igrp(void)
{
- dissector_add("ip.proto", IP_PROTO_IGRP , dissect_igrp);
+ dissector_handle_t igrp_handle;
+
+ igrp_handle = create_dissector_handle(dissect_igrp, proto_igrp);
+ dissector_add("ip.proto", IP_PROTO_IGRP, igrp_handle);
}
/* IGRP Packet structure: