aboutsummaryrefslogtreecommitdiffstats
path: root/packet-nlm.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2002-05-21 10:17:30 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2002-05-21 10:17:30 +0000
commit1b2b50488fe71c02327ea84d4668065b72c65fb8 (patch)
tree07f8a52717b39abc2c3cb0c9e88942553a95c5ca /packet-nlm.c
parentce62cfb27ab151e9a8adf064ce5d99ec5ff11069 (diff)
Option to make filtering on nfs fhandles stateful.
When this ption is enabled in Protocols/NFS displayfilters for fhandle fields such as nfs.fh.{hash|name|full_name} will find both the request and matching response packets even if the fhandle is only present in one of the packets. The option supports all NFS and related protocols which use nfs fhandles including async NLM. The option will not work with nfs packets containing multiple fhandles in one PDU, nor will it work if tcp collapses multiple segments/pdus into one larger segment. It only works for async NLM if one first enables the MSG/RES stateful matching for async NLM. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5515 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-nlm.c')
-rw-r--r--packet-nlm.c72
1 files changed, 71 insertions, 1 deletions
diff --git a/packet-nlm.c b/packet-nlm.c
index fb5d880bb8..afb5a5186e 100644
--- a/packet-nlm.c
+++ b/packet-nlm.c
@@ -1,7 +1,7 @@
/* packet-nlm.c
* Routines for nlm dissection
*
- * $Id: packet-nlm.c,v 1.26 2002/05/08 12:51:45 sahlberg Exp $
+ * $Id: packet-nlm.c,v 1.27 2002/05/21 10:17:27 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -230,6 +230,40 @@ nlm_print_msgres_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb)
proto_tree_add_uint(tree, hf_nlm_reply_in, tvb, 0, 0, md->rep_frame);
}
}
+static void
+nlm_match_fhandle_reply(packet_info *pinfo, proto_tree *tree)
+{
+ nlm_msg_res_matched_data *md;
+
+ md=g_hash_table_lookup(nlm_msg_res_matched, (gconstpointer)pinfo->fd->num);
+ if(md && md->rep_frame){
+ nfs_fhandle_data_t *fhd;
+ fhd=(nfs_fhandle_data_t *)g_hash_table_lookup(
+ nfs_fhandle_frame_table,
+ (gconstpointer)md->req_frame);
+ if(fhd){
+ dissect_fhandle_hidden(pinfo,
+ tree, fhd);
+ }
+ }
+}
+static void
+nlm_match_fhandle_request(packet_info *pinfo, proto_tree *tree)
+{
+ nlm_msg_res_matched_data *md;
+
+ md=g_hash_table_lookup(nlm_msg_res_matched, (gconstpointer)pinfo->fd->num);
+ if(md && md->rep_frame){
+ nfs_fhandle_data_t *fhd;
+ fhd=(nfs_fhandle_data_t *)g_hash_table_lookup(
+ nfs_fhandle_frame_table,
+ (gconstpointer)md->rep_frame);
+ if(fhd){
+ dissect_fhandle_hidden(pinfo,
+ tree, fhd);
+ }
+ }
+}
static void
nlm_register_unmatched_res(packet_info *pinfo, tvbuff_t *tvb, int offset)
@@ -399,6 +433,11 @@ dissect_nlm_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
} else {
nlm_print_msgres_request(pinfo, tree, tvb);
}
+ /* for the fhandle matching that finds both request and
+ response packet */
+ if(nfs_fhandle_reqrep_matching){
+ nlm_match_fhandle_request(pinfo, tree);
+ }
}
}
@@ -421,6 +460,11 @@ dissect_nlm_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
} else {
nlm_print_msgres_request(pinfo, tree, tvb);
}
+ /* for the fhandle matching that finds both request and
+ response packet */
+ if(nfs_fhandle_reqrep_matching){
+ nlm_match_fhandle_request(pinfo, tree);
+ }
}
}
@@ -445,6 +489,11 @@ dissect_nlm_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
} else {
nlm_print_msgres_request(pinfo, tree, tvb);
}
+ /* for the fhandle matching that finds both request and
+ response packet */
+ if(nfs_fhandle_reqrep_matching){
+ nlm_match_fhandle_request(pinfo, tree);
+ }
}
}
@@ -467,6 +516,11 @@ dissect_nlm_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
} else {
nlm_print_msgres_request(pinfo, tree, tvb);
}
+ /* for the fhandle matching that finds both request and
+ response packet */
+ if(nfs_fhandle_reqrep_matching){
+ nlm_match_fhandle_request(pinfo, tree);
+ }
}
}
@@ -487,8 +541,14 @@ dissect_nlm_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
} else {
nlm_print_msgres_request(pinfo, tree, tvb);
}
+ /* for the fhandle matching that finds both request and
+ response packet */
+ if(nfs_fhandle_reqrep_matching){
+ nlm_match_fhandle_request(pinfo, tree);
+ }
}
}
+
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
offset = dissect_rpc_bool(tvb, tree, hf_nlm_exclusive, offset);
offset = dissect_lock(tvb, pinfo, tree, version, offset);
@@ -511,6 +571,11 @@ dissect_nlm_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
} else {
nlm_print_msgres_reply(pinfo, tree, tvb);
}
+ /* for the fhandle matching that finds both request and
+ response packet */
+ if(nfs_fhandle_reqrep_matching){
+ nlm_match_fhandle_reply(pinfo, tree);
+ }
}
}
@@ -638,6 +703,11 @@ dissect_nlm_gen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
} else {
nlm_print_msgres_reply(pinfo, tree, tvb);
}
+ /* for the fhandle matching that finds both request and
+ response packet */
+ if(nfs_fhandle_reqrep_matching){
+ nlm_match_fhandle_reply(pinfo, tree);
+ }
}
}