Coverage Report

Created: 2025-08-04 07:15

/src/wireshark/epan/dissectors/packet-dcerpc-witness.c
Line
Count
Source (jump to first uncovered line)
1
/* DO NOT EDIT
2
  This file was automatically generated by Pidl
3
  from witness.idl and witness.cnf.
4
5
  Pidl is a perl based IDL compiler for DCE/RPC idl files.
6
  It is maintained by the Samba team, not the Wireshark team.
7
  Instructions on how to download and install Pidl can be
8
  found at https://wiki.wireshark.org/Pidl
9
*/
10
11
12
#include "config.h"
13
#include <string.h>
14
#include <wsutil/array.h>
15
#include <epan/packet.h>
16
#include <epan/tfs.h>
17
18
#include "packet-dcerpc.h"
19
#include "packet-dcerpc-nt.h"
20
#include "packet-windows-common.h"
21
#include "packet-dcerpc-witness.h"
22
void proto_register_dcerpc_witness(void);
23
void proto_reg_handoff_dcerpc_witness(void);
24
25
/* Ett declarations */
26
static int ett_dcerpc_witness;
27
static int ett_witness_witness_interfaceInfo_flags;
28
static int ett_witness_witness_interfaceInfo;
29
static int ett_witness_witness_interfaceList;
30
static int ett_witness_witness_ResourceChange;
31
static int ett_witness_witness_IPaddrInfo_flags;
32
static int ett_witness_witness_IPaddrInfo;
33
static int ett_witness_witness_IPaddrInfoList;
34
static int ett_witness_witness_notifyResponse_message;
35
static int ett_witness_witness_notifyResponse;
36
static int ett_witness_witness_RegisterEx_flags;
37
38
39
/* Header field declarations */
40
static int hf_witness_opnum;
41
static int hf_witness_werror;
42
static int hf_witness_witness_AsyncNotify_context_handle;
43
static int hf_witness_witness_AsyncNotify_response;
44
static int hf_witness_witness_GetInterfaceList_interface_list;
45
static int hf_witness_witness_IPaddrInfoList_addr;
46
static int hf_witness_witness_IPaddrInfoList_length;
47
static int hf_witness_witness_IPaddrInfoList_num;
48
static int hf_witness_witness_IPaddrInfoList_reserved;
49
static int hf_witness_witness_IPaddrInfo_flags;
50
static int hf_witness_witness_IPaddrInfo_flags_WITNESS_IPADDR_OFFLINE;
51
static int hf_witness_witness_IPaddrInfo_flags_WITNESS_IPADDR_ONLINE;
52
static int hf_witness_witness_IPaddrInfo_flags_WITNESS_IPADDR_V4;
53
static int hf_witness_witness_IPaddrInfo_flags_WITNESS_IPADDR_V6;
54
static int hf_witness_witness_IPaddrInfo_ipv4;
55
static int hf_witness_witness_IPaddrInfo_ipv6;
56
static int hf_witness_witness_RegisterEx_client_computer_name;
57
static int hf_witness_witness_RegisterEx_context_handle;
58
static int hf_witness_witness_RegisterEx_flags;
59
static int hf_witness_witness_RegisterEx_flags_WITNESS_REGISTER_IP_NOTIFICATION;
60
static int hf_witness_witness_RegisterEx_ip_address;
61
static int hf_witness_witness_RegisterEx_net_name;
62
static int hf_witness_witness_RegisterEx_share_name;
63
static int hf_witness_witness_RegisterEx_timeout;
64
static int hf_witness_witness_RegisterEx_version;
65
static int hf_witness_witness_Register_client_computer_name;
66
static int hf_witness_witness_Register_context_handle;
67
static int hf_witness_witness_Register_ip_address;
68
static int hf_witness_witness_Register_net_name;
69
static int hf_witness_witness_Register_version;
70
static int hf_witness_witness_ResourceChange_length;
71
static int hf_witness_witness_ResourceChange_name;
72
static int hf_witness_witness_ResourceChange_type;
73
static int hf_witness_witness_UnRegister_context_handle;
74
static int hf_witness_witness_interfaceInfo_flags;
75
static int hf_witness_witness_interfaceInfo_flags_WITNESS_INFO_IPv4_VALID;
76
static int hf_witness_witness_interfaceInfo_flags_WITNESS_INFO_IPv6_VALID;
77
static int hf_witness_witness_interfaceInfo_flags_WITNESS_INFO_WITNESS_IF;
78
static int hf_witness_witness_interfaceInfo_group_name;
79
static int hf_witness_witness_interfaceInfo_ipv4;
80
static int hf_witness_witness_interfaceInfo_ipv6;
81
static int hf_witness_witness_interfaceInfo_state;
82
static int hf_witness_witness_interfaceInfo_version;
83
static int hf_witness_witness_interfaceList_interfaces;
84
static int hf_witness_witness_interfaceList_num_interfaces;
85
static int hf_witness_witness_notifyResponse_length;
86
static int hf_witness_witness_notifyResponse_message_client_move;
87
static int hf_witness_witness_notifyResponse_message_data;
88
static int hf_witness_witness_notifyResponse_message_ip_change;
89
static int hf_witness_witness_notifyResponse_message_resource_change;
90
static int hf_witness_witness_notifyResponse_message_share_move;
91
static int hf_witness_witness_notifyResponse_messages;
92
static int hf_witness_witness_notifyResponse_messages_;
93
static int hf_witness_witness_notifyResponse_num;
94
static int hf_witness_witness_notifyResponse_type;
95
96
static int proto_dcerpc_witness;
97
/* Version information */
98
99
100
static e_guid_t uuid_dcerpc_witness = {
101
  0xccd8c074, 0xd0e5, 0x4a40,
102
  { 0x92, 0xb4, 0xd0, 0x74, 0xfa, 0xa6, 0xba, 0x28 }
103
};
104
static uint16_t ver_dcerpc_witness = 1;
105
106
const value_string witness_witness_version_vals[] = {
107
  { WITNESS_V1, "WITNESS_V1" },
108
  { WITNESS_V2, "WITNESS_V2" },
109
  { WITNESS_UNSPECIFIED_VERSION, "WITNESS_UNSPECIFIED_VERSION" },
110
{ 0, NULL }
111
};
112
const value_string witness_witness_interfaceInfo_state_vals[] = {
113
  { WITNESS_STATE_UNKNOWN, "WITNESS_STATE_UNKNOWN" },
114
  { WITNESS_STATE_AVAILABLE, "WITNESS_STATE_AVAILABLE" },
115
  { WITNESS_STATE_UNAVAILABLE, "WITNESS_STATE_UNAVAILABLE" },
116
{ 0, NULL }
117
};
118
static const true_false_string witness_interfaceInfo_flags_WITNESS_INFO_IPv4_VALID_tfs = {
119
   "WITNESS_INFO_IPv4_VALID is SET",
120
   "WITNESS_INFO_IPv4_VALID is NOT SET",
121
};
122
static const true_false_string witness_interfaceInfo_flags_WITNESS_INFO_IPv6_VALID_tfs = {
123
   "WITNESS_INFO_IPv6_VALID is SET",
124
   "WITNESS_INFO_IPv6_VALID is NOT SET",
125
};
126
static const true_false_string witness_interfaceInfo_flags_WITNESS_INFO_WITNESS_IF_tfs = {
127
   "WITNESS_INFO_WITNESS_IF is SET",
128
   "WITNESS_INFO_WITNESS_IF is NOT SET",
129
};
130
static int witness_dissect_element_interfaceInfo_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
131
static int witness_dissect_element_interfaceInfo_state(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
132
static int witness_dissect_element_interfaceInfo_ipv4(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
133
static int witness_dissect_element_interfaceInfo_ipv6(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
134
static int witness_dissect_element_interfaceInfo_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
135
static int witness_dissect_element_interfaceList_num_interfaces(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
136
static int witness_dissect_element_interfaceList_interfaces(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
137
static int witness_dissect_element_interfaceList_interfaces_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
138
static int witness_dissect_element_interfaceList_interfaces__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
139
const value_string witness_witness_notifyResponse_type_vals[] = {
140
  { WITNESS_NOTIFY_RESOURCE_CHANGE, "WITNESS_NOTIFY_RESOURCE_CHANGE" },
141
  { WITNESS_NOTIFY_CLIENT_MOVE, "WITNESS_NOTIFY_CLIENT_MOVE" },
142
  { WITNESS_NOTIFY_SHARE_MOVE, "WITNESS_NOTIFY_SHARE_MOVE" },
143
  { WITNESS_NOTIFY_IP_CHANGE, "WITNESS_NOTIFY_IP_CHANGE" },
144
{ 0, NULL }
145
};
146
const value_string witness_witness_ResourceChange_type_vals[] = {
147
  { WITNESS_RESOURCE_STATE_UNKNOWN, "WITNESS_RESOURCE_STATE_UNKNOWN" },
148
  { WITNESS_RESOURCE_STATE_AVAILABLE, "WITNESS_RESOURCE_STATE_AVAILABLE" },
149
  { WITNESS_RESOURCE_STATE_UNAVAILABLE, "WITNESS_RESOURCE_STATE_UNAVAILABLE" },
150
{ 0, NULL }
151
};
152
static int witness_dissect_element_ResourceChange_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
153
static int witness_dissect_element_ResourceChange_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
154
static int witness_dissect_element_ResourceChange_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
155
static const true_false_string witness_IPaddrInfo_flags_WITNESS_IPADDR_V4_tfs = {
156
   "WITNESS_IPADDR_V4 is SET",
157
   "WITNESS_IPADDR_V4 is NOT SET",
158
};
159
static const true_false_string witness_IPaddrInfo_flags_WITNESS_IPADDR_V6_tfs = {
160
   "WITNESS_IPADDR_V6 is SET",
161
   "WITNESS_IPADDR_V6 is NOT SET",
162
};
163
static const true_false_string witness_IPaddrInfo_flags_WITNESS_IPADDR_ONLINE_tfs = {
164
   "WITNESS_IPADDR_ONLINE is SET",
165
   "WITNESS_IPADDR_ONLINE is NOT SET",
166
};
167
static const true_false_string witness_IPaddrInfo_flags_WITNESS_IPADDR_OFFLINE_tfs = {
168
   "WITNESS_IPADDR_OFFLINE is SET",
169
   "WITNESS_IPADDR_OFFLINE is NOT SET",
170
};
171
static int witness_dissect_element_IPaddrInfo_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
172
static int witness_dissect_element_IPaddrInfo_ipv4(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
173
static int witness_dissect_element_IPaddrInfo_ipv6(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
174
static int witness_dissect_element_IPaddrInfoList_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
175
static int witness_dissect_element_IPaddrInfoList_reserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
176
static int witness_dissect_element_IPaddrInfoList_num(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
177
static int witness_dissect_element_notifyResponse_message_resource_change(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
178
static int witness_dissect_element_notifyResponse_message_client_move(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
179
static int witness_dissect_element_notifyResponse_message_share_move(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
180
static int witness_dissect_element_notifyResponse_message_ip_change(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
181
static int witness_dissect_element_notifyResponse_message_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
182
static int witness_dissect_element_notifyResponse_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, uint32_t *type);
183
static int witness_dissect_element_notifyResponse_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
184
static int witness_dissect_element_notifyResponse_num(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
185
static const true_false_string witness_RegisterEx_flags_WITNESS_REGISTER_IP_NOTIFICATION_tfs = {
186
   "WITNESS_REGISTER_IP_NOTIFICATION is SET",
187
   "WITNESS_REGISTER_IP_NOTIFICATION is NOT SET",
188
};
189
static int witness_dissect_element_GetInterfaceList_interface_list(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
190
static int witness_dissect_element_GetInterfaceList_interface_list_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
191
static int witness_dissect_element_GetInterfaceList_interface_list__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
192
static int witness_dissect_element_Register_context_handle(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
193
static int witness_dissect_element_Register_context_handle_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
194
static int witness_dissect_element_Register_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
195
static int witness_dissect_element_Register_net_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
196
static int witness_dissect_element_Register_net_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
197
static int witness_dissect_element_Register_ip_address(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
198
static int witness_dissect_element_Register_ip_address_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
199
static int witness_dissect_element_Register_client_computer_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
200
static int witness_dissect_element_Register_client_computer_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
201
static int witness_dissect_element_UnRegister_context_handle(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
202
static int witness_dissect_element_AsyncNotify_context_handle(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
203
static int witness_dissect_element_AsyncNotify_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
204
static int witness_dissect_element_AsyncNotify_response_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
205
static int witness_dissect_element_AsyncNotify_response__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
206
static int witness_dissect_element_RegisterEx_context_handle(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
207
static int witness_dissect_element_RegisterEx_context_handle_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
208
static int witness_dissect_element_RegisterEx_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
209
static int witness_dissect_element_RegisterEx_net_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
210
static int witness_dissect_element_RegisterEx_net_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
211
static int witness_dissect_element_RegisterEx_share_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
212
static int witness_dissect_element_RegisterEx_share_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
213
static int witness_dissect_element_RegisterEx_ip_address(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
214
static int witness_dissect_element_RegisterEx_ip_address_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
215
static int witness_dissect_element_RegisterEx_client_computer_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
216
static int witness_dissect_element_RegisterEx_client_computer_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
217
static int witness_dissect_element_RegisterEx_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
218
static int witness_dissect_element_RegisterEx_timeout(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
219
 #include <wsutil/ws_roundup.h>
220
 #include "to_str.h"
221
static int
222
witness_dissect_notifyResponse_message(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_);
223
static int
224
witness_dissect_notifyResponse_message_(tvbuff_t *tvb, int offset, int length _U_, packet_info *pinfo,
225
                proto_tree *tree, dcerpc_info *di, uint8_t *drep _U_)
226
0
{
227
0
  uint32_t *type = (uint32_t *)di->private_data;
228
0
  uint8_t le_drep[4] = { DREP_LITTLE_ENDIAN, };
229
0
  return witness_dissect_notifyResponse_message(tvb, offset, pinfo, tree, di, le_drep,
230
0
                  hf_witness_witness_notifyResponse_messages_, *type);
231
0
}
232
static int
233
witness_dissect_element_notifyResponse_messages(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info *di _U_, uint8_t *drep _U_)
234
0
{
235
0
  offset = dissect_ndr_ucarray_block(tvb, offset, pinfo, tree, di, drep,
236
0
             witness_dissect_notifyResponse_message_);
237
0
  return offset;
238
0
}
239
int
240
witness_dissect_struct_notifyResponse(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)
241
0
{
242
0
  uint32_t *type = NULL;
243
0
  proto_item *item = NULL;
244
0
  proto_tree *tree = NULL;
245
0
  int old_offset;
246
0
  ALIGN_TO_4_BYTES;
247
0
  ALIGN_TO_4_BYTES;
248
0
  old_offset = offset;
249
0
  if (parent_tree) {
250
0
    item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
251
0
    tree = proto_item_add_subtree(item, ett_witness_witness_notifyResponse);
252
0
  }
253
0
  type = wmem_new0(pinfo->pool, uint32_t);
254
0
  offset = witness_dissect_element_notifyResponse_type(tvb, offset, pinfo, tree, di, drep, type);
255
0
  offset = witness_dissect_element_notifyResponse_length(tvb, offset, pinfo, tree, di, drep);
256
0
  offset = witness_dissect_element_notifyResponse_num(tvb, offset, pinfo, tree, di, drep);
257
0
  di->private_data = type;
258
0
  offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, di, drep,
259
0
                witness_dissect_element_notifyResponse_messages,
260
0
                NDR_POINTER_UNIQUE, "Pointer to Message Buffer (uint8)",
261
0
                hf_witness_witness_notifyResponse_messages);
262
0
  proto_item_set_len(item, offset-old_offset);
263
0
  if (di->call_data->flags & DCERPC_IS_NDR64) {
264
0
    ALIGN_TO_4_BYTES;
265
0
  }
266
0
  return offset;
267
0
}
268
static int
269
witness_dissect_element_IPaddrInfoList_addr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
270
0
{
271
0
  offset = witness_dissect_struct_IPaddrInfo(tvb,offset,pinfo,tree,di,drep,hf_witness_witness_IPaddrInfoList_addr,0);
272
0
  return offset;
273
0
}
274
int
275
witness_dissect_struct_IPaddrInfoList(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)
276
0
{
277
0
  proto_item *item = NULL;
278
0
  proto_tree *tree = NULL;
279
0
  bool oldalign = di->no_align;
280
0
  int old_offset;
281
0
  uint32_t i, num;
282
0
  di->no_align = true;
283
0
  old_offset = offset;
284
0
  if (parent_tree) {
285
0
    item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
286
0
    tree = proto_item_add_subtree(item, ett_witness_witness_IPaddrInfoList);
287
0
  }
288
0
  offset = witness_dissect_element_IPaddrInfoList_length(tvb, offset, pinfo, tree, di, drep);
289
0
  offset = witness_dissect_element_IPaddrInfoList_reserved(tvb, offset, pinfo, tree, di, drep);
290
0
  num = tvb_get_letohl(tvb, offset);
291
0
  offset = witness_dissect_element_IPaddrInfoList_num(tvb, offset, pinfo, tree, di, drep);
292
0
  for (i = 0; i < num; i++) {
293
0
    offset = witness_dissect_element_IPaddrInfoList_addr(tvb, offset, pinfo, tree, di, drep);
294
0
  }
295
0
  proto_item_set_len(item, offset-old_offset);
296
0
  di->no_align = oldalign;
297
0
  return offset;
298
0
}
299
static int
300
witness_dissect_element_interfaceInfo_group_name(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *parent_tree, dcerpc_info *di _U_, uint8_t *drep _U_)
301
0
{
302
0
  int totlen, stringlen;
303
0
  char *str;
304
0
  proto_item *pi;
305
  /*
306
   * XXX - this is described as
307
   *
308
   *    [charset(UTF16),to_null] uint16 group_name[260];
309
   *
310
   * I haven't found any documentation for what "to_null" means
311
   * in PIDL; is this a null-padded 260*2-byte array, so that
312
   * strings can be up to 260 16-bit units in length, or is
313
   * it a null-*terminated* string, so that it can be up to 259
314
   * 16-bit units in length?
315
   *
316
   * We assume it's null-padded, for now, and scan for a 2-byte
317
   * null terminator within the 260 2-byte units, and use
318
   * that as the length, with the length being 2*260 if there
319
   * isn't one.
320
   *
321
   * This will result in totlen being the total length, in
322
   * bytes, of the string, including the null terminator, if
323
   * present, and stringlen being the total length, in bytes.
324
   * not counting any null terminator.
325
   */
326
0
  totlen = 0;
327
0
  stringlen = 0;
328
0
  while (totlen < 2*260) {
329
    /*
330
     * These 2 bytes are either part of the string
331
     * or part of the null terminator, so count
332
     * them.
333
     */
334
0
    totlen += 2;
335
0
    if (tvb_get_letohs(tvb, offset + stringlen) == 0)
336
0
      break;
337
    /*
338
     * Those 2 bytes are part of the string, so
339
     * count them.
340
     */
341
0
    stringlen += 2;
342
0
  }
343
0
  pi = proto_tree_add_item_ret_display_string(parent_tree,
344
0
      hf_witness_witness_interfaceInfo_group_name, tvb, offset, stringlen,
345
0
      ENC_UTF_16|ENC_LITTLE_ENDIAN,
346
0
      pinfo->pool, &str);
347
0
  proto_item_append_text(pi, " [%d]", totlen);
348
0
  proto_item_append_text(parent_tree, ": %s", str);
349
  /*
350
   * All 260 16-bit units are part of the field, as they're always
351
   * there even if they don't need to be.
352
   */
353
0
  return offset + 2*260;
354
0
}
355
static int
356
PIDL_dissect_ipv4address(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep _U_, int hfindex, uint32_t param)
357
0
{
358
0
  if (di->conformant_run) {
359
    /* just a run to handle conformant arrays, no scalars to dissect */
360
0
    return offset;
361
0
  }
362
0
  if (!di->no_align) {
363
0
    offset = WS_ROUNDUP_4(offset);
364
0
  }
365
0
  proto_tree_add_item(tree, hfindex, tvb, offset, 4, ENC_BIG_ENDIAN);
366
0
  if (param & PIDL_SET_COL_INFO) {
367
0
    const char *ip = tvb_ip_to_str(pinfo->pool, tvb, offset);
368
0
    header_field_info *hf_info = proto_registrar_get_nth(hfindex);
369
0
    proto_item_append_text(proto_tree_get_parent(tree), " %s:%s", hf_info->name, ip);
370
0
    col_append_fstr(pinfo->cinfo, COL_INFO," %s:%s", hf_info->name, ip);
371
0
  }
372
0
  return offset + 4;
373
0
}
374
static int
375
PIDL_dissect_ipv6address(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep _U_, int hfindex, uint32_t param)
376
0
{
377
0
  if (di->conformant_run) {
378
    /* just a run to handle conformant arrays, no scalars to dissect */
379
0
    return offset;
380
0
  }
381
0
  if (!di->no_align) {
382
0
    offset = WS_ROUNDUP_2(offset);
383
0
  }
384
0
  proto_tree_add_item(tree, hfindex, tvb, offset, 16, ENC_BIG_ENDIAN);
385
0
  if (param & PIDL_SET_COL_INFO) {
386
0
    const char *ip = tvb_ip6_to_str(pinfo->pool, tvb, offset);
387
0
    header_field_info *hf_info = proto_registrar_get_nth(hfindex);
388
0
    proto_item_append_text(proto_tree_get_parent(tree), " %s:%s", hf_info->name, ip);
389
0
    col_append_fstr(pinfo->cinfo, COL_INFO," %s:%s", hf_info->name, ip);
390
0
  }
391
0
  return offset + 16;
392
0
}
393
394
395
/* IDL: enum { */
396
/* IDL:   WITNESS_V1=0x00010001, */
397
/* IDL:   WITNESS_V2=0x00020000, */
398
/* IDL:   WITNESS_UNSPECIFIED_VERSION=0xFFFFFFFF, */
399
/* IDL: } */
400
401
int
402
witness_dissect_enum_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t *param _U_)
403
0
{
404
0
  uint32_t parameter=0;
405
0
  if (param) {
406
0
    parameter = *param;
407
0
  }
408
0
  offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_index, &parameter);
409
0
  if (param) {
410
0
    *param = parameter;
411
0
  }
412
0
  return offset;
413
0
}
414
415
416
/* IDL: enum { */
417
/* IDL:   WITNESS_STATE_UNKNOWN=0x0000, */
418
/* IDL:   WITNESS_STATE_AVAILABLE=0x0001, */
419
/* IDL:   WITNESS_STATE_UNAVAILABLE=0x00ff, */
420
/* IDL: } */
421
422
int
423
witness_dissect_enum_interfaceInfo_state(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint16_t *param _U_)
424
0
{
425
0
  uint16_t parameter=0;
426
0
  if (param) {
427
0
    parameter = *param;
428
0
  }
429
0
  offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, di, drep, hf_index, &parameter);
430
0
  if (param) {
431
0
    *param = parameter;
432
0
  }
433
0
  return offset;
434
0
}
435
436
437
/* IDL: bitmap { */
438
/* IDL:   WITNESS_INFO_IPv4_VALID =  0x00000001 , */
439
/* IDL:   WITNESS_INFO_IPv6_VALID =  0x00000002 , */
440
/* IDL:   WITNESS_INFO_WITNESS_IF =  0x00000004 , */
441
/* IDL: } */
442
443
int
444
witness_dissect_bitmap_interfaceInfo_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)
445
0
{
446
0
  proto_item *item;
447
0
  static int * const witness_witness_interfaceInfo_flags_fields[] = {
448
0
    &hf_witness_witness_interfaceInfo_flags_WITNESS_INFO_IPv4_VALID,
449
0
    &hf_witness_witness_interfaceInfo_flags_WITNESS_INFO_IPv6_VALID,
450
0
    &hf_witness_witness_interfaceInfo_flags_WITNESS_INFO_WITNESS_IF,
451
0
    NULL
452
0
  };
453
0
  uint32_t flags;
454
0
  ALIGN_TO_4_BYTES;
455
456
0
  item = proto_tree_add_bitmask_with_flags(parent_tree, tvb, offset, hf_index,
457
0
        ett_witness_witness_interfaceInfo_flags, witness_witness_interfaceInfo_flags_fields, DREP_ENC_INTEGER(drep), BMT_NO_FALSE);
458
459
0
  offset = dissect_ndr_uint32(tvb, offset, pinfo, parent_tree, di, drep, -1, &flags);
460
461
0
  if (!flags)
462
0
    proto_item_append_text(item, ": (No values set)");
463
464
0
  if (flags & (~0x00000007)) {
465
0
    flags &= (~0x00000007);
466
0
    proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
467
0
  }
468
469
0
  return offset;
470
0
}
471
472
473
/* IDL: struct { */
474
/* IDL:   [charset(UTF16)] [to_null(1)] uint16 group_name[260]; */
475
/* IDL:   witness_version version; */
476
/* IDL:   witness_interfaceInfo_state state; */
477
/* IDL:   [flag(LIBNDR_FLAG_BIGENDIAN)] ipv4address ipv4; */
478
/* IDL:   [flag(LIBNDR_FLAG_BIGENDIAN)] ipv6address ipv6; */
479
/* IDL:   witness_interfaceInfo_flags flags; */
480
/* IDL: } */
481
482
static int
483
witness_dissect_element_interfaceInfo_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
484
0
{
485
0
  offset = witness_dissect_enum_version(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_interfaceInfo_version, 0);
486
487
0
  return offset;
488
0
}
489
490
static int
491
witness_dissect_element_interfaceInfo_state(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
492
0
{
493
0
  offset = witness_dissect_enum_interfaceInfo_state(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_interfaceInfo_state, 0);
494
495
0
  return offset;
496
0
}
497
498
static int
499
witness_dissect_element_interfaceInfo_ipv4(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
500
0
{
501
0
  offset=PIDL_dissect_ipv4address(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_interfaceInfo_ipv4, PIDL_SET_COL_INFO);
502
503
0
  return offset;
504
0
}
505
506
static int
507
witness_dissect_element_interfaceInfo_ipv6(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
508
0
{
509
0
  offset=PIDL_dissect_ipv6address(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_interfaceInfo_ipv6, PIDL_SET_COL_INFO);
510
511
0
  return offset;
512
0
}
513
514
static int
515
witness_dissect_element_interfaceInfo_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
516
0
{
517
0
  offset = witness_dissect_bitmap_interfaceInfo_flags(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_interfaceInfo_flags, 0);
518
519
0
  return offset;
520
0
}
521
522
int
523
witness_dissect_struct_interfaceInfo(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)
524
0
{
525
0
  proto_item *item = NULL;
526
0
  proto_tree *tree = NULL;
527
0
  int old_offset;
528
529
0
  ALIGN_TO_4_BYTES;
530
531
0
  old_offset = offset;
532
533
0
  if (parent_tree) {
534
0
    item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
535
0
    tree = proto_item_add_subtree(item, ett_witness_witness_interfaceInfo);
536
0
  }
537
538
0
  offset = witness_dissect_element_interfaceInfo_group_name(tvb, offset, pinfo, tree, di, drep);
539
540
0
  offset = witness_dissect_element_interfaceInfo_version(tvb, offset, pinfo, tree, di, drep);
541
542
0
  offset = witness_dissect_element_interfaceInfo_state(tvb, offset, pinfo, tree, di, drep);
543
544
0
  offset = witness_dissect_element_interfaceInfo_ipv4(tvb, offset, pinfo, tree, di, drep);
545
546
0
  offset = witness_dissect_element_interfaceInfo_ipv6(tvb, offset, pinfo, tree, di, drep);
547
548
0
  offset = witness_dissect_element_interfaceInfo_flags(tvb, offset, pinfo, tree, di, drep);
549
550
551
0
  proto_item_set_len(item, offset-old_offset);
552
553
554
0
  if (di->call_data->flags & DCERPC_IS_NDR64) {
555
0
    ALIGN_TO_4_BYTES;
556
0
  }
557
558
0
  return offset;
559
0
}
560
561
562
/* IDL: struct { */
563
/* IDL:   uint32 num_interfaces; */
564
/* IDL:   [size_is(num_interfaces)] [unique(1)] witness_interfaceInfo *interfaces; */
565
/* IDL: } */
566
567
static int
568
witness_dissect_element_interfaceList_num_interfaces(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
569
0
{
570
0
  offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_interfaceList_num_interfaces, 0);
571
572
0
  return offset;
573
0
}
574
575
static int
576
witness_dissect_element_interfaceList_interfaces(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
577
0
{
578
0
  offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_interfaceList_interfaces_, NDR_POINTER_UNIQUE, "Pointer to Interfaces (witness_interfaceInfo)",hf_witness_witness_interfaceList_interfaces);
579
580
0
  return offset;
581
0
}
582
583
static int
584
witness_dissect_element_interfaceList_interfaces_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
585
0
{
586
0
  offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_interfaceList_interfaces__);
587
588
0
  return offset;
589
0
}
590
591
static int
592
witness_dissect_element_interfaceList_interfaces__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
593
0
{
594
0
  offset = witness_dissect_struct_interfaceInfo(tvb,offset,pinfo,tree,di,drep,hf_witness_witness_interfaceList_interfaces,0);
595
596
0
  return offset;
597
0
}
598
599
int
600
witness_dissect_struct_interfaceList(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)
601
0
{
602
0
  proto_item *item = NULL;
603
0
  proto_tree *tree = NULL;
604
0
  int old_offset;
605
606
0
  ALIGN_TO_5_BYTES;
607
608
0
  old_offset = offset;
609
610
0
  if (parent_tree) {
611
0
    item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
612
0
    tree = proto_item_add_subtree(item, ett_witness_witness_interfaceList);
613
0
  }
614
615
0
  offset = witness_dissect_element_interfaceList_num_interfaces(tvb, offset, pinfo, tree, di, drep);
616
617
0
  offset = witness_dissect_element_interfaceList_interfaces(tvb, offset, pinfo, tree, di, drep);
618
619
620
0
  proto_item_set_len(item, offset-old_offset);
621
622
623
0
  if (di->call_data->flags & DCERPC_IS_NDR64) {
624
0
    ALIGN_TO_5_BYTES;
625
0
  }
626
627
0
  return offset;
628
0
}
629
630
631
/* IDL: enum { */
632
/* IDL:   WITNESS_NOTIFY_RESOURCE_CHANGE=1, */
633
/* IDL:   WITNESS_NOTIFY_CLIENT_MOVE=2, */
634
/* IDL:   WITNESS_NOTIFY_SHARE_MOVE=3, */
635
/* IDL:   WITNESS_NOTIFY_IP_CHANGE=4, */
636
/* IDL: } */
637
638
int
639
witness_dissect_enum_notifyResponse_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t *param _U_)
640
0
{
641
0
  uint32_t parameter=0;
642
0
  if (param) {
643
0
    parameter = *param;
644
0
  }
645
0
  offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_index, &parameter);
646
0
  if (param) {
647
0
    *param = parameter;
648
0
  }
649
0
  return offset;
650
0
}
651
652
653
/* IDL: enum { */
654
/* IDL:   WITNESS_RESOURCE_STATE_UNKNOWN=0x00, */
655
/* IDL:   WITNESS_RESOURCE_STATE_AVAILABLE=0x01, */
656
/* IDL:   WITNESS_RESOURCE_STATE_UNAVAILABLE=0xff, */
657
/* IDL: } */
658
659
int
660
witness_dissect_enum_ResourceChange_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t *param _U_)
661
0
{
662
0
  uint32_t parameter=0;
663
0
  if (param) {
664
0
    parameter = *param;
665
0
  }
666
0
  offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_index, &parameter);
667
0
  if (param) {
668
0
    *param = parameter;
669
0
  }
670
0
  return offset;
671
0
}
672
673
674
/* IDL: struct { */
675
/* IDL:   [value(ndr_size_witness_ResourceChange(r,ndr->flags))] uint32 length; */
676
/* IDL:   witness_ResourceChange_type type; */
677
/* IDL:   [flag(LIBNDR_FLAG_STR_NULLTERM)] string name; */
678
/* IDL: } */
679
680
static int
681
witness_dissect_element_ResourceChange_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
682
0
{
683
0
  offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_ResourceChange_length, 0);
684
685
0
  return offset;
686
0
}
687
688
static int
689
witness_dissect_element_ResourceChange_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
690
0
{
691
0
  offset = witness_dissect_enum_ResourceChange_type(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_ResourceChange_type, 0);
692
693
0
  return offset;
694
0
}
695
696
static int
697
witness_dissect_element_ResourceChange_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
698
0
{
699
0
  offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_witness_witness_ResourceChange_name , 0);
700
701
0
  return offset;
702
0
}
703
704
int
705
witness_dissect_struct_ResourceChange(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)
706
0
{
707
0
  proto_item *item = NULL;
708
0
  proto_tree *tree = NULL;
709
0
  bool oldalign = di->no_align;
710
0
  int old_offset;
711
712
0
  di->no_align = true;
713
714
0
  old_offset = offset;
715
716
0
  if (parent_tree) {
717
0
    item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
718
0
    tree = proto_item_add_subtree(item, ett_witness_witness_ResourceChange);
719
0
  }
720
721
0
  offset = witness_dissect_element_ResourceChange_length(tvb, offset, pinfo, tree, di, drep);
722
723
0
  offset = witness_dissect_element_ResourceChange_type(tvb, offset, pinfo, tree, di, drep);
724
725
0
  offset = witness_dissect_element_ResourceChange_name(tvb, offset, pinfo, tree, di, drep);
726
727
728
0
  proto_item_set_len(item, offset-old_offset);
729
730
731
0
  di->no_align = oldalign;
732
733
0
  return offset;
734
0
}
735
736
737
/* IDL: bitmap { */
738
/* IDL:   WITNESS_IPADDR_V4 =  0x00000001 , */
739
/* IDL:   WITNESS_IPADDR_V6 =  0x00000002 , */
740
/* IDL:   WITNESS_IPADDR_ONLINE =  0x00000008 , */
741
/* IDL:   WITNESS_IPADDR_OFFLINE =  0x00000010 , */
742
/* IDL: } */
743
744
int
745
witness_dissect_bitmap_IPaddrInfo_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)
746
0
{
747
0
  proto_item *item;
748
0
  static int * const witness_witness_IPaddrInfo_flags_fields[] = {
749
0
    &hf_witness_witness_IPaddrInfo_flags_WITNESS_IPADDR_V4,
750
0
    &hf_witness_witness_IPaddrInfo_flags_WITNESS_IPADDR_V6,
751
0
    &hf_witness_witness_IPaddrInfo_flags_WITNESS_IPADDR_ONLINE,
752
0
    &hf_witness_witness_IPaddrInfo_flags_WITNESS_IPADDR_OFFLINE,
753
0
    NULL
754
0
  };
755
0
  uint32_t flags;
756
0
  ALIGN_TO_4_BYTES;
757
758
0
  item = proto_tree_add_bitmask_with_flags(parent_tree, tvb, offset, hf_index,
759
0
        ett_witness_witness_IPaddrInfo_flags, witness_witness_IPaddrInfo_flags_fields, DREP_ENC_INTEGER(drep), BMT_NO_FALSE);
760
761
0
  offset = dissect_ndr_uint32(tvb, offset, pinfo, parent_tree, di, drep, -1, &flags);
762
763
0
  if (!flags)
764
0
    proto_item_append_text(item, ": (No values set)");
765
766
0
  if (flags & (~0x0000001b)) {
767
0
    flags &= (~0x0000001b);
768
0
    proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
769
0
  }
770
771
0
  return offset;
772
0
}
773
774
775
/* IDL: struct { */
776
/* IDL:   witness_IPaddrInfo_flags flags; */
777
/* IDL:   ipv4address ipv4; */
778
/* IDL:   ipv6address ipv6; */
779
/* IDL: } */
780
781
static int
782
witness_dissect_element_IPaddrInfo_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
783
0
{
784
0
  offset = witness_dissect_bitmap_IPaddrInfo_flags(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_IPaddrInfo_flags, 0);
785
786
0
  return offset;
787
0
}
788
789
static int
790
witness_dissect_element_IPaddrInfo_ipv4(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
791
0
{
792
0
  offset=PIDL_dissect_ipv4address(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_IPaddrInfo_ipv4, PIDL_SET_COL_INFO);
793
794
0
  return offset;
795
0
}
796
797
static int
798
witness_dissect_element_IPaddrInfo_ipv6(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
799
0
{
800
0
  offset=PIDL_dissect_ipv6address(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_IPaddrInfo_ipv6, PIDL_SET_COL_INFO);
801
802
0
  return offset;
803
0
}
804
805
int
806
witness_dissect_struct_IPaddrInfo(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)
807
0
{
808
0
  proto_item *item = NULL;
809
0
  proto_tree *tree = NULL;
810
0
  bool oldalign = di->no_align;
811
0
  int old_offset;
812
813
0
  di->no_align = true;
814
815
0
  old_offset = offset;
816
817
0
  if (parent_tree) {
818
0
    item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
819
0
    tree = proto_item_add_subtree(item, ett_witness_witness_IPaddrInfo);
820
0
  }
821
822
0
  offset = witness_dissect_element_IPaddrInfo_flags(tvb, offset, pinfo, tree, di, drep);
823
824
0
  offset = witness_dissect_element_IPaddrInfo_ipv4(tvb, offset, pinfo, tree, di, drep);
825
826
0
  offset = witness_dissect_element_IPaddrInfo_ipv6(tvb, offset, pinfo, tree, di, drep);
827
828
829
0
  proto_item_set_len(item, offset-old_offset);
830
831
832
0
  di->no_align = oldalign;
833
834
0
  return offset;
835
0
}
836
837
838
/* IDL: struct { */
839
/* IDL:   [value(r->num*ndr_size_witness_IPaddrInfo(r->addr,ndr->flags))] uint32 length; */
840
/* IDL:   [value(0)] uint32 reserved; */
841
/* IDL:   uint32 num; */
842
/* IDL:   witness_IPaddrInfo addr[num]; */
843
/* IDL: } */
844
845
static int
846
witness_dissect_element_IPaddrInfoList_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
847
0
{
848
0
  offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_IPaddrInfoList_length, 0);
849
850
0
  return offset;
851
0
}
852
853
static int
854
witness_dissect_element_IPaddrInfoList_reserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
855
0
{
856
0
  offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_IPaddrInfoList_reserved, 0);
857
858
0
  return offset;
859
0
}
860
861
static int
862
witness_dissect_element_IPaddrInfoList_num(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
863
0
{
864
0
  offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_IPaddrInfoList_num, 0);
865
866
0
  return offset;
867
0
}
868
869
870
/* IDL: [flag(LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN)] [nodiscriminant(1)] [public(1)] [switch_type(witness_notifyResponse_type)] union { */
871
/* IDL: [case(WITNESS_NOTIFY_RESOURCE_CHANGE)] [case(WITNESS_NOTIFY_RESOURCE_CHANGE)] witness_ResourceChange resource_change; */
872
/* IDL: [case(WITNESS_NOTIFY_CLIENT_MOVE)] [case(WITNESS_NOTIFY_CLIENT_MOVE)] witness_IPaddrInfoList client_move; */
873
/* IDL: [case(WITNESS_NOTIFY_SHARE_MOVE)] [case(WITNESS_NOTIFY_SHARE_MOVE)] witness_IPaddrInfoList share_move; */
874
/* IDL: [case(WITNESS_NOTIFY_IP_CHANGE)] [case(WITNESS_NOTIFY_IP_CHANGE)] witness_IPaddrInfoList ip_change; */
875
/* IDL: [default] ; */
876
/* IDL: } */
877
878
static int
879
witness_dissect_element_notifyResponse_message_resource_change(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
880
0
{
881
0
  offset = witness_dissect_struct_ResourceChange(tvb,offset,pinfo,tree,di,drep,hf_witness_witness_notifyResponse_message_resource_change,0);
882
883
0
  return offset;
884
0
}
885
886
static int
887
witness_dissect_element_notifyResponse_message_client_move(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
888
0
{
889
0
  offset = witness_dissect_struct_IPaddrInfoList(tvb,offset,pinfo,tree,di,drep,hf_witness_witness_notifyResponse_message_client_move,0);
890
891
0
  return offset;
892
0
}
893
894
static int
895
witness_dissect_element_notifyResponse_message_share_move(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
896
0
{
897
0
  offset = witness_dissect_struct_IPaddrInfoList(tvb,offset,pinfo,tree,di,drep,hf_witness_witness_notifyResponse_message_share_move,0);
898
899
0
  return offset;
900
0
}
901
902
static int
903
witness_dissect_element_notifyResponse_message_ip_change(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
904
0
{
905
0
  offset = witness_dissect_struct_IPaddrInfoList(tvb,offset,pinfo,tree,di,drep,hf_witness_witness_notifyResponse_message_ip_change,0);
906
907
0
  return offset;
908
0
}
909
910
static int
911
witness_dissect_element_notifyResponse_message_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
912
0
{
913
0
  offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_notifyResponse_message_data, 1);
914
915
0
  return offset;
916
0
}
917
918
static int
919
witness_dissect_notifyResponse_message(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)
920
0
{
921
0
  proto_item *item = NULL;
922
0
  proto_tree *tree = NULL;
923
0
  int old_offset;
924
0
  uint32_t level = param;
925
926
0
  old_offset = offset;
927
0
  if (parent_tree) {
928
0
    tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_witness_witness_notifyResponse_message, &item, "witness_notifyResponse_message");
929
0
  }
930
931
0
  switch(level) {
932
0
    case WITNESS_NOTIFY_RESOURCE_CHANGE:
933
0
      offset = witness_dissect_element_notifyResponse_message_resource_change(tvb, offset, pinfo, tree, di, drep);
934
0
    break;
935
936
0
    case WITNESS_NOTIFY_CLIENT_MOVE:
937
0
      offset = witness_dissect_element_notifyResponse_message_client_move(tvb, offset, pinfo, tree, di, drep);
938
0
    break;
939
940
0
    case WITNESS_NOTIFY_SHARE_MOVE:
941
0
      offset = witness_dissect_element_notifyResponse_message_share_move(tvb, offset, pinfo, tree, di, drep);
942
0
    break;
943
944
0
    case WITNESS_NOTIFY_IP_CHANGE:
945
0
      offset = witness_dissect_element_notifyResponse_message_ip_change(tvb, offset, pinfo, tree, di, drep);
946
0
    break;
947
948
0
    default:
949
0
      offset = witness_dissect_element_notifyResponse_message_data(tvb, offset, pinfo, tree, di, drep);
950
0
    break;
951
0
  }
952
0
  proto_item_set_len(item, offset-old_offset);
953
954
955
0
  return offset;
956
0
}
957
958
/* IDL: struct { */
959
/* IDL:   witness_notifyResponse_type type; */
960
/* IDL:   [value(ndr_size_witness_notifyResponse(r,ndr->flags)-20)] uint32 length; */
961
/* IDL:   uint32 num; */
962
/* IDL:   [flag(LIBNDR_FLAG_REMAINING)] [subcontext(4)] [subcontext_size(length)] [switch_is(type)] witness_notifyResponse_message messages[num]; */
963
/* IDL: } */
964
965
static int
966
witness_dissect_element_notifyResponse_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, uint32_t *type)
967
0
{
968
0
  offset = witness_dissect_enum_notifyResponse_type(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_notifyResponse_type, type);
969
970
0
  return offset;
971
0
}
972
973
static int
974
witness_dissect_element_notifyResponse_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
975
0
{
976
0
  offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_notifyResponse_length, 0);
977
978
0
  return offset;
979
0
}
980
981
static int
982
witness_dissect_element_notifyResponse_num(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
983
0
{
984
0
  offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_notifyResponse_num, 0);
985
986
0
  return offset;
987
0
}
988
989
990
/* IDL: bitmap { */
991
/* IDL:   WITNESS_REGISTER_NONE =  0x00000000 , */
992
/* IDL:   WITNESS_REGISTER_IP_NOTIFICATION =  0x00000001 , */
993
/* IDL: } */
994
995
int
996
witness_dissect_bitmap_RegisterEx_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)
997
0
{
998
0
  proto_item *item;
999
0
  static int * const witness_witness_RegisterEx_flags_fields[] = {
1000
0
    &hf_witness_witness_RegisterEx_flags_WITNESS_REGISTER_IP_NOTIFICATION,
1001
0
    NULL
1002
0
  };
1003
0
  uint32_t flags;
1004
0
  ALIGN_TO_4_BYTES;
1005
1006
0
  item = proto_tree_add_bitmask_with_flags(parent_tree, tvb, offset, hf_index,
1007
0
        ett_witness_witness_RegisterEx_flags, witness_witness_RegisterEx_flags_fields, DREP_ENC_INTEGER(drep), BMT_NO_FALSE);
1008
1009
0
  offset = dissect_ndr_uint32(tvb, offset, pinfo, parent_tree, di, drep, -1, &flags);
1010
1011
0
  if (!flags)
1012
0
    proto_item_append_text(item, ": (No values set)");
1013
1014
0
  if (flags & (~0x00000001)) {
1015
0
    flags &= (~0x00000001);
1016
0
    proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
1017
0
  }
1018
1019
0
  return offset;
1020
0
}
1021
1022
static int
1023
witness_dissect_element_GetInterfaceList_interface_list(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1024
0
{
1025
0
  offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_GetInterfaceList_interface_list_, NDR_POINTER_REF, "Pointer to Interface List (witness_interfaceList)",hf_witness_witness_GetInterfaceList_interface_list);
1026
1027
0
  return offset;
1028
0
}
1029
1030
static int
1031
witness_dissect_element_GetInterfaceList_interface_list_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1032
0
{
1033
0
  offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_GetInterfaceList_interface_list__, NDR_POINTER_UNIQUE, "Pointer to Interface List (witness_interfaceList)",hf_witness_witness_GetInterfaceList_interface_list);
1034
1035
0
  return offset;
1036
0
}
1037
1038
static int
1039
witness_dissect_element_GetInterfaceList_interface_list__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1040
0
{
1041
0
  offset = witness_dissect_struct_interfaceList(tvb,offset,pinfo,tree,di,drep,hf_witness_witness_GetInterfaceList_interface_list,0);
1042
1043
0
  return offset;
1044
0
}
1045
1046
/* IDL: WERROR witness_GetInterfaceList( */
1047
/* IDL: [out] [ref] witness_interfaceList **interface_list */
1048
/* IDL: ); */
1049
1050
static int
1051
witness_dissect_GetInterfaceList_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1052
0
{
1053
0
  uint32_t status;
1054
1055
0
  di->dcerpc_procedure_name="GetInterfaceList";
1056
0
  offset = witness_dissect_element_GetInterfaceList_interface_list(tvb, offset, pinfo, tree, di, drep);
1057
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1058
1059
0
  offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_werror, &status);
1060
1061
0
  if (status != 0)
1062
0
    col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown DOS error 0x%08x"));
1063
1064
0
  return offset;
1065
0
}
1066
1067
static int
1068
witness_dissect_GetInterfaceList_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1069
0
{
1070
0
  di->dcerpc_procedure_name="GetInterfaceList";
1071
0
  return offset;
1072
0
}
1073
1074
static int
1075
witness_dissect_element_Register_context_handle(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1076
0
{
1077
0
  offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_Register_context_handle_, NDR_POINTER_REF, "Pointer to Context Handle (policy_handle)",hf_witness_witness_Register_context_handle);
1078
1079
0
  return offset;
1080
0
}
1081
1082
static int
1083
witness_dissect_element_Register_context_handle_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1084
0
{
1085
0
  offset = PIDL_dissect_policy_hnd(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_Register_context_handle, 0);
1086
1087
0
  return offset;
1088
0
}
1089
1090
static int
1091
witness_dissect_element_Register_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1092
0
{
1093
0
  offset = witness_dissect_enum_version(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_Register_version, 0);
1094
1095
0
  return offset;
1096
0
}
1097
1098
static int
1099
witness_dissect_element_Register_net_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1100
0
{
1101
0
  offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_Register_net_name_, NDR_POINTER_UNIQUE, "Pointer to Net Name (uint16)",hf_witness_witness_Register_net_name);
1102
1103
0
  return offset;
1104
0
}
1105
1106
static int
1107
witness_dissect_element_Register_net_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1108
0
{
1109
0
  char *data;
1110
1111
0
  offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint16_t), hf_witness_witness_Register_net_name, false, &data);
1112
0
  proto_item_append_text(tree, ": %s", data);
1113
1114
0
  return offset;
1115
0
}
1116
1117
static int
1118
witness_dissect_element_Register_ip_address(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1119
0
{
1120
0
  offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_Register_ip_address_, NDR_POINTER_UNIQUE, "Pointer to Ip Address (uint16)",hf_witness_witness_Register_ip_address);
1121
1122
0
  return offset;
1123
0
}
1124
1125
static int
1126
witness_dissect_element_Register_ip_address_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1127
0
{
1128
0
  char *data;
1129
1130
0
  offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint16_t), hf_witness_witness_Register_ip_address, false, &data);
1131
0
  proto_item_append_text(tree, ": %s", data);
1132
1133
0
  return offset;
1134
0
}
1135
1136
static int
1137
witness_dissect_element_Register_client_computer_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1138
0
{
1139
0
  offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_Register_client_computer_name_, NDR_POINTER_UNIQUE, "Pointer to Client Computer Name (uint16)",hf_witness_witness_Register_client_computer_name);
1140
1141
0
  return offset;
1142
0
}
1143
1144
static int
1145
witness_dissect_element_Register_client_computer_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1146
0
{
1147
0
  char *data;
1148
1149
0
  offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint16_t), hf_witness_witness_Register_client_computer_name, false, &data);
