* Routines for RIPv1 and RIPv2 packet disassembly
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
- * $Id: packet-rip.c,v 1.25 2001/09/13 08:08:53 guy Exp $
+ * $Id: packet-rip.c,v 1.28 2001/12/10 00:25:33 guy Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
*
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
guint8 command;
guint8 version;
guint16 family;
- guint reported_length;
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_set_str(pinfo->fd, COL_PROTOCOL, "RIP");
- if (check_col(pinfo->fd, COL_INFO))
- col_clear(pinfo->fd, COL_INFO);
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RIP");
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_clear(pinfo->cinfo, COL_INFO);
command = tvb_get_guint8(tvb, 0);
version = tvb_get_guint8(tvb, 1);
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_add_str(pinfo->fd, COL_PROTOCOL,
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_add_str(pinfo->cinfo, COL_PROTOCOL,
val_to_str(version, version_vals, "RIP"));
- if (check_col(pinfo->fd, COL_INFO))
- col_add_str(pinfo->fd, COL_INFO,
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(command, command_vals, "Unknown command (%u)"));
if (tree) {
offset = RIP_HEADER_LENGTH;
/* zero or more entries */
- reported_length = tvb_reported_length(tvb);
- while (offset < reported_length) {
+ while (tvb_reported_length_remaining(tvb, offset) > 0) {
family = tvb_get_ntohs(tvb, offset);
switch (family) {
case 2: /* IP */
{
static hf_register_info hf[] = {
{ &hf_rip_command,
- { "Command", "rip.command", FT_UINT8, BASE_HEX,
+ { "Command", "rip.command", FT_UINT8, BASE_DEC,
VALS(command_vals), 0, "What type of RIP Command is this", HFILL }},
{ &hf_rip_version,
void
proto_reg_handoff_rip(void)
{
- dissector_add("udp.port", UDP_PORT_RIP, dissect_rip, proto_rip);
+ dissector_handle_t rip_handle;
+
+ rip_handle = create_dissector_handle(dissect_rip, proto_rip);
+ dissector_add("udp.port", UDP_PORT_RIP, rip_handle);
}