Let's suppose that you want to write a tap only to keep counters, and you
don't want to get involved with GUI programming or maybe you'd like to make
it a plugin. A stats_tree might be the way to go. The stats_tree module takes
-care of the representation (GUI for ethereal and text for tethereal) of the
+care of the representation (GUI for wireshark and text for tshark) of the
tap data. So there's very little code to write to make a tap listener usable
-from both ethereal and tethereal.
+from both wireshark and tshark.
First, you should add the TAP to the dissector in question as described in
README.tapping .
If you want to make it a plugin, stats_tree_register() should be called by
plugin_register_tap_listener() read README.plugin for other information
-regarding ethereal plugins.
+regarding wireshark plugins.
If you want it as part of the dissector stats_tree_register() can be called
either by proto_register_xxx() or if you prefer by proto_reg_handoff_xxx().
*
* $ ~Id: $
*
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.org>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
* 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
/* this one will be called with every udp packet */
extern int udp_term_stats_tree_packet(stats_tree *st, /* st as it was passed to us */
- packet_info *pinfo, /* we'll fetch the addreses from here */
+ packet_info *pinfo, /* we'll fetch the addresses from here */
epan_dissect_t *edt _U_, /* unused */
const void *p) /* we'll use this to fetch the ports */
{
stats_tree_register("udp", /* the proto we are going to "tap" */
"udp_terms", /* the abbreviation for this tree (to be used as -z udp_terms,tree) */
st_str_udp_term, /* the name of the menu and window (use "/" for sub menus)*/
+ udp_term_stats_tree_packet, /* the per packet callback */
udp_term_stats_tree_init, /* the init callback */
- ip_hosts_stats_tree_init, /* the per packet callback */
NULL ); /* the cleanup callback (in this case there isn't) */
}
Node functions
==============
-All the functions that opearate on nodes return a parent_id
+All the functions that operate on nodes return a parent_id
stats_tree_create_node(st, name, parent_id, with_children)
Creates a node in the tree (to be used in the in init_cb)
name: the name of the new node
parent_id: the id of the parent_node (NULL for root)
with_children: TRUE if this node will have "dynamically created" children
- (i.e. it will be a candidate parrent)
+ (i.e. it will be a candidate parent)
stats_tree_create_node_by_pname(st, name, parent_name, with_children);
- As before but creates a node using it's parent's name
+ As before but creates a node using its parent's name
stats_tree_create_range_node(st, name, parent_id, ...)