summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dcerpc-iwbemloginclientid.c
blob: 8bed424e6bd95d2942e1a6c971fc858589e37158 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
/* DO NOT EDIT
	This file was automatically generated by Pidl
	from iwbemloginclientid.idl and iwbemloginclientid.cnf.

	Pidl is a perl based IDL compiler for DCE/RPC idl files.
	It is maintained by the Samba team, not the Wireshark team.
	Instructions on how to download and install Pidl can be
	found at https://wiki.wireshark.org/Pidl
*/


#include "config.h"
#include <string.h>
#include <wsutil/array.h>
#include <epan/packet.h>
#include <epan/tfs.h>

#include "packet-dcerpc.h"
#include "packet-dcerpc-nt.h"
#include "packet-windows-common.h"
#include "packet-dcerpc-iwbemloginclientid.h"
void proto_register_dcerpc_IWbemLoginClientID(void);
void proto_reg_handoff_dcerpc_IWbemLoginClientID(void);

/* Ett declarations */
static int ett_IWbemLoginClientID_SetClientInfo_orpcthis;
static int ett_IWbemLoginClientID_SetClientInfo_orpcthat;
static int ett_dcerpc_IWbemLoginClientID;
static int ett_IWbemLoginClientID_ORPCTHIS;
static int ett_IWbemLoginClientID_ORPCTHAT;


/* Header field declarations */
static int hf_IWbemLoginClientID_SetClientInfo_lClientProcId;
static int hf_IWbemLoginClientID_SetClientInfo_lReserved;
static int hf_IWbemLoginClientID_SetClientInfo_orpcthat;
static int hf_IWbemLoginClientID_SetClientInfo_orpcthis;
static int hf_IWbemLoginClientID_SetClientInfo_wszClientMachine;
static int hf_IWbemLoginClientID_opnum;
static int hf_IWbemLoginClientID_werror;

static int proto_dcerpc_IWbemLoginClientID;
/* Version information */


static e_guid_t uuid_dcerpc_IWbemLoginClientID = {
	0xd4781cd6, 0xe5d3, 0x44df,
	{ 0xad, 0x94, 0x93, 0x0e, 0xfe, 0x48, 0xa8, 0x87 }
};
static uint16_t ver_dcerpc_IWbemLoginClientID = 0;

static int IWbemLoginClientID_dissect_element_SetClientInfo_orpcthis(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int IWbemLoginClientID_dissect_element_SetClientInfo_wszClientMachine(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int IWbemLoginClientID_dissect_element_SetClientInfo_wszClientMachine_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int IWbemLoginClientID_dissect_element_SetClientInfo_lClientProcId(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int IWbemLoginClientID_dissect_element_SetClientInfo_lReserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int IWbemLoginClientID_dissect_element_SetClientInfo_orpcthat(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int IWbemLoginClientID_dissect_element_SetClientInfo_orpcthat_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
	#include "packet-dcom.h"
/* SetClientInfo */
static int
IWbemLoginClientID_dissect_element_SetClientInfo_orpcthis(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	proto_item *sub_item;
	proto_tree *sub_tree;
	sub_item = proto_tree_add_item(tree, hf_IWbemLoginClientID_SetClientInfo_orpcthis, tvb, offset, 0, ENC_NA);
	sub_tree = proto_item_add_subtree(sub_item, ett_IWbemLoginClientID_SetClientInfo_orpcthis);
	offset = dissect_dcom_this(tvb, offset, pinfo, sub_tree, di, drep);
	return offset;
}
static int
IWbemLoginClientID_dissect_element_SetClientInfo_orpcthat_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	proto_item *sub_item;
	proto_tree *sub_tree;
	sub_item = proto_tree_add_item(tree, hf_IWbemLoginClientID_SetClientInfo_orpcthat, tvb, offset, 0, ENC_NA);
	sub_tree = proto_item_add_subtree(sub_item, ett_IWbemLoginClientID_SetClientInfo_orpcthat);
	offset = dissect_dcom_that(tvb, offset, pinfo, sub_tree, di, drep);
	return offset;
}


/* IDL: struct { */
/* IDL: } */

int
IWbemLoginClientID_dissect_struct_ORPCTHIS(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_)
{
	proto_item *item = NULL;
	int old_offset;

	old_offset = offset;

	if (parent_tree) {
		item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
	}


	proto_item_set_len(item, offset-old_offset);


	return offset;
}


/* IDL: struct { */
/* IDL: } */

int
IWbemLoginClientID_dissect_struct_ORPCTHAT(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_)
{
	proto_item *item = NULL;
	int old_offset;

	old_offset = offset;

	if (parent_tree) {
		item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
	}


	proto_item_set_len(item, offset-old_offset);


	return offset;
}

/* IDL: WERROR iwbemloginclientid_opnum0( */
/* IDL:  */
/* IDL: ); */

static int
IWbemLoginClientID_dissect_iwbemloginclientid_opnum0_response(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 status;

	di->dcerpc_procedure_name="iwbemloginclientid_opnum0";
	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_IWbemLoginClientID_werror, &status);

	if (status != 0)
		col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown DOS error 0x%08x"));

	return offset;
}

static int
IWbemLoginClientID_dissect_iwbemloginclientid_opnum0_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	di->dcerpc_procedure_name="iwbemloginclientid_opnum0";
	return offset;
}

/* IDL: WERROR iwbemloginclientid_opnum1( */
/* IDL:  */
/* IDL: ); */

static int
IWbemLoginClientID_dissect_iwbemloginclientid_opnum1_response(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 status;

	di->dcerpc_procedure_name="iwbemloginclientid_opnum1";
	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_IWbemLoginClientID_werror, &status);

	if (status != 0)
		col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown DOS error 0x%08x"));

	return offset;
}

