Change the interface to dissect_ndr_nt_PSID to take one extra parameter which if !=-1 is a hf field for the sid to use instead of the default smb.sid one.

svn path=/trunk/; revision=7706
This commit is contained in:
Ronnie Sahlberg 2003-05-21 09:34:54 +00:00
parent 524a84b5e9
commit 1cedc6aab9
4 changed files with 31 additions and 24 deletions

View File

@ -3,7 +3,7 @@
* Copyright 2001,2003 Tim Potter <tpot@samba.org>
* 2002 Added LSA command dissectors Ronnie Sahlberg
*
* $Id: packet-dcerpc-lsa.c,v 1.77 2003/05/15 02:14:00 tpot Exp $
* $Id: packet-dcerpc-lsa.c,v 1.78 2003/05/21 09:34:53 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -784,7 +784,7 @@ lsa_dissect_POLICY_PRIMARY_DOMAIN_INFO(tvbuff_t *tvb, int offset,
/* sid */
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
proto_item_set_len(item, offset-old_offset);
return offset;
@ -811,7 +811,7 @@ lsa_dissect_POLICY_ACCOUNT_DOMAIN_INFO(tvbuff_t *tvb, int offset,
/* sid */
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
proto_item_set_len(item, offset-old_offset);
return offset;
@ -1025,7 +1025,7 @@ lsa_dissect_POLICY_DNS_DOMAIN_INFO(tvbuff_t *tvb, int offset,
pinfo, tree, drep);
/* SID pointer */
offset = dissect_ndr_nt_PSID(tvb, offset, pinfo, tree, drep);
offset = dissect_ndr_nt_PSID(tvb, offset, pinfo, tree, drep, -1);
proto_item_set_len(item, offset-old_offset);
return offset;
@ -1361,7 +1361,7 @@ lsa_dissect_LSA_TRUST_INFORMATION(tvbuff_t *tvb, int offset,
/* sid */
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
proto_item_set_len(item, offset-old_offset);
return offset;
@ -1451,7 +1451,7 @@ lsa_dissect_LSA_TRUST_INFORMATION_EX(tvbuff_t *tvb, int offset,
/* sid */
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
/* direction */
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
@ -2282,7 +2282,7 @@ lsa_dissect_LSA_TRUSTED_DOMAIN(tvbuff_t *tvb, int offset,
/* sid */
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
proto_item_set_len(item, offset-old_offset);
return offset;

View File

@ -3,7 +3,7 @@
* Copyright 2001,2003 Tim Potter <tpot@samba.org>
* 2002 structure and command dissectors by Ronnie Sahlberg
*
* $Id: packet-dcerpc-netlogon.c,v 1.80 2003/05/15 04:58:53 tpot Exp $
* $Id: packet-dcerpc-netlogon.c,v 1.81 2003/05/21 09:34:54 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -991,7 +991,7 @@ netlogon_dissect_VALIDATION_SAM_INFO(tvbuff_t *tvb, int offset,
hf_netlogon_logon_dom, 0);
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
for(i=0;i<10;i++){
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
@ -1108,7 +1108,7 @@ netlogon_dissect_VALIDATION_SAM_INFO2(tvbuff_t *tvb, int offset,
hf_netlogon_logon_dom, 0);
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
for(i=0;i<10;i++){
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
@ -2359,7 +2359,7 @@ netlogon_dissect_DELTA_POLICY(tvbuff_t *tvb, int offset,
hf_netlogon_domain_name, 0);
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
offset = netlogon_dissect_QUOTA_LIMITS(tvb, offset,
pinfo, tree, drep);
@ -3031,23 +3031,23 @@ netlogon_dissect_DELTA_ID_UNION(tvbuff_t *tvb, int offset,
break;
case 13:
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
break;
case 14:
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
break;
case 15:
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
break;
case 16:
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
break;
case 17:
offset = dissect_ndr_nt_PSID(tvb, offset,
pinfo, tree, drep);
pinfo, tree, drep, -1);
break;
case 18:
offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo,
@ -4928,7 +4928,7 @@ netlogon_dissect_DS_DOMAIN_TRUSTS(tvbuff_t *tvb, int offset,
hf_netlogon_trust_attribs, &tmp);
/* SID pointer */
offset = dissect_ndr_nt_PSID(tvb, offset, pinfo, tree, drep);
offset = dissect_ndr_nt_PSID(tvb, offset, pinfo, tree, drep, -1);
/* GUID */
offset = dissect_nt_GUID(tvb, offset, pinfo, tree, drep);

View File

@ -2,7 +2,7 @@
* Routines for DCERPC over SMB packet disassembly
* Copyright 2001-2003 Tim Potter <tpot@samba.org>
*
* $Id: packet-dcerpc-nt.h,v 1.44 2003/05/15 05:24:18 guy Exp $
* $Id: packet-dcerpc-nt.h,v 1.45 2003/05/21 09:34:54 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -95,7 +95,7 @@ dissect_ndr_nt_SID(tvbuff_t *tvb, int offset,
int
dissect_ndr_nt_PSID(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *parent_tree,
char *drep);
char *drep, int hf_sid);
int
dissect_ndr_nt_PSID_ARRAY(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *parent_tree,

View File

@ -3,7 +3,7 @@
* Copyright 2001,2003 Tim Potter <tpot@samba.org>
* 2002 Added all command dissectors Ronnie Sahlberg
*
* $Id: packet-dcerpc-samr.c,v 1.86 2003/05/15 02:14:00 tpot Exp $
* $Id: packet-dcerpc-samr.c,v 1.87 2003/05/21 09:34:54 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -2655,7 +2655,7 @@ samr_dissect_lookup_domain_reply(tvbuff_t *tvb, int offset,
int
dissect_ndr_nt_PSID(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *parent_tree,
char *drep)
char *drep, int hf_sid)
{
proto_item *item=NULL;
proto_tree *tree=NULL;
@ -2674,7 +2674,14 @@ dissect_ndr_nt_PSID(tvbuff_t *tvb, int offset,
proto_item_set_len(item, offset-old_offset);
return offset;
}
static int
dissect_ndr_nt_PSID_no_hf(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *parent_tree,
char *drep)
{
offset=dissect_ndr_nt_PSID(tvb, offset, pinfo, parent_tree, drep, -1);
return offset;
}
static int
dissect_ndr_nt_PSID_ARRAY_sids (tvbuff_t *tvb, int offset,
@ -2682,7 +2689,7 @@ dissect_ndr_nt_PSID_ARRAY_sids (tvbuff_t *tvb, int offset,
char *drep)
{
offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
dissect_ndr_nt_PSID);
dissect_ndr_nt_PSID_no_hf);
return offset;
}
@ -2729,7 +2736,7 @@ dissect_ndr_nt_SID_AND_ATTRIBUTES(tvbuff_t *tvb, int offset,
tree = proto_item_add_subtree(item, ett_samr_sid_and_attributes);
}
offset = dissect_ndr_nt_PSID(tvb, offset, pinfo, tree, drep);
offset = dissect_ndr_nt_PSID(tvb, offset, pinfo, tree, drep, -1);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
hf_samr_attrib, NULL);