1150
0
  proto_item_append_text(tree, ": %s", data);
1151
1152
0
  return offset;
1153
0
}
1154
1155
/* IDL: WERROR witness_Register( */
1156
/* IDL: [out] [ref] policy_handle *context_handle, */
1157
/* IDL: [in] witness_version version, */
1158
/* IDL: [charset(UTF16)] [in] [unique(1)] uint16 *net_name, */
1159
/* IDL: [charset(UTF16)] [in] [unique(1)] uint16 *ip_address, */
1160
/* IDL: [charset(UTF16)] [in] [unique(1)] uint16 *client_computer_name */
1161
/* IDL: ); */
1162
1163
static int
1164
witness_dissect_Register_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1165
0
{
1166
0
  uint32_t status;
1167
1168
0
  di->dcerpc_procedure_name="Register";
1169
0
  offset = witness_dissect_element_Register_context_handle(tvb, offset, pinfo, tree, di, drep);
1170
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1171
1172
0
  offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_werror, &status);
1173
1174
0
  if (status != 0)
1175
0
    col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown DOS error 0x%08x"));
1176
1177
0
  return offset;
1178
0
}
1179
1180
static int
1181
witness_dissect_Register_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1182
0
{
1183
0
  di->dcerpc_procedure_name="Register";
1184
0
  offset = witness_dissect_element_Register_version(tvb, offset, pinfo, tree, di, drep);
1185
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1186
0
  offset = witness_dissect_element_Register_net_name(tvb, offset, pinfo, tree, di, drep);
1187
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1188
0
  offset = witness_dissect_element_Register_ip_address(tvb, offset, pinfo, tree, di, drep);
1189
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1190
0
  offset = witness_dissect_element_Register_client_computer_name(tvb, offset, pinfo, tree, di, drep);
1191
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1192
0
  return offset;
1193
0
}
1194
1195
static int
1196
witness_dissect_element_UnRegister_context_handle(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1197
0
{
1198
0
  offset = PIDL_dissect_policy_hnd(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_UnRegister_context_handle, 0);
1199
1200
0
  return offset;
1201
0
}
1202
1203
/* IDL: WERROR witness_UnRegister( */
1204
/* IDL: [in] policy_handle context_handle */
1205
/* IDL: ); */
1206
1207
static int
1208
witness_dissect_UnRegister_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1209
0
{
1210
0
  uint32_t status;
1211
1212
0
  di->dcerpc_procedure_name="UnRegister";
1213
0
  offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_werror, &status);
1214
1215
0
  if (status != 0)
1216
0
    col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown DOS error 0x%08x"));
1217
1218
0
  return offset;
1219
0
}
1220
1221
static int
1222
witness_dissect_UnRegister_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1223
0
{
1224
0
  di->dcerpc_procedure_name="UnRegister";
1225
0
  offset = witness_dissect_element_UnRegister_context_handle(tvb, offset, pinfo, tree, di, drep);
1226
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1227
0
  return offset;
1228
0
}
1229
1230
static int
1231
witness_dissect_element_AsyncNotify_context_handle(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1232
0
{
1233
0
  offset = PIDL_dissect_policy_hnd(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_AsyncNotify_context_handle, 0);
1234
1235
0
  return offset;
1236
0
}
1237
1238
static int
1239
witness_dissect_element_AsyncNotify_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1240
0
{
1241
0
  offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_AsyncNotify_response_, NDR_POINTER_REF, "Pointer to Response (witness_notifyResponse)",hf_witness_witness_AsyncNotify_response);
1242
1243
0
  return offset;
1244
0
}
1245
1246
static int
1247
witness_dissect_element_AsyncNotify_response_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1248
0
{
1249
0
  offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_AsyncNotify_response__, NDR_POINTER_UNIQUE, "Pointer to Response (witness_notifyResponse)",hf_witness_witness_AsyncNotify_response);
