diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2002-03-11 00:28:21 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2002-03-11 00:28:21 +0000 |
commit | 81f29c2ce59fd493702b67f2fece5314ccdeab78 (patch) | |
tree | fa31d91472671d2b1f69a9ccfd157c2899383a95 /packet-dcerpc-samr.c | |
parent | 7900235dad0938f05e95c112a3a0148096567c63 (diff) |
Final patch in preparing for NETLOGON dissector.
Exported some functions from packet-dcerpc-samr.c and added two
more functions the netlogon dissector will need.
svn path=/trunk/; revision=4921
Diffstat (limited to 'packet-dcerpc-samr.c')
-rw-r--r-- | packet-dcerpc-samr.c | 91 |
1 files changed, 72 insertions, 19 deletions
diff --git a/packet-dcerpc-samr.c b/packet-dcerpc-samr.c index 24cb2b14b1..edaa7bad4c 100644 --- a/packet-dcerpc-samr.c +++ b/packet-dcerpc-samr.c @@ -3,7 +3,7 @@ * Copyright 2001, Tim Potter <tpot@samba.org> * 2002 Added all command dissectors Ronnie Sahlberg * - * $Id: packet-dcerpc-samr.c,v 1.23 2002/03/11 00:15:20 sahlberg Exp $ + * $Id: packet-dcerpc-samr.c,v 1.24 2002/03/11 00:28:21 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -180,6 +180,8 @@ static gint ett_samr_member_array = -1; static gint ett_samr_names = -1; static gint ett_samr_rids = -1; static gint ett_nt_acct_ctrl = -1; +static gint ett_samr_sid_and_attributes_array = -1; +static gint ett_samr_sid_and_attributes = -1; static e_uuid_t uuid_dcerpc_samr = { @@ -190,8 +192,8 @@ static e_uuid_t uuid_dcerpc_samr = { static guint16 ver_dcerpc_samr = 1; -static int -samr_dissect_SID(tvbuff_t *tvb, int offset, +int +dissect_ndr_nt_SID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *drep) { @@ -213,12 +215,12 @@ samr_dissect_SID(tvbuff_t *tvb, int offset, } static int -samr_dissect_SID_ptr(tvbuff_t *tvb, int offset, +dissect_ndr_nt_SID_ptr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *drep) { offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, - samr_dissect_SID, NDR_POINTER_UNIQUE, + dissect_ndr_nt_SID, NDR_POINTER_UNIQUE, "SID pointer", -1, 1); return offset; } @@ -995,7 +997,7 @@ samr_dissect_open_domain_rqst(tvbuff_t *tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_samr_access, NULL); offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, - samr_dissect_SID, NDR_POINTER_REF, + dissect_ndr_nt_SID, NDR_POINTER_REF, "", -1, 0); return offset; } @@ -1022,7 +1024,7 @@ samr_dissect_context_handle_SID(tvbuff_t *tvb, int offset, offset = dissect_ndr_ctx_hnd (tvb, offset, pinfo, tree, drep, hf_samr_hnd, NULL); offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, - samr_dissect_SID, NDR_POINTER_REF, + dissect_ndr_nt_SID, NDR_POINTER_REF, "SID", -1, 0); return offset; } @@ -1863,15 +1865,15 @@ samr_dissect_lookup_domain_reply(tvbuff_t *tvb, int offset, char *drep) { offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, - samr_dissect_SID_ptr, NDR_POINTER_REF, + dissect_ndr_nt_SID_ptr, NDR_POINTER_REF, "", -1, 0); offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_samr_rc, NULL); return offset; } -static int -samr_dissect_PSID(tvbuff_t *tvb, int offset, +int +dissect_ndr_nt_PSID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, char *drep) { @@ -1886,7 +1888,7 @@ samr_dissect_PSID(tvbuff_t *tvb, int offset, } offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, - samr_dissect_SID, NDR_POINTER_UNIQUE, + dissect_ndr_nt_SID, NDR_POINTER_UNIQUE, "SID", -1, 0); proto_item_set_len(item, offset-old_offset); @@ -1895,19 +1897,19 @@ samr_dissect_PSID(tvbuff_t *tvb, int offset, static int -samr_dissect_PSID_ARRAY_sids (tvbuff_t *tvb, int offset, +dissect_ndr_nt_PSID_ARRAY_sids (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *drep) { offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, - samr_dissect_PSID); + dissect_ndr_nt_PSID); return offset; } -static int -samr_dissect_PSID_ARRAY(tvbuff_t *tvb, int offset, +int +dissect_ndr_nt_PSID_ARRAY(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, char *drep) { @@ -1925,13 +1927,63 @@ samr_dissect_PSID_ARRAY(tvbuff_t *tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_samr_count, &count); offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, - samr_dissect_PSID_ARRAY_sids, NDR_POINTER_UNIQUE, + dissect_ndr_nt_PSID_ARRAY_sids, NDR_POINTER_UNIQUE, "PSID_ARRAY", -1, 0); proto_item_set_len(item, offset-old_offset); return offset; } +/* called from NETLOGON but placed here since where are where the hf_fields are defined */ +int +dissect_ndr_nt_SID_AND_ATTRIBUTES(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *parent_tree, + char *drep) +{ + proto_item *item=NULL; + proto_tree *tree=NULL; + int old_offset=offset; + + if(parent_tree){ + item = proto_tree_add_text(parent_tree, tvb, offset, 0, + "SID_AND_ATTRIBUTES:"); + tree = proto_item_add_subtree(item, ett_samr_sid_and_attributes); + } + + offset = dissect_ndr_nt_PSID(tvb, offset, pinfo, tree, drep); + + offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, + hf_samr_attrib, NULL); + + return offset; +} + +int +dissect_ndr_nt_SID_AND_ATTRIBUTES_ARRAY(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *parent_tree, + char *drep) +{ + guint32 count; + proto_item *item=NULL; + proto_tree *tree=NULL; + int old_offset=offset; + + if(parent_tree){ + item = proto_tree_add_text(parent_tree, tvb, offset, 0, + "SID_AND_ATTRIBUTES array:"); + tree = proto_item_add_subtree(item, ett_samr_sid_and_attributes_array); + } + + offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, + hf_samr_count, &count); + offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, + dissect_ndr_nt_SID_AND_ATTRIBUTES); + + proto_item_set_len(item, offset-old_offset); + return offset; +} + + static int samr_dissect_index(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, @@ -2018,7 +2070,7 @@ samr_dissect_get_alias_membership_rqst(tvbuff_t *tvb, int offset, offset = dissect_ndr_ctx_hnd (tvb, offset, pinfo, tree, drep, hf_samr_hnd, NULL); offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, - samr_dissect_PSID_ARRAY, NDR_POINTER_REF, + dissect_ndr_nt_PSID_ARRAY, NDR_POINTER_REF, "", -1, 0); return offset; } @@ -2036,7 +2088,6 @@ samr_dissect_get_alias_membership_reply(tvbuff_t *tvb, int offset, return offset; } - static int samr_dissect_IDX_AND_NAME(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, @@ -2230,7 +2281,7 @@ samr_dissect_get_members_in_alias_reply(tvbuff_t *tvb, int offset, char *drep) { offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, - samr_dissect_PSID_ARRAY, NDR_POINTER_REF, + dissect_ndr_nt_PSID_ARRAY, NDR_POINTER_REF, "", -1, 0); offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_samr_rc, NULL); @@ -3833,6 +3884,8 @@ proto_register_dcerpc_samr(void) &ett_samr_member_array, &ett_samr_names, &ett_samr_rids, + &ett_samr_sid_and_attributes_array, + &ett_samr_sid_and_attributes, &ett_nt_acct_ctrl, }; |