Have rpc_call_info_value be passed through to (sub)dissectors instead of using pinfo->private_data.

This was acheived by adding a void* data parameter to the dissect_function_t typedef in packet-rpc.h (r53213).  After converting the pinfo->private_data, I'm not sure if it would be better to change the void* data pointer to be a rpc_call_info_value* explicitly. Not all "dissector functions" use it, but it would certainly save a lot of casting...

svn path=/trunk/; revision=53232
This commit is contained in:
Michael Mann 2013-11-10 16:39:46 +00:00
parent 6f6d04e2f9
commit fe52a15217
9 changed files with 248 additions and 270 deletions

View File

@ -115,11 +115,11 @@ dissect_hclnfsd_gids(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tr
}
static int
dissect_hclnfsd_spool_inquire_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
dissect_hclnfsd_spool_inquire_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data)
{
offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_status, offset);
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "spool filehandle", NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "spool filehandle", NULL, (rpc_call_info_value*)data);
return offset;
}
@ -390,7 +390,7 @@ dissect_hclnfsd_name_to_uid_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
static int
dissect_hclnfsd_share_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
dissect_hclnfsd_share_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data)
{
guint32 request_type;
@ -404,7 +404,7 @@ dissect_hclnfsd_share_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_
offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_lockname, offset, NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "Filehandle", NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "Filehandle", NULL, (rpc_call_info_value*)data);
offset = dissect_rpc_data(tvb, tree, hf_hclnfsd_unknown_data, offset);
@ -452,7 +452,7 @@ dissect_hclnfsd_unshare_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, pro
static int
dissect_hclnfsd_lock_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
dissect_hclnfsd_lock_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data)
{
offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_status, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_cookie, offset);
@ -462,7 +462,7 @@ dissect_hclnfsd_lock_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t
offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_lockname, offset, NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "Filehandle", NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "Filehandle", NULL, (rpc_call_info_value*)data);
offset = dissect_rpc_data(tvb, tree, hf_hclnfsd_lockowner, offset);
@ -506,7 +506,7 @@ dissect_hclnfsd_remove_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, p
static int
dissect_hclnfsd_unlock_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
dissect_hclnfsd_unlock_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data)
{
offset += 4; /* skip unused */
@ -514,7 +514,7 @@ dissect_hclnfsd_unlock_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto
offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_lockname, offset, NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "Filehandle", NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "Filehandle", NULL, (rpc_call_info_value*)data);
offset = dissect_rpc_data(tvb, tree, hf_hclnfsd_unknown_data, offset);

View File

@ -86,7 +86,7 @@ dissect_holder(tvbuff_t *tvb, proto_tree *tree, int offset)
}
static int
dissect_lock(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset)
dissect_lock(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, rpc_call_info_value *civ)
{
proto_item* lock_item = NULL;
proto_tree* lock_tree = NULL;
@ -99,7 +99,7 @@ dissect_lock(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset)
offset = dissect_rpc_string(tvb, lock_tree,
hf_klm_servername, offset, NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, lock_tree,"fh", NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, lock_tree,"fh", NULL, civ);
offset = dissect_rpc_uint32(tvb, lock_tree,
hf_klm_pid, offset);
@ -114,9 +114,9 @@ dissect_lock(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset)
}
static int
dissect_klm_unlock_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
dissect_klm_unlock_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data)
{
offset = dissect_lock(tvb, pinfo, tree, offset);
offset = dissect_lock(tvb, pinfo, tree, offset, (rpc_call_info_value*)data);
return offset;
}
@ -132,7 +132,7 @@ dissect_klm_stat_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_
}
static int
dissect_klm_lock_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
dissect_klm_lock_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data)
{
offset = dissect_rpc_bool( tvb, tree,
hf_klm_block, offset);
@ -140,7 +140,7 @@ dissect_klm_lock_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
offset = dissect_rpc_bool( tvb, tree,
hf_klm_exclusive, offset);
offset = dissect_lock(tvb, pinfo, tree, offset);
offset = dissect_lock(tvb, pinfo, tree, offset, (rpc_call_info_value*)data);
return offset;
}
@ -163,12 +163,12 @@ dissect_klm_test_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_
}
static int
dissect_klm_test_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
dissect_klm_test_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data)
{
offset = dissect_rpc_bool( tvb, tree,
hf_klm_exclusive, offset);
offset = dissect_lock(tvb, pinfo, tree, offset);
offset = dissect_lock(tvb, pinfo, tree, offset, (rpc_call_info_value*)data);
return offset;
}

View File