1250
1251
0
  return offset;
1252
0
}
1253
1254
static int
1255
witness_dissect_element_AsyncNotify_response__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1256
0
{
1257
0
  offset = witness_dissect_struct_notifyResponse(tvb,offset,pinfo,tree,di,drep,hf_witness_witness_AsyncNotify_response,0);
1258
1259
0
  return offset;
1260
0
}
1261
1262
/* IDL: WERROR witness_AsyncNotify( */
1263
/* IDL: [in] policy_handle context_handle, */
1264
/* IDL: [out] [ref] witness_notifyResponse **response */
1265
/* IDL: ); */
1266
1267
static int
1268
witness_dissect_AsyncNotify_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1269
0
{
1270
0
  uint32_t status;
1271
1272
0
  di->dcerpc_procedure_name="AsyncNotify";
1273
0
  offset = witness_dissect_element_AsyncNotify_response(tvb, offset, pinfo, tree, di, drep);
1274
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1275
1276
0
  offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_werror, &status);
1277
1278
0
  if (status != 0)
1279
0
    col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown DOS error 0x%08x"));
1280
1281
0
  return offset;
1282
0
}
1283
1284
static int
1285
witness_dissect_AsyncNotify_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1286
0
{
1287
0
  di->dcerpc_procedure_name="AsyncNotify";
1288
0
  offset = witness_dissect_element_AsyncNotify_context_handle(tvb, offset, pinfo, tree, di, drep);
1289
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1290
0
  return offset;
1291
0
}
1292
1293
static int
1294
witness_dissect_element_RegisterEx_context_handle(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1295
0
{
1296
0
  offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_RegisterEx_context_handle_, NDR_POINTER_REF, "Pointer to Context Handle (policy_handle)",hf_witness_witness_RegisterEx_context_handle);
1297
1298
0
  return offset;
1299
0
}
1300
1301
static int
1302
witness_dissect_element_RegisterEx_context_handle_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1303
0
{
1304
0
  offset = PIDL_dissect_policy_hnd(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_RegisterEx_context_handle, 0);
1305
1306
0
  return offset;
1307
0
}
1308
1309
static int
1310
witness_dissect_element_RegisterEx_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1311
0
{
1312
0
  offset = witness_dissect_enum_version(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_RegisterEx_version, 0);
1313
1314
0
  return offset;
1315
0
}
1316
1317
static int
1318
witness_dissect_element_RegisterEx_net_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1319
0
{
1320
0
  offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_RegisterEx_net_name_, NDR_POINTER_UNIQUE, "Pointer to Net Name (uint16)",hf_witness_witness_RegisterEx_net_name);