static int
IWbemLoginClientID_dissect_iwbemloginclientid_opnum1_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	di->dcerpc_procedure_name="iwbemloginclientid_opnum1";
	return offset;
}

/* IDL: WERROR iwbemloginclientid_opnum2( */
/* IDL:  */
/* IDL: ); */

static int
IWbemLoginClientID_dissect_iwbemloginclientid_opnum2_response(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 status;

	di->dcerpc_procedure_name="iwbemloginclientid_opnum2";
	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_IWbemLoginClientID_werror, &status);

	if (status != 0)
		col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown DOS error 0x%08x"));

	return offset;
}

static int
IWbemLoginClientID_dissect_iwbemloginclientid_opnum2_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	di->dcerpc_procedure_name="iwbemloginclientid_opnum2";
	return offset;
}

static int
IWbemLoginClientID_dissect_element_SetClientInfo_wszClientMachine(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, IWbemLoginClientID_dissect_element_SetClientInfo_wszClientMachine_, NDR_POINTER_UNIQUE, "Pointer to WszClientMachine (uint16)",hf_IWbemLoginClientID_SetClientInfo_wszClientMachine);

	return offset;
}

static int
IWbemLoginClientID_dissect_element_SetClientInfo_wszClientMachine_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	char *data;

	offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint16_t), hf_IWbemLoginClientID_SetClientInfo_wszClientMachine, false, &data);
	proto_item_append_text(tree, ": %s", data);

	return offset;
}

static int
IWbemLoginClientID_dissect_element_SetClientInfo_lClientProcId(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_IWbemLoginClientID_SetClientInfo_lClientProcId, 0);

	return offset;
}

static int
IWbemLoginClientID_dissect_element_SetClientInfo_lReserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_IWbemLoginClientID_SetClientInfo_lReserved, 0);

	return offset;
}

static int
IWbemLoginClientID_dissect_element_SetClientInfo_orpcthat(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, IWbemLoginClientID_dissect_element_SetClientInfo_orpcthat_, NDR_POINTER_REF, "Pointer to Orpcthat (ORPCTHAT)",hf_IWbemLoginClientID_SetClientInfo_orpcthat);

	return offset;
}

/* IDL: WERROR SetClientInfo( */
/* IDL: [in] ORPCTHIS orpcthis, */
/* IDL: [charset(UTF16)] [in] [unique(1)] uint16 *wszClientMachine, */
/* IDL: [in] uint32 lClientProcId, */
/* IDL: [in] uint32 lReserved, */
/* IDL: [out] [ref] ORPCTHAT *orpcthat */
/* IDL: ); */