@ -130,7 +130,7 @@ static const value_string mount3_mountstat3[] =
* is consistant with most v1 and v2 implementations.
*/
static int
dissect_fhstatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_fhstatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rpc_call_info_value* civ)
{
gint32 status;
@ -139,7 +139,7 @@ dissect_fhstatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
switch (status) {
case 0:
offset = dissect_fhandle(tvb,offset,pinfo,tree,"fhandle", NULL);
offset = dissect_fhandle(tvb,offset,pinfo,tree,"fhandle", NULL, civ);
break;
default:
/* void */
@ -156,12 +156,12 @@ dissect_fhstatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
static int
dissect_mount_dirpath_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
const char *mountpoint=NULL;
if((!pinfo->fd->flags.visited) && nfs_file_name_snooping){
rpc_call_info_value *civ=(rpc_call_info_value *)pinfo->private_data;
rpc_call_info_value *civ=(rpc_call_info_value *)data;
if(civ->request && (civ->proc==1)){
const gchar *host;
@ -196,9 +196,9 @@ dissect_mount_dirpath_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* RFC 1094, Page 25,26 */
static int
dissect_mount1_mnt_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
dissect_mount1_mnt_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data)
{
offset = dissect_fhstatus(tvb,offset,pinfo,tree);
offset = dissect_fhstatus(tvb,offset,pinfo,tree,(rpc_call_info_value*)data);
return offset;
}
@ -537,7 +537,7 @@ dissect_mountstat3(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int offs
/* RFC 1831, Page 109 */
static int
dissect_mount3_mnt_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
dissect_mount3_mnt_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data)
{
guint32 status;
guint32 auth_flavors;
@ -548,7 +548,7 @@ dissect_mount3_mnt_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
switch (status) {
case 0:
offset = dissect_nfs3_fh(tvb,offset,pinfo,tree,"fhandle",NULL);
offset = dissect_nfs3_fh(tvb,offset,pinfo,tree,"fhandle",NULL,(rpc_call_info_value*)data);
auth_flavors = tvb_get_ntohl(tvb, offset);
proto_tree_add_uint(tree,hf_mount_flavors, tvb,

File diff suppressed because it is too large Load Diff

View File

@ -178,10 +178,10 @@ extern void nfs_name_snoop_add_name(int xid, tvbuff_t *tvb, int name_offset, int
int parent_offset, int parent_len, const char *name);
extern gboolean nfs_fhandle_reqrep_matching;
extern int dissect_fhandle(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
const char *name, guint32 *hash);
const char *name, guint32 *hash, rpc_call_info_value *civ);
extern void dissect_fhandle_hidden(packet_info *pinfo, proto_tree *tree, int frame);
extern int dissect_nfs3_fh(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
const char *name, guint32 *hash);
const char *name, guint32 *hash, rpc_call_info_value *civ);
extern int dissect_nfs3_post_op_attr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
const char* name);
extern int dissect_nfs2_fattr(tvbuff_t *tvb, int offset, proto_tree *tree, const char* name);
@ -189,7 +189,7 @@ extern proto_tree* display_access_items(tvbuff_t* tvb, int offset, packet_info*
proto_tree* tree, guint32 amask, char mtype, int version,
GString* optext, const char* label);
extern int dissect_access_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* tree,
int version, GString *optext);
int version, GString *optext, rpc_call_info_value *civ);
extern int hf_nfs_status;
#endif /* packet-nfs.h */

View File

@ -224,9 +224,9 @@ static const value_string nfsacl1_proc_vals[] = {
static int
dissect_nfsacl2_getacl_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL);
offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
offset = dissect_nfsacl_mask(tvb, offset, tree);
return offset;
}
@ -254,9 +254,9 @@ dissect_nfsacl2_getacl_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
static int
dissect_nfsacl2_setacl_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL);
offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
offset = dissect_nfsacl_secattr(tvb, offset, pinfo, tree);
return offset;
@ -282,9 +282,9 @@ dissect_nfsacl2_setacl_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
static int
dissect_nfsacl2_getattr_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL);
offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
return offset;
}
@ -300,17 +300,16 @@ dissect_nfsacl2_getattr_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
static int
dissect_nfsacl2_access_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
guint32 *acc_request, amask;
rpc_call_info_value *civ;
rpc_call_info_value *civ = (rpc_call_info_value*)data;
offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL);
offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL, civ);
/* Get access mask to check and save it for comparison to the access reply. */
amask = tvb_get_ntohl(tvb, offset);
acc_request = (guint32 *)wmem_memdup(wmem_file_scope(), &amask, sizeof(guint32));
civ = (rpc_call_info_value *)pinfo->private_data;
civ->private_data = acc_request;
display_access_items(tvb, offset, pinfo, tree, amask, 'C', 3, NULL, "Check") ;
@ -321,7 +320,7 @@ dissect_nfsacl2_access_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
static int
dissect_nfsacl2_access_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
guint32 status;
@ -334,7 +333,7 @@ dissect_nfsacl2_access_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
if (status == ACL2_OK)
{
offset = dissect_nfs2_fattr(tvb, offset, tree, "attr");
offset = dissect_access_reply(tvb, offset, pinfo, tree, 3, NULL);
offset = dissect_access_reply(tvb, offset, pinfo, tree, 3, NULL, (rpc_call_info_value*)data);
}
return offset;
@ -342,9 +341,9 @@ dissect_nfsacl2_access_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
static int
dissect_nfsacl2_getxattrdir_call(tvbuff_t *tvb, int offset,
packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
packet_info *pinfo _U_, proto_tree *tree, void* data)
{
offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL);
offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
offset = dissect_rpc_bool(tvb, tree, hf_nfsacl_create, offset);
return offset;
@ -352,7 +351,7 @@ dissect_nfsacl2_getxattrdir_call(tvbuff_t *tvb, int offset,
static int
dissect_nfsacl2_getxattrdir_reply(tvbuff_t *tvb, int offset,
packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
packet_info *pinfo _U_, proto_tree *tree, void* data)
{
guint32 status;
@ -364,7 +363,7 @@ dissect_nfsacl2_getxattrdir_reply(tvbuff_t *tvb, int offset,
if (status == ACL2_OK)
{
offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL);
offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
offset = dissect_nfs2_fattr(tvb, offset, tree, "attr");
}
@ -398,9 +397,9 @@ static const value_string nfsacl2_proc_vals[] = {
static int
dissect_nfsacl3_getacl_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "fhandle", NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
offset = dissect_nfsacl_mask(tvb, offset, tree);
return offset;
@ -444,13 +443,13 @@ dissect_nfsacl3_getacl_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
static int
dissect_nfsacl3_setacl_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
proto_item *acl_item = NULL;
proto_tree *acl_tree = NULL;
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "fhandle", NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
if (tree)
{
@ -486,10 +485,10 @@ dissect_nfsacl3_setacl_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
static int
dissect_nfsacl3_getxattrdir_call(tvbuff_t *tvb, int offset,
packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
packet_info *pinfo _U_, proto_tree *tree, void* data)
{
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "fhandle", NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
offset = dissect_rpc_bool(tvb, tree, hf_nfsacl_create, offset);
return offset;
@ -497,7 +496,7 @@ dissect_nfsacl3_getxattrdir_call(tvbuff_t *tvb, int offset,
static int
dissect_nfsacl3_getxattrdir_reply(tvbuff_t *tvb, int offset,
packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
packet_info *pinfo _U_, proto_tree *tree, void* data)
{
guint32 status;
@ -511,7 +510,7 @@ dissect_nfsacl3_getxattrdir_reply(tvbuff_t *tvb, int offset,
if (status == ACL3_OK)
{
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "fhandle", NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
offset = dissect_nfs3_post_op_attr(tvb, offset, pinfo, tree, "attr");
}

View File

@ -365,7 +365,7 @@ static const value_string names_fsh_access[] =
/* generic dissecting functions */
/* **************************** */
static int
dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, int offset)
dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, int offset, rpc_call_info_value* civ)
{
proto_item* lock_item = NULL;
proto_tree* lock_tree = NULL;
@ -380,7 +380,7 @@ dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, i
offset = dissect_rpc_string(tvb,lock_tree,
hf_nlm_lock_caller_name, offset, NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, lock_tree, "fh", &fh_hash);
offset = dissect_nfs3_fh(tvb, offset, pinfo, lock_tree, "fh", &fh_hash, civ);
col_append_fstr(pinfo->cinfo, COL_INFO, " FH:0x%08x", fh_hash);
offset = dissect_rpc_data(tvb, lock_tree, hf_nlm_lock_owner, offset);
@ -410,10 +410,9 @@ dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, i
static int
dissect_nlm_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, int version)
proto_tree *tree, int version, rpc_call_info_value* rpc_call)
{
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if(rpc_call->proc==6){ /* NLM_TEST_MSG */
if( (!pinfo->fd->flags.visited) ){
nlm_register_unmatched_msg(pinfo, tvb, offset);
@ -431,16 +430,15 @@ dissect_nlm_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
dissect_rpc_bool(tvb, tree, hf_nlm_exclusive, offset);
offset += 4;
offset = dissect_lock(tvb, pinfo, tree, version, offset);
offset = dissect_lock(tvb, pinfo, tree, version, offset, rpc_call);
return offset;
}
static int
dissect_nlm_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
proto_tree *tree,int version, rpc_call_info_value* rpc_call)
{
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if(rpc_call->proc==7){ /* NLM_LOCK_MSG */
if( (!pinfo->fd->flags.visited) ){
nlm_register_unmatched_msg(pinfo, tvb, offset);
@ -458,7 +456,7 @@ dissect_nlm_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
offset = dissect_rpc_bool(tvb, tree, hf_nlm_block, offset);
offset = dissect_rpc_bool(tvb, tree, hf_nlm_exclusive, offset);
offset = dissect_lock(tvb, pinfo, tree, version, offset);
offset = dissect_lock(tvb, pinfo, tree, version, offset, rpc_call);
offset = dissect_rpc_bool(tvb, tree, hf_nlm_reclaim, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_nlm_state, offset);
return offset;
@ -466,10 +464,9 @@ dissect_nlm_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
static int
dissect_nlm_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
proto_tree *tree,int version, rpc_call_info_value* rpc_call)
{
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if(rpc_call->proc==8){ /* NLM_CANCEL_MSG */
if( (!pinfo->fd->flags.visited) ){
nlm_register_unmatched_msg(pinfo, tvb, offset);
@ -487,16 +484,15 @@ dissect_nlm_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
offset = dissect_rpc_bool(tvb, tree, hf_nlm_block, offset);
offset = dissect_rpc_bool(tvb, tree, hf_nlm_exclusive, offset);
offset = dissect_lock(tvb, pinfo, tree, version, offset);
offset = dissect_lock(tvb, pinfo, tree, version, offset, rpc_call);
return offset;
}
static int
dissect_nlm_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
proto_tree *tree,int version, rpc_call_info_value* rpc_call)
{
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if(rpc_call->proc==9){ /* NLM_UNLOCK_MSG */
if( (!pinfo->fd->flags.visited) ){
nlm_register_unmatched_msg(pinfo, tvb, offset);
@ -512,16 +508,15 @@ dissect_nlm_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
offset = dissect_lock(tvb, pinfo, tree, version, offset);
offset = dissect_lock(tvb, pinfo, tree, version, offset, rpc_call);
return offset;
}
static int
dissect_nlm_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
proto_tree *tree,int version, rpc_call_info_value* rpc_call)
{
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if(rpc_call->proc==10){ /* NLM_GRANTED_MSG */
if( (!pinfo->fd->flags.visited) ){
nlm_register_unmatched_msg(pinfo, tvb, offset);
@ -538,20 +533,19 @@ dissect_nlm_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
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);
offset = dissect_lock(tvb, pinfo, tree, version, offset, rpc_call);
return offset;
}
static int
dissect_nlm_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree,int version)
proto_tree *tree, int version, rpc_call_info_value *rpc_call)
{
proto_item* lock_item = NULL;
proto_tree* lock_tree = NULL;
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if(rpc_call->proc==11){ /* NLM_TEST_RES */
if( (!pinfo->fd->flags.visited) ){
nlm_register_unmatched_res(pinfo, tvb, offset);
@ -618,7 +612,7 @@ dissect_nlm_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
static int
dissect_nlm_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version _U_)
proto_tree *tree,int version _U_, rpc_call_info_value* civ)
{
proto_item* lock_item = NULL;
proto_tree* lock_tree = NULL;
@ -637,7 +631,7 @@ dissect_nlm_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset = dissect_rpc_string(tvb,lock_tree,
hf_nlm_lock_caller_name, offset, NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, lock_tree, "fh", &fh_hash);
offset = dissect_nfs3_fh(tvb, offset, pinfo, lock_tree, "fh", &fh_hash, civ);
col_append_fstr(pinfo->cinfo, COL_INFO, " FH:0x%08x", fh_hash);
offset = dissect_rpc_data(tvb, lock_tree, hf_nlm_lock_owner, offset);
@ -693,12 +687,12 @@ dissect_nlm_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
/* This function is identical for all NLM protocol versions (1-4)*/
static int
dissect_nlm_gen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
guint32 nlm_stat;
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
rpc_call_info_value *rpc_call=(rpc_call_info_value *)data;
if((rpc_call->proc==12) /* NLM_LOCK_RES */
|| (rpc_call->proc==13) /* NLM_CANCEL_RES */
|| (rpc_call->proc==14) /* NLM_UNLOCK_RES */
@ -729,105 +723,105 @@ dissect_nlm_gen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
static int
dissect_nlm1_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
return dissect_nlm_test(tvb,offset,pinfo,tree,1);
return dissect_nlm_test(tvb,offset,pinfo,tree,1,(rpc_call_info_value*)data);
}
static int
dissect_nlm4_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
return dissect_nlm_test(tvb,offset,pinfo,tree,4);
return dissect_nlm_test(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data);
}
static int
dissect_nlm1_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
return dissect_nlm_lock(tvb,offset,pinfo,tree,1);
return dissect_nlm_lock(tvb,offset,pinfo,tree,1,(rpc_call_info_value*)data);
}
static int
dissect_nlm4_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
return dissect_nlm_lock(tvb,offset,pinfo,tree,4);
return dissect_nlm_lock(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data);
}
static int
dissect_nlm1_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
return dissect_nlm_cancel(tvb,offset,pinfo,tree,1);
return dissect_nlm_cancel(tvb,offset,pinfo,tree,1,(rpc_call_info_value*)data);
}
static int
dissect_nlm4_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
return dissect_nlm_cancel(tvb,offset,pinfo,tree,4);
return dissect_nlm_cancel(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data);
}
static int
dissect_nlm1_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
return dissect_nlm_unlock(tvb,offset,pinfo,tree,1);
return dissect_nlm_unlock(tvb,offset,pinfo,tree,1,(rpc_call_info_value*)data);
}
static int
dissect_nlm4_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
return dissect_nlm_unlock(tvb,offset,pinfo,tree,4);
return dissect_nlm_unlock(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data);
}
static int
dissect_nlm1_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
return dissect_nlm_granted(tvb,offset,pinfo,tree,1);
return dissect_nlm_granted(tvb,offset,pinfo,tree,1,(rpc_call_info_value*)data);
}
static int
dissect_nlm4_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
return dissect_nlm_granted(tvb,offset,pinfo,tree,4);
return dissect_nlm_granted(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data);
}
static int
dissect_nlm1_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
return dissect_nlm_test_res(tvb,offset,pinfo,tree,1);
return dissect_nlm_test_res(tvb,offset,pinfo,tree,1,(rpc_call_info_value*)data);
}
static int
dissect_nlm4_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
return dissect_nlm_test_res(tvb,offset,pinfo,tree,4);
return dissect_nlm_test_res(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data);
}
static int
dissect_nlm3_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
return dissect_nlm_share(tvb,offset,pinfo,tree,3);
return dissect_nlm_share(tvb,offset,pinfo,tree,3,(rpc_call_info_value*)data);
}
static int
dissect_nlm4_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
return dissect_nlm_share(tvb,offset,pinfo,tree,4);
return dissect_nlm_share(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data);
}
static int