1321
1322
0
  return offset;
1323
0
}
1324
1325
static int
1326
witness_dissect_element_RegisterEx_net_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1327
0
{
1328
0
  char *data;
1329
1330
0
  offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint16_t), hf_witness_witness_RegisterEx_net_name, false, &data);
1331
0
  proto_item_append_text(tree, ": %s", data);
1332
1333
0
  return offset;
1334
0
}
1335
1336
static int
1337
witness_dissect_element_RegisterEx_share_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1338
0
{
1339
0
  offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_RegisterEx_share_name_, NDR_POINTER_UNIQUE, "Pointer to Share Name (uint16)",hf_witness_witness_RegisterEx_share_name);
1340
1341
0
  return offset;
1342
0
}
1343
1344
static int
1345
witness_dissect_element_RegisterEx_share_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1346
0
{
1347
0
  char *data;
1348
1349
0
  offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint16_t), hf_witness_witness_RegisterEx_share_name, false, &data);
1350
0
  proto_item_append_text(tree, ": %s", data);
1351
1352
0
  return offset;
1353
0
}
1354
1355
static int
1356
witness_dissect_element_RegisterEx_ip_address(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1357
0
{
1358
0
  offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_RegisterEx_ip_address_, NDR_POINTER_UNIQUE, "Pointer to Ip Address (uint16)",hf_witness_witness_RegisterEx_ip_address);
1359
1360
0
  return offset;
1361
0
}
1362
1363
static int
1364
witness_dissect_element_RegisterEx_ip_address_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1365
0
{
1366
0
  char *data;
1367
1368
0
  offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint16_t), hf_witness_witness_RegisterEx_ip_address, false, &data);
