diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2002-09-04 09:40:29 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2002-09-04 09:40:29 +0000 |
commit | 93a649db6f5db64dbdc80eece52f0891c8a72cfb (patch) | |
tree | 90bdf086756c8f41361d49ed02ea7adfa1bbd84a /packet-rpc.c | |
parent | 7876ca4fe0bd8ce1cf1bd16d9e4cbdb8a4a007d3 (diff) |
Tap api. tap is a simple api that can be used for arbitrary extensions.
One example extension is rpcstat.
Try -Z rpc,rtt,100003,3 as argument to tethereal when reading a capture
containing NFSv3 packets.
tap-rpcstat.[ch] is intended to demonstrate the api and can be used to
base other extensions on.
svn path=/trunk/; revision=6175
Diffstat (limited to 'packet-rpc.c')
-rw-r--r-- | packet-rpc.c | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/packet-rpc.c b/packet-rpc.c index 33c43a5138..363ad3f315 100644 --- a/packet-rpc.c +++ b/packet-rpc.c @@ -2,7 +2,7 @@ * Routines for rpc dissection * Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de> * - * $Id: packet-rpc.c,v 1.103 2002/08/28 21:00:29 jmayer Exp $ + * $Id: packet-rpc.c,v 1.104 2002/09/04 09:40:24 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -42,6 +42,7 @@ #include "reassemble.h" #include "rpc_defrag.h" #include "packet-nfs.h" +#include "tap.h" /* * See: @@ -68,6 +69,7 @@ static gboolean rpc_defragment = FALSE; static struct true_false_string yesno = { "Yes", "No" }; +static int rpc_tap = -1; static const value_string rpc_msg_type[] = { { RPC_CALL, "Call" }, @@ -226,32 +228,10 @@ fragment_items rpc_frag_items = { }; /* Hash table with info on RPC program numbers */ -static GHashTable *rpc_progs; +GHashTable *rpc_progs; /* Hash table with info on RPC procedure numbers */ -static GHashTable *rpc_procs; - -typedef struct _rpc_proc_info_key { - guint32 prog; - guint32 vers; - guint32 proc; -} rpc_proc_info_key; - -typedef struct _rpc_proc_info_value { - gchar *name; - dissect_function_t *dissect_call; - dissect_function_t *dissect_reply; -} rpc_proc_info_value; - -typedef struct _rpc_prog_info_key { - guint32 prog; -} rpc_prog_info_key; - -typedef struct _rpc_prog_info_value { - int proto; - int ett; - char* progname; -} rpc_prog_info_value; +GHashTable *rpc_procs; static void dissect_rpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static void dissect_rpc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); @@ -2225,6 +2205,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } } + tap_queue_packet(rpc_tap, pinfo, rpc_call); return TRUE; } @@ -3075,6 +3056,7 @@ proto_register_rpc(void) rpc_handle = find_dissector("rpc"); register_dissector("rpc-tcp", dissect_rpc_tcp, proto_rpc); rpc_tcp_handle = find_dissector("rpc-tcp"); + rpc_tap = register_tap("rpc"); /* * Init the hash tables. Dissectors for RPC protocols must |