2006-12-19 22:16:54 +00:00
|
|
|
/* packet-roofnet.c
|
|
|
|
* Routines for roofnet dissection
|
|
|
|
* Copyright 2006, Sebastien Tandel (sebastien@tandel.be)
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2006-12-19 22:16:54 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/addr_resolv.h>
|
|
|
|
#include <epan/expert.h>
|
|
|
|
#include <epan/ptvcursor.h>
|
|
|
|
|
|
|
|
|
|
|
|
/* roofnet packet type constants */
|
|
|
|
#define ROOFNET_PT_QUERY 0x01
|
|
|
|
#define ROOFNET_PT_REPLY 0x02
|
|
|
|
#define ROOFNET_PT_DATA 0x04
|
|
|
|
#define ROOFNET_PT_GATEWAY 0x08
|
|
|
|
static const value_string roofnet_pt_vals[] = {
|
|
|
|
{ ROOFNET_PT_QUERY, "Query" },
|
|
|
|
{ ROOFNET_PT_REPLY, "Reply" },
|
|
|
|
{ ROOFNET_PT_DATA, "Data" },
|
|
|
|
{ ROOFNET_PT_GATEWAY, "Gateway" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* roofnet flag bit masks */
|
2017-02-11 02:42:29 +00:00
|
|
|
#define ROOFNET_FLAG_ERROR (1<<0)
|
|
|
|
#define ROOFNET_FLAG_UPDATE (1<<1)
|
|
|
|
#define ROOFNET_FLAG_LAYER2 (1<<9)
|
2017-02-18 15:17:31 +00:00
|
|
|
#define ROOFNET_FLAG_RESERVED 0xFDFC
|
2017-02-11 02:42:29 +00:00
|
|
|
#define ROOFNET_FLAG_MASK (ROOFNET_FLAG_ERROR | ROOFNET_FLAG_UPDATE | ROOFNET_FLAG_LAYER2)
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
/* header length */
|
|
|
|
#define ROOFNET_HEADER_LENGTH 160
|
|
|
|
/* roofnet max length */
|
|
|
|
/* may change with time */
|
|
|
|
#define ROOFNET_MAX_LENGTH 400
|
2008-03-04 20:11:50 +00:00
|
|
|
/* Roofnet Link Description Length
|
2006-12-19 22:16:54 +00:00
|
|
|
* which is 6 fields of 4 bytes */
|
|
|
|
#define ROOFNET_LINK_DESCRIPTION_LENGTH 6*4
|
|
|
|
|
|
|
|
/* offset constants */
|
|
|
|
#define ROOFNET_OFFSET_TYPE 1
|
|
|
|
#define ROOFNET_OFFSET_NLINKS 2
|
|
|
|
#define ROOFNET_OFFSET_DATA_LENGTH 10
|
|
|
|
|
|
|
|
/* offset relative to a link section of roofnet */
|
|
|
|
#define ROOFNET_LINK_OFFSET_SRC 0
|
|
|
|
#define ROOFNET_LINK_OFFSET_DST 20
|
|
|
|
/* roofnet link fields length */
|
|
|
|
#define ROOFNET_LINK_LEN 24
|
|
|
|
|
|
|
|
/* forward reference */
|
2013-12-12 06:11:05 +00:00
|
|
|
void proto_register_roofnet(void);
|
2007-03-21 04:54:20 +00:00
|
|
|
void proto_reg_handoff_roofnet(void);
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
static dissector_handle_t ip_handle;
|
2017-02-11 02:42:29 +00:00
|
|
|
static dissector_handle_t eth_withoutfcs_handle;
|
2006-12-19 22:16:54 +00:00
|
|
|
static int proto_roofnet = -1;
|
|
|
|
|
|
|
|
/* hf fields for the header of roofnet */
|
|
|
|
static int hf_roofnet_version = -1;
|
|
|
|
static int hf_roofnet_type = -1;
|
|
|
|
static int hf_roofnet_nlinks = -1;
|
|
|
|
static int hf_roofnet_next = -1;
|
|
|
|
static int hf_roofnet_ttl = -1;
|
|
|
|
static int hf_roofnet_cksum = -1;
|
|
|
|
static int hf_roofnet_flags = -1;
|
2017-02-11 02:42:29 +00:00
|
|
|
static int hf_roofnet_flags_error = -1;
|
|
|
|
static int hf_roofnet_flags_update = -1;
|
|
|
|
static int hf_roofnet_flags_layer2 = -1;
|
2017-02-18 15:17:31 +00:00
|
|
|
static int hf_roofnet_flags_reserved = -1;
|
2006-12-19 22:16:54 +00:00
|
|
|
static int hf_roofnet_data_length = -1;
|
|
|
|
static int hf_roofnet_query_dst = -1;
|
|
|
|
static int hf_roofnet_seq = -1;
|
2013-01-26 18:54:53 +00:00
|
|
|
/* static int hf_roofnet_links = -1; */
|
2006-12-19 22:16:54 +00:00
|
|
|
static int hf_roofnet_link_src = -1;
|
|
|
|
static int hf_roofnet_link_forward = -1;
|
|
|
|
static int hf_roofnet_link_rev = -1;
|
|
|
|
static int hf_roofnet_link_seq = -1;
|
|
|
|
static int hf_roofnet_link_age = -1;
|
|
|
|
static int hf_roofnet_link_dst = -1;
|
|
|
|
|
2017-02-11 02:42:29 +00:00
|
|
|
static const int *flag_list[] = {
|
|
|
|
&hf_roofnet_flags_error,
|
|
|
|
&hf_roofnet_flags_update,
|
|
|
|
&hf_roofnet_flags_layer2,
|
2017-02-18 15:17:31 +00:00
|
|
|
&hf_roofnet_flags_reserved,
|
2017-02-11 02:42:29 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
static gint ett_roofnet = -1;
|
2017-02-11 02:42:29 +00:00
|
|
|
static gint ett_roofnet_flags = -1;
|
2006-12-19 22:16:54 +00:00
|
|
|
static gint ett_roofnet_link = -1;
|
|
|
|
|
2013-07-06 02:53:45 +00:00
|
|
|
static expert_field ei_roofnet_too_many_links = EI_INIT;
|
2014-09-06 12:44:23 +00:00
|
|
|
static expert_field ei_roofnet_too_much_data = EI_INIT;
|
2013-05-27 23:21:11 +00:00
|
|
|
|
2008-03-04 20:11:50 +00:00
|
|
|
/*
|
|
|
|
* dissect the header of roofnet
|
2006-12-19 22:16:54 +00:00
|
|
|
*/
|
2017-02-11 02:42:29 +00:00
|
|
|
static guint16 dissect_roofnet_header(proto_tree *tree, tvbuff_t *tvb, guint *offset)
|
2006-12-19 22:16:54 +00:00
|
|
|
{
|
2017-02-18 09:07:32 +00:00
|
|
|
guint16 flags;
|
2006-12-19 22:16:54 +00:00
|
|
|
ptvcursor_t *cursor = ptvcursor_new(tree, tvb, *offset);
|
|
|
|
|
2011-10-25 16:04:31 +00:00
|
|
|
ptvcursor_add(cursor, hf_roofnet_version, 1, ENC_BIG_ENDIAN);
|
|
|
|
ptvcursor_add(cursor, hf_roofnet_type, 1, ENC_BIG_ENDIAN);
|
|
|
|
ptvcursor_add(cursor, hf_roofnet_nlinks, 1, ENC_BIG_ENDIAN);
|
|
|
|
ptvcursor_add(cursor, hf_roofnet_next, 1, ENC_BIG_ENDIAN);
|
|
|
|
ptvcursor_add(cursor, hf_roofnet_ttl, 2, ENC_BIG_ENDIAN);
|
2016-07-11 03:47:28 +00:00
|
|
|
proto_tree_add_checksum(ptvcursor_tree(cursor), ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor),
|
|
|
|
hf_roofnet_cksum, -1, NULL, NULL, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
|
|
|
|
ptvcursor_advance(cursor, 2);
|
2017-02-18 09:07:32 +00:00
|
|
|
flags = tvb_get_ntohs(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
|
2017-02-11 02:42:29 +00:00
|
|
|
proto_tree_add_bitmask(ptvcursor_tree(cursor), ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor),
|
|
|
|
hf_roofnet_flags, ett_roofnet_flags, flag_list, ENC_BIG_ENDIAN);
|
|
|
|
ptvcursor_advance(cursor, 2);
|
2011-10-25 16:04:31 +00:00
|
|
|
ptvcursor_add(cursor, hf_roofnet_data_length, 2, ENC_BIG_ENDIAN);
|
|
|
|
ptvcursor_add(cursor, hf_roofnet_query_dst, 4, ENC_BIG_ENDIAN);
|
|
|
|
ptvcursor_add(cursor, hf_roofnet_seq, 4, ENC_BIG_ENDIAN);
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
*offset = ptvcursor_current_offset(cursor);
|
|
|
|
ptvcursor_free(cursor);
|
2017-02-11 02:42:29 +00:00
|
|
|
|
|
|
|
return flags;
|
2006-12-19 22:16:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* dissect the description of link in roofnet
|
|
|
|
*/
|
2006-12-24 20:40:19 +00:00
|
|
|
static void dissect_roofnet_link(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint link)
|
2006-12-19 22:16:54 +00:00
|
|
|
{
|
2017-02-18 09:00:40 +00:00
|
|
|
proto_tree *subtree = NULL;
|
2006-12-19 22:16:54 +00:00
|
|
|
|
2017-02-18 09:00:40 +00:00
|
|
|
ptvcursor_t *cursor = NULL;
|
2006-12-19 22:16:54 +00:00
|
|
|
|
2017-02-18 09:00:40 +00:00
|
|
|
guint32 addr_src = 0;
|
|
|
|
guint32 addr_dst = 0;
|
2006-12-19 22:16:54 +00:00
|
|
|
|
2017-02-18 09:00:40 +00:00
|
|
|
addr_src = tvb_get_ipv4(tvb, *offset + ROOFNET_LINK_OFFSET_SRC);
|
|
|
|
addr_dst = tvb_get_ipv4(tvb, *offset + ROOFNET_LINK_OFFSET_DST);
|
2008-03-04 20:11:50 +00:00
|
|
|
|
2014-07-06 13:49:27 +00:00
|
|
|
subtree = proto_tree_add_subtree_format(tree, tvb, *offset, ROOFNET_LINK_LEN,
|
2014-09-30 23:12:26 +00:00
|
|
|
ett_roofnet_link, NULL, "link: %u, src: %s, dst: %s",
|
|
|
|
link,
|
|
|
|
get_hostname(addr_src),
|
|
|
|
get_hostname(addr_dst));
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
proto_tree_add_ipv4(subtree, hf_roofnet_link_src, tvb, *offset, 4, addr_src);
|
|
|
|
*offset += 4;
|
|
|
|
|
|
|
|
cursor = ptvcursor_new(subtree, tvb, *offset);
|
|
|
|
|
2011-10-25 16:04:31 +00:00
|
|
|
ptvcursor_add(cursor, hf_roofnet_link_forward, 4, ENC_BIG_ENDIAN);
|
|
|
|
ptvcursor_add(cursor, hf_roofnet_link_rev, 4, ENC_BIG_ENDIAN);
|
|
|
|
ptvcursor_add(cursor, hf_roofnet_link_seq, 4, ENC_BIG_ENDIAN);
|
|
|
|
ptvcursor_add(cursor, hf_roofnet_link_age, 4, ENC_BIG_ENDIAN);
|
2006-12-19 22:16:54 +00:00
|
|
|
|
2013-12-19 17:48:58 +00:00
|
|
|
*offset = ptvcursor_current_offset(cursor);
|
2006-12-19 22:16:54 +00:00
|
|
|
ptvcursor_free(cursor);
|
|
|
|
|
|
|
|
proto_tree_add_ipv4(subtree, hf_roofnet_link_dst, tvb, *offset, 4, addr_dst);
|
|
|
|
/* don't increment offset here because the dst of this link is the src of the next one */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* dissect the data in roofnet
|
|
|
|
*/
|
2017-02-11 02:42:29 +00:00
|
|
|
static void dissect_roofnet_data(proto_tree *tree, tvbuff_t *tvb, packet_info * pinfo, gint offset, guint16 flags)
|
2006-12-19 22:16:54 +00:00
|
|
|
{
|
2017-02-18 09:00:40 +00:00
|
|
|
guint16 roofnet_datalen = 0;
|
|
|
|
guint16 remaining_datalen = 0;
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
roofnet_datalen = tvb_get_ntohs(tvb, ROOFNET_OFFSET_DATA_LENGTH);
|
2017-02-18 09:00:40 +00:00
|
|
|
remaining_datalen = tvb_reported_length_remaining(tvb, offset);
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* dissect on remaining_datalen */
|
|
|
|
if (roofnet_datalen < remaining_datalen)
|
2014-09-06 12:44:23 +00:00
|
|
|
proto_tree_add_expert_format(tree, pinfo, &ei_roofnet_too_much_data, tvb, offset, roofnet_datalen,
|
2014-09-30 23:12:26 +00:00
|
|
|
"[More payload data (%u) than told by Roofnet (%u)]",
|
|
|
|
remaining_datalen, roofnet_datalen);
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
if (roofnet_datalen == 0)
|
|
|
|
return;
|
|
|
|
|
2017-02-11 02:42:29 +00:00
|
|
|
/* dissect payload */
|
|
|
|
if (flags & ROOFNET_FLAG_LAYER2) {
|
|
|
|
/* ethernet frame is padded with 2 bytes at the start */
|
|
|
|
call_dissector(eth_withoutfcs_handle, tvb_new_subset_remaining(tvb, offset+2), pinfo, tree);
|
|
|
|
} else {
|
|
|
|
call_dissector(ip_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree);
|
|
|
|
}
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-03-04 20:11:50 +00:00
|
|
|
/*
|
2006-12-19 22:16:54 +00:00
|
|
|
* entry point of the roofnet dissector
|
|
|
|
*/
|
2015-11-25 02:59:51 +00:00
|
|
|
static int dissect_roofnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
2006-12-19 22:16:54 +00:00
|
|
|
{
|
2013-06-14 01:56:28 +00:00
|
|
|
proto_item * it;
|
|
|
|
proto_tree * roofnet_tree;
|
2017-02-18 09:00:40 +00:00
|
|
|
guint offset = 0;
|
2006-12-19 22:16:54 +00:00
|
|
|
|
2017-02-18 09:00:40 +00:00
|
|
|
guint8 roofnet_msg_type = 0;
|
|
|
|
guint8 roofnet_nlinks = 0;
|
|
|
|
guint8 nlink = 1;
|
2017-02-18 09:07:32 +00:00
|
|
|
guint16 flags;
|
2008-03-04 20:11:50 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Roofnet");
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
roofnet_msg_type = tvb_get_guint8(tvb, ROOFNET_OFFSET_TYPE);
|
|
|
|
/* Clear out stuff in the info column */
|
2013-06-14 01:56:28 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %s",
|
2014-09-30 23:12:26 +00:00
|
|
|
val_to_str(roofnet_msg_type, roofnet_pt_vals, "Unknown (%d)"));
|
2006-12-19 22:16:54 +00:00
|
|
|
|
2013-06-14 01:56:28 +00:00
|
|
|
it = proto_tree_add_item(tree, proto_roofnet, tvb, offset, -1, ENC_NA);
|
|
|
|
roofnet_tree = proto_item_add_subtree(it, ett_roofnet);
|
2006-12-19 22:16:54 +00:00
|
|
|
|
2017-02-18 09:07:32 +00:00
|
|
|
flags = dissect_roofnet_header(roofnet_tree, tvb, &offset);
|
2006-12-19 22:16:54 +00:00
|
|
|
|
2017-02-18 09:00:40 +00:00
|
|
|
roofnet_nlinks = tvb_get_guint8(tvb, ROOFNET_OFFSET_NLINKS);
|
2006-12-19 22:16:54 +00:00
|
|
|
/* Check that we do not have a malformed roofnet packet */
|
|
|
|
if ((roofnet_nlinks*6*4)+ROOFNET_HEADER_LENGTH > ROOFNET_MAX_LENGTH) {
|
2014-08-13 12:56:22 +00:00
|
|
|
expert_add_info_format(pinfo, it, &ei_roofnet_too_many_links, "Too many links (%u)", roofnet_nlinks);
|
2015-11-25 02:59:51 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2006-12-19 22:16:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (; roofnet_nlinks > 0; roofnet_nlinks--) {
|
|
|
|
/* Do we have enough buffer to decode the next link ? */
|
|
|
|
if (tvb_reported_length_remaining(tvb, offset) < ROOFNET_LINK_DESCRIPTION_LENGTH)
|
2015-11-25 02:59:51 +00:00
|
|
|
return offset;
|
2006-12-19 22:16:54 +00:00
|
|
|
dissect_roofnet_link(roofnet_tree, tvb, &offset, nlink++);
|
|
|
|
}
|
|
|
|
|
2017-02-11 02:42:29 +00:00
|
|
|
dissect_roofnet_data(tree, tvb, pinfo, offset+4, flags);
|
2015-11-25 02:59:51 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2006-12-19 22:16:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void proto_register_roofnet(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
/* Roofnet Header */
|
|
|
|
{ &hf_roofnet_version,
|
|
|
|
{ "Version", "roofnet.version",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0, "Roofnet Version", HFILL }
|
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_type,
|
|
|
|
{ "Type", "roofnet.type",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(roofnet_pt_vals), 0x0, "Roofnet Message Type", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_nlinks,
|
|
|
|
{ "Number of Links", "roofnet.nlinks",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0, "Roofnet Number of Links", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_next,
|
|
|
|
{ "Next Link", "roofnet.next",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0, "Roofnet Next Link to Use", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_ttl,
|
|
|
|
{ "Time To Live", "roofnet.ttl",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, "Roofnet Time to Live", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_cksum,
|
|
|
|
{ "Checksum", "roofnet.cksum",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, "Roofnet Header Checksum", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_flags,
|
|
|
|
{ "Flags", "roofnet.flags",
|
2017-02-11 02:42:29 +00:00
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0, "Roofnet flags", HFILL }
|
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_flags_error,
|
|
|
|
{ "Roofnet Error", "roofnet.flags.error",
|
|
|
|
FT_BOOLEAN, 16, NULL, ROOFNET_FLAG_ERROR, NULL, HFILL }
|
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_flags_update,
|
|
|
|
{ "Roofnet Update", "roofnet.flags.update",
|
|
|
|
FT_BOOLEAN, 16, NULL, ROOFNET_FLAG_UPDATE, NULL, HFILL }
|
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_flags_layer2,
|
|
|
|
{ "Roofnet Layer 2", "roofnet.flags.layer2",
|
|
|
|
FT_BOOLEAN, 16, NULL, ROOFNET_FLAG_LAYER2, NULL, HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
2017-02-18 15:17:31 +00:00
|
|
|
{ &hf_roofnet_flags_reserved,
|
|
|
|
{ "Roofnet Reserved", "roofnet.flags.reserved",
|
|
|
|
FT_BOOLEAN, 16, NULL, ROOFNET_FLAG_RESERVED, NULL, HFILL }
|
|
|
|
},
|
|
|
|
|
2006-12-19 22:16:54 +00:00
|
|
|
{ &hf_roofnet_data_length,
|
|
|
|
{ "Data Length", "roofnet.datalength",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, "Data Payload Length", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_query_dst,
|
|
|
|
{ "Query Dst", "roofnet.querydst",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_IPv4, BASE_NONE, NULL, 0x0, "Roofnet Query Destination", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_seq,
|
|
|
|
{ "Seq", "roofnet.seq",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0, "Roofnet Sequential Number", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
2013-01-31 18:31:28 +00:00
|
|
|
#if 0
|
2006-12-19 22:16:54 +00:00
|
|
|
{ &hf_roofnet_links,
|
|
|
|
{ "Links", "roofnet.links",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
2013-01-31 18:31:28 +00:00
|
|
|
#endif
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
{ &hf_roofnet_link_src,
|
|
|
|
{ "Source IP", "roofnet.link.src",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_IPv4, BASE_NONE, NULL, 0x0, "Roofnet Message Source", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_link_forward,
|
|
|
|
{ "Forward", "roofnet.link.forward",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_link_rev,
|
|
|
|
{ "Rev", "roofnet.link.rev",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0, "Revision Number", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_link_seq,
|
|
|
|
{ "Seq", "roofnet.link.seq",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0, "Link Sequential Number", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_link_age,
|
|
|
|
{ "Age", "roofnet.link.age",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0, "Information Age", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_roofnet_link_dst,
|
|
|
|
{ "Dst IP", "roofnet.link.dst",
|
2014-09-30 23:12:26 +00:00
|
|
|
FT_IPv4, BASE_NONE, NULL, 0x0, "Roofnet Message Destination", HFILL }
|
2006-12-19 22:16:54 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* setup protocol subtree array */
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_roofnet,
|
2017-02-11 02:42:29 +00:00
|
|
|
&ett_roofnet_flags,
|
2006-12-19 22:16:54 +00:00
|
|
|
&ett_roofnet_link
|
|
|
|
};
|
|
|
|
|
2013-05-27 23:21:11 +00:00
|
|
|
static ei_register_info ei[] = {
|
2013-07-06 02:53:45 +00:00
|
|
|
{ &ei_roofnet_too_many_links, { "roofnet.too_many_links", PI_MALFORMED, PI_ERROR, "Too many links", EXPFILL }},
|
2014-09-06 12:44:23 +00:00
|
|
|
{ &ei_roofnet_too_much_data, { "roofnet.too_much_data", PI_MALFORMED, PI_ERROR, "More payload data than told by Roofnet", EXPFILL }},
|
2013-05-27 23:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
expert_module_t* expert_roofnet;
|
|
|
|
|
2017-02-18 09:00:40 +00:00
|
|
|
proto_roofnet = proto_register_protocol("Roofnet Protocol", "Roofnet", "roofnet");
|
2006-12-19 22:16:54 +00:00
|
|
|
|
|
|
|
proto_register_field_array(proto_roofnet, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2013-05-27 23:21:11 +00:00
|
|
|
expert_roofnet = expert_register_protocol(proto_roofnet);
|
|
|
|
expert_register_field_array(expert_roofnet, ei, array_length(ei));
|
2006-12-19 22:16:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void proto_reg_handoff_roofnet(void)
|
|
|
|
{
|
2008-09-26 22:34:41 +00:00
|
|
|
dissector_handle_t roofnet_handle;
|
2006-12-19 22:16:54 +00:00
|
|
|
|
2008-09-26 22:07:45 +00:00
|
|
|
/* Until now there is no other option than having an IPv4 payload (maybe
|
|
|
|
* extended one day to IPv6 or other?) */
|
2016-03-16 13:02:52 +00:00
|
|
|
ip_handle = find_dissector_add_dependency("ip", proto_roofnet);
|
2017-02-11 02:42:29 +00:00
|
|
|
eth_withoutfcs_handle = find_dissector_add_dependency("eth_withoutfcs", proto_roofnet);
|
2015-12-09 03:49:44 +00:00
|
|
|
roofnet_handle = create_dissector_handle(dissect_roofnet, proto_roofnet);
|
2008-09-26 22:07:45 +00:00
|
|
|
/* I did not put the type numbers in the ethertypes.h as they only are
|
|
|
|
* experimental and not official */
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ethertype", 0x0641, roofnet_handle);
|
|
|
|
dissector_add_uint("ethertype", 0x0643, roofnet_handle);
|
|
|
|
dissector_add_uint("ethertype", 0x0644, roofnet_handle);
|
|
|
|
dissector_add_uint("ethertype", 0x0645, roofnet_handle);
|
2006-12-19 22:16:54 +00:00
|
|
|
}
|
2014-09-30 23:12:26 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 2
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=2 tabstop=8 expandtab:
|
|
|
|
* :indentSize=2:tabSize=8:noTabs=true:
|
|
|
|
*/
|