1369
0
  proto_item_append_text(tree, ": %s", data);
1370
1371
0
  return offset;
1372
0
}
1373
1374
static int
1375
witness_dissect_element_RegisterEx_client_computer_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1376
0
{
1377
0
  offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, witness_dissect_element_RegisterEx_client_computer_name_, NDR_POINTER_UNIQUE, "Pointer to Client Computer Name (uint16)",hf_witness_witness_RegisterEx_client_computer_name);
1378
1379
0
  return offset;
1380
0
}
1381
1382
static int
1383
witness_dissect_element_RegisterEx_client_computer_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1384
0
{
1385
0
  char *data;
1386
1387
0
  offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint16_t), hf_witness_witness_RegisterEx_client_computer_name, false, &data);
1388
0
  proto_item_append_text(tree, ": %s", data);
1389
1390
0
  return offset;
1391
0
}
1392
1393
static int
1394
witness_dissect_element_RegisterEx_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1395
0
{
1396
0
  offset = witness_dissect_bitmap_RegisterEx_flags(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_RegisterEx_flags, 0);
1397
1398
0
  return offset;
1399
0
}
1400
1401
static int
1402
witness_dissect_element_RegisterEx_timeout(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1403
0
{
1404
0
  offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_witness_RegisterEx_timeout, 0);
1405
1406
0
  return offset;
1407
0
}
1408
1409
/* IDL: WERROR witness_RegisterEx( */
1410
/* IDL: [out] [ref] policy_handle *context_handle, */
1411
/* IDL: [in] witness_version version, */
1412
/* IDL: [charset(UTF16)] [in] [unique(1)] uint16 *net_name, */
1413
/* IDL: [charset(UTF16)] [in] [unique(1)] uint16 *share_name, */
1414
/* IDL: [charset(UTF16)] [in] [unique(1)] uint16 *ip_address, */
1415
/* IDL: [charset(UTF16)] [in] [unique(1)] uint16 *client_computer_name, */
1416
/* IDL: [in] witness_RegisterEx_flags flags, */
1417
/* IDL: [in] uint32 timeout */
1418
/* IDL: ); */
1419
1420
static int
1421
witness_dissect_RegisterEx_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1422
0
{
1423
0
  uint32_t status;
1424
1425
0
  di->dcerpc_procedure_name="RegisterEx";
1426
0
  offset = witness_dissect_element_RegisterEx_context_handle(tvb, offset, pinfo, tree, di, drep);
1427
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1428
1429
0
  offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_witness_werror, &status);
