aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/pidl/dnsserver.cnf
blob: eb2043900a95621dcea6e60e827bbb39420783c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#
# DNS_RPC_NAME
#
MANUAL dnsserver_dissect_struct_DNS_RPC_NAME
HF_FIELD hf_dnsserver_DNS_RPC_NAME_name "Name" "dnsserver.DNS_RPC_NAME.name" FT_STRING BASE_NONE NULL 0 "" "" ""


#
# DNS_RPC_NODE
#
MANUAL dnsserver_dissect_element_DNS_RPC_NODE_RecordCount
MANUAL dnsserver_dissect_element_DNS_RPC_NODE_records


NOEMIT dnsserver_dissect_element_DNS_RPC_NAME_NameLength
NOEMIT dnsserver_dissect_element_DNS_RPC_NAME_Name
NOEMIT dnsserver_dissect_element_DNS_RPC_NAME_Name_

CODE START

	#include "packet-smb-common.h"

int
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_)
{
	proto_item *item = NULL;
	proto_tree *tree = NULL;
	int old_offset;
	guint8 len;
	const char *dn;
	int dn_len = 0;
	guint16 bc;

	if(di->conformant_run){
		/*just a run to handle conformant arrays, nothing to dissect */
		return offset;
	}



	old_offset = offset;

	if (parent_tree) {
		item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
		tree = proto_item_add_subtree(item, ett_dnsserver_DNS_RPC_NAME);
	}

	offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, di, drep, hf_dnsserver_DNS_RPC_NAME_NameLength, &len);
	bc = tvb_captured_length_remaining(tvb, offset);
	dn = get_unicode_or_ascii_string(tvb, &offset,
			TRUE, &dn_len, TRUE, TRUE, &bc);
	if (dn) {
		proto_tree_add_string(tree, hf_dnsserver_DNS_RPC_NAME_name, tvb,
			offset, dn_len,dn);
		offset += dn_len;
	}

	proto_item_set_len(item, offset-old_offset);

	return offset;
}


static guint16 node_record_count;

static int
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_)
{
	if(di->conformant_run){
		/*just a run to handle conformant arrays, nothing to dissect */
		return offset;
	}

	offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, di, drep, hf_dnsserver_DNS_RPC_NODE_RecordCount, &node_record_count);

	return offset;
}

static int
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_)
{
	if(di->conformant_run){
		/*just a run to handle conformant arrays, nothing to dissect */
		return offset;
	}

	while(node_record_count--){
		offset = dnsserver_dissect_element_DNS_RPC_NODE_records_(tvb, offset, pinfo, tree, di, drep);
	}

	return offset;
}

CODE END