From 1cedc6aab920fddaa0b8ba043fe61b27f9f9e30b Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Wed, 21 May 2003 09:34:54 +0000 Subject: [PATCH] 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 --- packet-dcerpc-lsa.c | 14 +++++++------- packet-dcerpc-netlogon.c | 20 ++++++++++---------- packet-dcerpc-nt.h | 4 ++-- packet-dcerpc-samr.c | 17 ++++++++++++----- 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/packet-dcerpc-lsa.c b/packet-dcerpc-lsa.c index 04d1f0a580..84ef2244c4 100644 --- a/packet-dcerpc-lsa.c +++ b/packet-dcerpc-lsa.c @@ -3,7 +3,7 @@ * Copyright 2001,2003 Tim Potter * 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 @@ -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; diff --git a/packet-dcerpc-netlogon.c b/packet-dcerpc-netlogon.c index e2db33be78..f81447aafd 100644 --- a/packet-dcerpc-netlogon.c +++ b/packet-dcerpc-netlogon.c @@ -3,7 +3,7 @@ * Copyright 2001,2003 Tim Potter * 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 @@ -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); diff --git a/packet-dcerpc-nt.h b/packet-dcerpc-nt.h index 2a48a54a34..3fa0a741c8 100644 --- a/packet-dcerpc-nt.h +++ b/packet-dcerpc-nt.h @@ -2,7 +2,7 @@ * Routines for DCERPC over SMB packet disassembly * Copyright 2001-2003 Tim Potter * - * $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 @@ -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, diff --git a/packet-dcerpc-samr.c b/packet-dcerpc-samr.c index e9e6bded7c..578d119177 100644 --- a/packet-dcerpc-samr.c +++ b/packet-dcerpc-samr.c @@ -3,7 +3,7 @@ * Copyright 2001,2003 Tim Potter * 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 @@ -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);