static int
IWbemLoginClientID_dissect_SetClientInfo_response(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 status;

	di->dcerpc_procedure_name="SetClientInfo";
	offset = IWbemLoginClientID_dissect_element_SetClientInfo_orpcthat(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);

	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_IWbemLoginClientID_werror, &status);

	if (status != 0)
		col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown DOS error 0x%08x"));

	return offset;
}

static int
IWbemLoginClientID_dissect_SetClientInfo_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	di->dcerpc_procedure_name="SetClientInfo";
	offset = IWbemLoginClientID_dissect_element_SetClientInfo_orpcthis(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
	offset = IWbemLoginClientID_dissect_element_SetClientInfo_wszClientMachine(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
	offset = IWbemLoginClientID_dissect_element_SetClientInfo_lClientProcId(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
	offset = IWbemLoginClientID_dissect_element_SetClientInfo_lReserved(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
	return offset;
}


static const dcerpc_sub_dissector IWbemLoginClientID_dissectors[] = {
	{ 0, "iwbemloginclientid_opnum0",
	   IWbemLoginClientID_dissect_iwbemloginclientid_opnum0_request, IWbemLoginClientID_dissect_iwbemloginclientid_opnum0_response},
	{ 1, "iwbemloginclientid_opnum1",
	   IWbemLoginClientID_dissect_iwbemloginclientid_opnum1_request, IWbemLoginClientID_dissect_iwbemloginclientid_opnum1_response},
	{ 2, "iwbemloginclientid_opnum2",
	   IWbemLoginClientID_dissect_iwbemloginclientid_opnum2_request, IWbemLoginClientID_dissect_iwbemloginclientid_opnum2_response},
	{ 3, "SetClientInfo",
	   IWbemLoginClientID_dissect_SetClientInfo_request, IWbemLoginClientID_dissect_SetClientInfo_response},
	{ 0, NULL, NULL, NULL }
};

void proto_register_dcerpc_IWbemLoginClientID(void)
{
	static hf_register_info hf[] = {
	{ &hf_IWbemLoginClientID_SetClientInfo_lClientProcId,
	  { "LClientProcId", "IWbemLoginClientID.SetClientInfo.lClientProcId", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
	{ &hf_IWbemLoginClientID_SetClientInfo_lReserved,
	  { "LReserved", "IWbemLoginClientID.SetClientInfo.lReserved", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
	{ &hf_IWbemLoginClientID_SetClientInfo_orpcthat,
	  { "Orpcthat", "IWbemLoginClientID.SetClientInfo.orpcthat", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
	{ &hf_IWbemLoginClientID_SetClientInfo_orpcthis,
	  { "Orpcthis", "IWbemLoginClientID.SetClientInfo.orpcthis", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
	{ &hf_IWbemLoginClientID_SetClientInfo_wszClientMachine,
	  { "WszClientMachine", "IWbemLoginClientID.SetClientInfo.wszClientMachine", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
	{ &hf_IWbemLoginClientID_opnum,
	  { "Operation", "IWbemLoginClientID.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
	{ &hf_IWbemLoginClientID_werror,
	  { "Windows Error", "IWbemLoginClientID.werror", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &WERR_errors_ext, 0, NULL, HFILL }},
	};


	static int *ett[] = {
		&ett_IWbemLoginClientID_SetClientInfo_orpcthis,
		&ett_IWbemLoginClientID_SetClientInfo_orpcthat,
		&ett_dcerpc_IWbemLoginClientID,
		&ett_IWbemLoginClientID_ORPCTHIS,
		&ett_IWbemLoginClientID_ORPCTHAT,
	};

	proto_dcerpc_IWbemLoginClientID = proto_register_protocol("IWBEMLOGINCLIENTID (pidl)", "IWBEMLOGINCLIENTID", "IWbemLoginClientID");
	proto_register_field_array(proto_dcerpc_IWbemLoginClientID, hf, array_length (hf));
	proto_register_subtree_array(ett, array_length(ett));
}

void proto_reg_handoff_dcerpc_IWbemLoginClientID(void)
{
	dcerpc_init_uuid(proto_dcerpc_IWbemLoginClientID, ett_dcerpc_IWbemLoginClientID,
		&uuid_dcerpc_IWbemLoginClientID, ver_dcerpc_IWbemLoginClientID,
		IWbemLoginClientID_dissectors, hf_IWbemLoginClientID_opnum);
}