summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/pidl/dnsserver/dnsserver.cnf
blob: 290327845e40ec5c4e69966dc7a30e46d79fe332 (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
#
# 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

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, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)
{
	proto_item *item = NULL;
	proto_tree *tree = NULL;
	int old_offset;
	uint8_t len;

	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, ENC_NA);
		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);
	proto_tree_add_item(tree, hf_dnsserver_DNS_RPC_NAME_name, tvb,
		offset, len, ENC_UTF_8);
	offset += len;

	proto_item_set_len(item, offset-old_offset);

	return offset;
}


static uint16_t 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, uint8_t *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, uint8_t *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