1430
1431
0
  if (status != 0)
1432
0
    col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown DOS error 0x%08x"));
1433
1434
0
  return offset;
1435
0
}
1436
1437
static int
1438
witness_dissect_RegisterEx_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
1439
0
{
1440
0
  di->dcerpc_procedure_name="RegisterEx";
1441
0
  offset = witness_dissect_element_RegisterEx_version(tvb, offset, pinfo, tree, di, drep);
1442
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1443
0
  offset = witness_dissect_element_RegisterEx_net_name(tvb, offset, pinfo, tree, di, drep);
1444
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1445
0
  offset = witness_dissect_element_RegisterEx_share_name(tvb, offset, pinfo, tree, di, drep);
1446
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1447
0
  offset = witness_dissect_element_RegisterEx_ip_address(tvb, offset, pinfo, tree, di, drep);
1448
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1449
0
  offset = witness_dissect_element_RegisterEx_client_computer_name(tvb, offset, pinfo, tree, di, drep);
1450
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1451
0
  offset = witness_dissect_element_RegisterEx_flags(tvb, offset, pinfo, tree, di, drep);
1452
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1453
0
  offset = witness_dissect_element_RegisterEx_timeout(tvb, offset, pinfo, tree, di, drep);
1454
0
  offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
1455
0
  return offset;
1456
0
}
1457
1458
1459
static const dcerpc_sub_dissector witness_dissectors[] = {
1460
  { 0, "GetInterfaceList",
1461
     witness_dissect_GetInterfaceList_request, witness_dissect_GetInterfaceList_response},
1462
  { 1, "Register",
1463
     witness_dissect_Register_request, witness_dissect_Register_response},
1464
  { 2, "UnRegister",
1465
     witness_dissect_UnRegister_request, witness_dissect_UnRegister_response},
1466
  { 3, "AsyncNotify",
1467
     witness_dissect_AsyncNotify_request, witness_dissect_AsyncNotify_response},
1468
  { 4, "RegisterEx",
1469
     witness_dissect_RegisterEx_request, witness_dissect_RegisterEx_response},
1470
  { 0, NULL, NULL, NULL }
1471
};
1472
1473
void proto_register_dcerpc_witness(void)
1474
14
{
1475
14
  static hf_register_info hf[] = {
1476
14
  { &hf_witness_opnum,
1477
14
    { "Operation", "witness.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1478
14
  { &hf_witness_werror,
1479
14
    { "Windows Error", "witness.werror", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &WERR_errors_ext, 0, NULL, HFILL }},
1480
14
  { &hf_witness_witness_AsyncNotify_context_handle,
1481
14
    { "Context Handle", "witness.witness_AsyncNotify.context_handle", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1482
14
  { &hf_witness_witness_AsyncNotify_response,
1483
14
    { "Response", "witness.witness_AsyncNotify.response", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1484
14
  { &hf_witness_witness_GetInterfaceList_interface_list,
1485
14
    { "Interface List", "witness.witness_GetInterfaceList.interface_list", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1486
14
  { &hf_witness_witness_IPaddrInfoList_addr,
1487
14
    { "Addr", "witness.witness_IPaddrInfoList.addr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1488
14
  { &hf_witness_witness_IPaddrInfoList_length,
1489
14
    { "Length", "witness.witness_IPaddrInfoList.length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1490
14
  { &hf_witness_witness_IPaddrInfoList_num,
1491
14
    { "Num", "witness.witness_IPaddrInfoList.num", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1492
14
  { &hf_witness_witness_IPaddrInfoList_reserved,
1493
14
    { "Reserved", "witness.witness_IPaddrInfoList.reserved", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1494
14
  { &hf_witness_witness_IPaddrInfo_flags,
1495
14
    { "Flags", "witness.witness_IPaddrInfo.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
1496
14
  { &hf_witness_witness_IPaddrInfo_flags_WITNESS_IPADDR_OFFLINE,
1497
14
    { "WITNESS IPADDR OFFLINE", "witness.witness_IPaddrInfo_flags.WITNESS_IPADDR_OFFLINE", FT_BOOLEAN, 32, TFS(&witness_IPaddrInfo_flags_WITNESS_IPADDR_OFFLINE_tfs), ( 0x00000010 ), NULL, HFILL }},
1498
14
  { &hf_witness_witness_IPaddrInfo_flags_WITNESS_IPADDR_ONLINE,
1499
14
    { "WITNESS IPADDR ONLINE", "witness.witness_IPaddrInfo_flags.WITNESS_IPADDR_ONLINE", FT_BOOLEAN, 32, TFS(&witness_IPaddrInfo_flags_WITNESS_IPADDR_ONLINE_tfs), ( 0x00000008 ), NULL, HFILL }},
1500
14
  { &hf_witness_witness_IPaddrInfo_flags_WITNESS_IPADDR_V4,
1501
14
    { "WITNESS IPADDR V4", "witness.witness_IPaddrInfo_flags.WITNESS_IPADDR_V4", FT_BOOLEAN, 32, TFS(&witness_IPaddrInfo_flags_WITNESS_IPADDR_V4_tfs), ( 0x00000001 ), NULL, HFILL }},
1502
14
  { &hf_witness_witness_IPaddrInfo_flags_WITNESS_IPADDR_V6,
1503
14
    { "WITNESS IPADDR V6", "witness.witness_IPaddrInfo_flags.WITNESS_IPADDR_V6", FT_BOOLEAN, 32, TFS(&witness_IPaddrInfo_flags_WITNESS_IPADDR_V6_tfs), ( 0x00000002 ), NULL, HFILL }},
1504
14
  { &hf_witness_witness_IPaddrInfo_ipv4,
1505
14
    { "Ipv4", "witness.witness_IPaddrInfo.ipv4", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL }},
1506
14
  { &hf_witness_witness_IPaddrInfo_ipv6,
1507
14
    { "Ipv6", "witness.witness_IPaddrInfo.ipv6", FT_IPv6, BASE_NONE, NULL, 0, NULL, HFILL }},
1508
14
  { &hf_witness_witness_RegisterEx_client_computer_name,
1509
14
    { "Client Computer Name", "witness.witness_RegisterEx.client_computer_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
1510
14
  { &hf_witness_witness_RegisterEx_context_handle,
1511
14
    { "Context Handle", "witness.witness_RegisterEx.context_handle", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1512
14
  { &hf_witness_witness_RegisterEx_flags,
1513
14
    { "Flags", "witness.witness_RegisterEx.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
1514
14
  { &hf_witness_witness_RegisterEx_flags_WITNESS_REGISTER_IP_NOTIFICATION,
1515
14
    { "WITNESS REGISTER IP NOTIFICATION", "witness.witness_RegisterEx_flags.WITNESS_REGISTER_IP_NOTIFICATION", FT_BOOLEAN, 32, TFS(&witness_RegisterEx_flags_WITNESS_REGISTER_IP_NOTIFICATION_tfs), ( 0x00000001 ), NULL, HFILL }},
1516
14
  { &hf_witness_witness_RegisterEx_ip_address,
1517
14
    { "Ip Address", "witness.witness_RegisterEx.ip_address", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
1518
14
  { &hf_witness_witness_RegisterEx_net_name,
1519
14
    { "Net Name", "witness.witness_RegisterEx.net_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
1520
14
  { &hf_witness_witness_RegisterEx_share_name,
1521
14
    { "Share Name", "witness.witness_RegisterEx.share_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
1522
14
  { &hf_witness_witness_RegisterEx_timeout,
1523
14
    { "Timeout", "witness.witness_RegisterEx.timeout", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1524
14
  { &hf_witness_witness_RegisterEx_version,
1525
14
    { "Version", "witness.witness_RegisterEx.version", FT_UINT32, BASE_DEC, VALS(witness_witness_version_vals), 0, NULL, HFILL }},
1526
14
  { &hf_witness_witness_Register_client_computer_name,
1527
14
    { "Client Computer Name", "witness.witness_Register.client_computer_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
1528
14
  { &hf_witness_witness_Register_context_handle,
1529
14
    { "Context Handle", "witness.witness_Register.context_handle", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1530
14
  { &hf_witness_witness_Register_ip_address,
1531
14
    { "Ip Address", "witness.witness_Register.ip_address", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
1532
14
  { &hf_witness_witness_Register_net_name,
1533
14
    { "Net Name", "witness.witness_Register.net_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
1534
14
  { &hf_witness_witness_Register_version,
1535
14
    { "Version", "witness.witness_Register.version", FT_UINT32, BASE_DEC, VALS(witness_witness_version_vals), 0, NULL, HFILL }},
1536
14
  { &hf_witness_witness_ResourceChange_length,
1537
14
    { "Length", "witness.witness_ResourceChange.length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1538
14
  { &hf_witness_witness_ResourceChange_name,
1539
14
    { "Name", "witness.witness_ResourceChange.name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
1540
14
  { &hf_witness_witness_ResourceChange_type,
1541
14
    { "Type", "witness.witness_ResourceChange.type", FT_UINT32, BASE_DEC, VALS(witness_witness_ResourceChange_type_vals), 0, NULL, HFILL }},
1542
14
  { &hf_witness_witness_UnRegister_context_handle,
1543
14
    { "Context Handle", "witness.witness_UnRegister.context_handle", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1544
14
  { &hf_witness_witness_interfaceInfo_flags,
1545
14
    { "Flags", "witness.witness_interfaceInfo.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
1546
14
  { &hf_witness_witness_interfaceInfo_flags_WITNESS_INFO_IPv4_VALID,
1547
14
    { "WITNESS INFO IPv4 VALID", "witness.witness_interfaceInfo_flags.WITNESS_INFO_IPv4_VALID", FT_BOOLEAN, 32, TFS(&witness_interfaceInfo_flags_WITNESS_INFO_IPv4_VALID_tfs), ( 0x00000001 ), NULL, HFILL }},
1548
14
  { &hf_witness_witness_interfaceInfo_flags_WITNESS_INFO_IPv6_VALID,
1549
14
    { "WITNESS INFO IPv6 VALID", "witness.witness_interfaceInfo_flags.WITNESS_INFO_IPv6_VALID", FT_BOOLEAN, 32, TFS(&witness_interfaceInfo_flags_WITNESS_INFO_IPv6_VALID_tfs), ( 0x00000002 ), NULL, HFILL }},
1550
14
  { &hf_witness_witness_interfaceInfo_flags_WITNESS_INFO_WITNESS_IF,
1551
14
    { "WITNESS INFO WITNESS IF", "witness.witness_interfaceInfo_flags.WITNESS_INFO_WITNESS_IF", FT_BOOLEAN, 32, TFS(&witness_interfaceInfo_flags_WITNESS_INFO_WITNESS_IF_tfs), ( 0x00000004 ), NULL, HFILL }},
1552
14
  { &hf_witness_witness_interfaceInfo_group_name,
1553
14
    { "Group Name", "witness.witness_interfaceInfo.group_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
1554
14
  { &hf_witness_witness_interfaceInfo_ipv4,
1555
14
    { "Ipv4", "witness.witness_interfaceInfo.ipv4", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL }},
1556
14
  { &hf_witness_witness_interfaceInfo_ipv6,
1557
14
    { "Ipv6", "witness.witness_interfaceInfo.ipv6", FT_IPv6, BASE_NONE, NULL, 0, NULL, HFILL }},
1558
14
  { &hf_witness_witness_interfaceInfo_state,
1559
14
    { "State", "witness.witness_interfaceInfo.state", FT_UINT16, BASE_DEC, VALS(witness_witness_interfaceInfo_state_vals), 0, NULL, HFILL }},
1560
14
  { &hf_witness_witness_interfaceInfo_version,
1561
14
    { "Version", "witness.witness_interfaceInfo.version", FT_UINT32, BASE_DEC, VALS(witness_witness_version_vals), 0, NULL, HFILL }},
1562
14
  { &hf_witness_witness_interfaceList_interfaces,
1563
14
    { "Interfaces", "witness.witness_interfaceList.interfaces", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1564
14
  { &hf_witness_witness_interfaceList_num_interfaces,
1565
14
    { "Num Interfaces", "witness.witness_interfaceList.num_interfaces", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1566
14
  { &hf_witness_witness_notifyResponse_length,
1567
14
    { "Length", "witness.witness_notifyResponse.length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1568
14
  { &hf_witness_witness_notifyResponse_message_client_move,
1569
14
    { "Client Move", "witness.witness_notifyResponse_message.client_move", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1570
14
  { &hf_witness_witness_notifyResponse_message_data,
1571
14
    { "Data", "witness.witness_notifyResponse_message.data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1572
14
  { &hf_witness_witness_notifyResponse_message_ip_change,
1573
14
    { "Ip Change", "witness.witness_notifyResponse_message.ip_change", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1574
14
  { &hf_witness_witness_notifyResponse_message_resource_change,
1575
14
    { "Resource Change", "witness.witness_notifyResponse_message.resource_change", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1576
14
  { &hf_witness_witness_notifyResponse_message_share_move,
1577
14
    { "Share Move", "witness.witness_notifyResponse_message.share_move", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1578
14
  { &hf_witness_witness_notifyResponse_messages,
1579
14
    { "Messages", "witness.witness_notifyResponse.messages", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1580
14
  { &hf_witness_witness_notifyResponse_messages_,
1581
14
    { "Messages", "witness.witness_notifyResponse.messages_", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1582
14
  { &hf_witness_witness_notifyResponse_num,
1583
14
    { "Num", "witness.witness_notifyResponse.num", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1584
14
  { &hf_witness_witness_notifyResponse_type,
1585
14
    { "Type", "witness.witness_notifyResponse.type", FT_UINT32, BASE_DEC, VALS(witness_witness_notifyResponse_type_vals), 0, NULL, HFILL }},
1586
14
  };
1587
1588
1589
14
  static int *ett[] = {
1590
14
    &ett_dcerpc_witness,
1591
14
    &ett_witness_witness_interfaceInfo_flags,
1592
14
    &ett_witness_witness_interfaceInfo,
1593
14
    &ett_witness_witness_interfaceList,
1594
14
    &ett_witness_witness_ResourceChange,
1595
14
    &ett_witness_witness_IPaddrInfo_flags,
1596
14
    &ett_witness_witness_IPaddrInfo,
1597
14
    &ett_witness_witness_IPaddrInfoList,
1598
14
    &ett_witness_witness_notifyResponse_message,
1599
14
    &ett_witness_witness_notifyResponse,
1600
14
    &ett_witness_witness_RegisterEx_flags,
1601
14
  };
1602
1603
14
  proto_dcerpc_witness = proto_register_protocol("SMB Witness Service", "WITNESS", "witness");
1604
14
  proto_register_field_array(proto_dcerpc_witness, hf, array_length (hf));
1605
14
  proto_register_subtree_array(ett, array_length(ett));
1606
14
}
1607
1608
void proto_reg_handoff_dcerpc_witness(void)
1609
14
{
1610
14
  dcerpc_init_uuid(proto_dcerpc_witness, ett_dcerpc_witness,
1611
14
    &uuid_dcerpc_witness, ver_dcerpc_witness,
1612
14
    witness_dissectors, hf_witness_opnum);
1613
14
}