HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / pidl / dnsserver.cnf
blob8797217003cdfe281cc5b9e6b71f33d4838bf304
2 # DNS_RPC_NAME
4 MANUAL dnsserver_dissect_struct_DNS_RPC_NAME
5 HF_FIELD hf_dnsserver_DNS_RPC_NAME_name "Name" "dnsserver.DNS_RPC_NAME.name" FT_STRING BASE_NONE NULL 0 "" "" ""
9 # DNS_RPC_NODE
11 MANUAL dnsserver_dissect_element_DNS_RPC_NODE_RecordCount
12 MANUAL dnsserver_dissect_element_DNS_RPC_NODE_records
14 CODE START
16         #include "packet-smb-common.h"
18 int
19 dnsserver_dissect_struct_DNS_RPC_NAME(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
21         proto_item *item = NULL;
22         proto_tree *tree = NULL;
23         int old_offset;
24         guint8 len;
25         const char *dn;
26         int dn_len = 0;
27         guint16 bc;
29         if(di->conformant_run){
30                 /*just a run to handle conformant arrays, nothing to dissect */
31                 return offset;
32         }
36         old_offset = offset;
38         if (parent_tree) {
39                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
40                 tree = proto_item_add_subtree(item, ett_dnsserver_DNS_RPC_NAME);
41         }
43         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, di, drep, hf_dnsserver_DNS_RPC_NAME_NameLength, &len);
44         bc = tvb_length_remaining(tvb, offset);
45         dn = get_unicode_or_ascii_string(tvb, &offset,
46                         TRUE, &dn_len, TRUE, TRUE, &bc);
47         if (dn) {
48                 proto_tree_add_string(tree, hf_dnsserver_DNS_RPC_NAME_name, tvb,
49                         offset, dn_len,dn);
50                 offset += dn_len;
51         }
53         proto_item_set_len(item, offset-old_offset);
55         return offset;
59 static guint16 node_record_count;
61 static int
62 dnsserver_dissect_element_DNS_RPC_NODE_RecordCount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di, guint8 *drep _U_)
64         if(di->conformant_run){
65                 /*just a run to handle conformant arrays, nothing to dissect */
66                 return offset;
67         }
69         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, di, drep, hf_dnsserver_DNS_RPC_NODE_RecordCount, &node_record_count);
71         return offset;
74 static int
75 dnsserver_dissect_element_DNS_RPC_NODE_records(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di, guint8 *drep _U_)
77         if(di->conformant_run){
78                 /*just a run to handle conformant arrays, nothing to dissect */
79                 return offset;
80         }
82         while(node_record_count--){
83                 offset = dnsserver_dissect_element_DNS_RPC_NODE_records_(tvb, offset, pinfo, tree, di, drep);
84         }
86         return offset;
89 CODE END