View File

@ -71,7 +71,7 @@ static dissector_handle_t rpc_handle;
/* Dissect a getport call */
static int
dissect_getport_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
guint32 proto, version;
guint32 prog;
@ -80,7 +80,7 @@ dissect_getport_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
/* make sure we remember protocol type until the reply packet */
if(!pinfo->fd->flags.visited){
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
rpc_call_info_value *rpc_call=(rpc_call_info_value *)data;
if(rpc_call){
proto = tvb_get_ntohl(tvb, offset+8);
if(proto==IP_PROTO_UDP){ /* only do this for UDP */
@ -127,13 +127,13 @@ dissect_getport_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
static int
dissect_getport_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, void* data _U_)
proto_tree *tree, void* data)
{
guint32 portx;
/* we might have learnt a <ipaddr><protocol><port> mapping for ONC-RPC*/
if(!pinfo->fd->flags.visited){
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
rpc_call_info_value *rpc_call=(rpc_call_info_value *)data;
/* only do this for UDP, TCP does not need anything like this */
if(rpc_call && (GPOINTER_TO_UINT(rpc_call->private_data)==PT_UDP) ){
guint32 port;

View File

@ -2085,7 +2085,6 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* pass rpc_info to subdissectors */
rpc_call->request=FALSE;
pinfo->private_data=rpc_call;
break;
default:
@ -2388,7 +2387,6 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset = dissect_rpc_cred(tvb, rpc_tree, offset, pinfo, rpc_conv_info);
/* pass rpc_info to subdissectors */
rpc_call->request=TRUE;
pinfo->private_data=rpc_call;
if (gss_proc == RPCSEC_GSS_DESTROY) {
/* there is no verifier for GSS destroy packets */