git add -f bin/default/librpc/gen_ndr/packet-dcerpc-*
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / packet-dcerpc-frstransblobs.c
1 /* DO NOT EDIT
2         This filter was automatically generated
3         from /home/metze/devel/samba/4.0/master4-franky/librpc/idl/frstransblobs.idl and /home/metze/devel/samba/4.0/master4-franky/librpc/idl/frstransblobs.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 http://wiki.wireshark.org/Pidl
9
10         $Id$
11 */
12
13
14 #include "config.h"
15 #ifdef _MSC_VER
16 #pragma warning(disable:4005)
17 #pragma warning(disable:4013)
18 #pragma warning(disable:4018)
19 #pragma warning(disable:4101)
20 #endif
21
22 #include <glib.h>
23 #include <string.h>
24 #include <epan/packet.h>
25
26 #include "packet-dcerpc.h"
27 #include "packet-dcerpc-nt.h"
28 #include "packet-windows-common.h"
29 #include "packet-dcerpc-frstransblobs.h"
30
31 /* Ett declarations */
32 static gint ett_dcerpc_frstransblobs = -1;
33 static gint ett_frstransblobs_compressedBlock = -1;
34 static gint ett_frstransblobs_compressedDataFormat = -1;
35
36
37 /* Header field declarations */
38 static gint hf_frstransblobs_compressedBlock_Block_Signature = -1;
39 static gint hf_frstransblobs_decode_compressedDataFormat_data = -1;
40 static gint hf_frstransblobs_compressedDataFormat_block = -1;
41 static gint hf_frstransblobs_compressedBlock_uncompressed_size = -1;
42 static gint hf_frstransblobs_compressedBlock_compressed_size = -1;
43 static gint hf_frstransblobs_compressedDataFormat_Signature = -1;
44 static gint hf_frstransblobs_compressedBlock_data = -1;
45 static gint hf_frstransblobs_opnum = -1;
46
47 static gint proto_dcerpc_frstransblobs = -1;
48 /* Version information */
49
50
51 static e_uuid_t uuid_dcerpc_frstransblobs = {
52         0x12345778, 0x1234, 0xbcde,
53         { 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }
54 };
55 static guint16 ver_dcerpc_frstransblobs = 0;
56
57 static int frstransblobs_dissect_element_compressedBlock_Block_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
58 static int frstransblobs_dissect_element_compressedBlock_Block_Signature_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
59 static int frstransblobs_dissect_element_compressedBlock_compressed_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
60 static int frstransblobs_dissect_element_compressedBlock_uncompressed_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
61 static int frstransblobs_dissect_element_compressedBlock_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
62 static int frstransblobs_dissect_element_compressedBlock_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
63 static int frstransblobs_dissect_element_compressedDataFormat_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
64 static int frstransblobs_dissect_element_compressedDataFormat_Signature_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
65 static int frstransblobs_dissect_element_compressedDataFormat_block(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
66 static int frstransblobs_dissect_element_decode_compressedDataFormat_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
67
68
69 /* IDL: struct { */
70 /* IDL:         [value("XBLO")] [charset(DOS)] uint8 Block_Signature[4]; */
71 /* IDL:         uint32 compressed_size; */
72 /* IDL:         uint32 uncompressed_size; */
73 /* IDL:         uint8 data[compressed_size]; */
74 /* IDL: } */
75
76 static int
77 frstransblobs_dissect_element_compressedBlock_Block_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
78 {
79         int i;
80         for (i = 0; i < 4; i++)
81                 offset = frstransblobs_dissect_element_compressedBlock_Block_Signature_(tvb, offset, pinfo, tree, drep);
82
83         return offset;
84 }
85
86 static int
87 frstransblobs_dissect_element_compressedBlock_Block_Signature_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
88 {
89         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_frstransblobs_compressedBlock_Block_Signature, 0);
90
91         return offset;
92 }
93
94 static int
95 frstransblobs_dissect_element_compressedBlock_compressed_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
96 {
97         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_frstransblobs_compressedBlock_compressed_size, 0);
98
99         return offset;
100 }
101
102 static int
103 frstransblobs_dissect_element_compressedBlock_uncompressed_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
104 {
105         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_frstransblobs_compressedBlock_uncompressed_size, 0);
106
107         return offset;
108 }
109
110 static int
111 frstransblobs_dissect_element_compressedBlock_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
112 {
113
114         return offset;
115 }
116
117 static int
118 frstransblobs_dissect_element_compressedBlock_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
119 {
120         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_frstransblobs_compressedBlock_data, 0);
121
122         return offset;
123 }
124
125 int
126 frstransblobs_dissect_struct_compressedBlock(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
127 {
128         proto_item *item = NULL;
129         proto_tree *tree = NULL;
130         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
131         int old_offset;
132
133
134         old_offset = offset;
135
136         if (parent_tree) {
137                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
138                 tree = proto_item_add_subtree(item, ett_frstransblobs_compressedBlock);
139         }
140         
141         offset = frstransblobs_dissect_element_compressedBlock_Block_Signature(tvb, offset, pinfo, tree, drep);
142
143         offset = frstransblobs_dissect_element_compressedBlock_compressed_size(tvb, offset, pinfo, tree, drep);
144
145         offset = frstransblobs_dissect_element_compressedBlock_uncompressed_size(tvb, offset, pinfo, tree, drep);
146
147         offset = frstransblobs_dissect_element_compressedBlock_data(tvb, offset, pinfo, tree, drep);
148
149
150         proto_item_set_len(item, offset-old_offset);
151
152
153         if (di->call_data->flags & DCERPC_IS_NDR64) {
154                 ALIGN_TO_4_BYTES;
155         }
156
157         return offset;
158 }
159
160
161 /* IDL: struct { */
162 /* IDL:         [value("FRSX")] [charset(DOS)] uint8 Signature[4]; */
163 /* IDL:         compressedBlock block; */
164 /* IDL: } */
165
166 static int
167 frstransblobs_dissect_element_compressedDataFormat_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
168 {
169         int i;
170         for (i = 0; i < 4; i++)
171                 offset = frstransblobs_dissect_element_compressedDataFormat_Signature_(tvb, offset, pinfo, tree, drep);
172
173         return offset;
174 }
175
176 static int
177 frstransblobs_dissect_element_compressedDataFormat_Signature_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
178 {
179         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_frstransblobs_compressedDataFormat_Signature, 0);
180
181         return offset;
182 }
183
184 static int
185 frstransblobs_dissect_element_compressedDataFormat_block(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
186 {
187         offset = frstransblobs_dissect_struct_compressedBlock(tvb,offset,pinfo,tree,drep,hf_frstransblobs_compressedDataFormat_block,0);
188
189         return offset;
190 }
191
192 int
193 frstransblobs_dissect_struct_compressedDataFormat(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
194 {
195         proto_item *item = NULL;
196         proto_tree *tree = NULL;
197         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
198         int old_offset;
199
200
201         old_offset = offset;
202
203         if (parent_tree) {
204                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
205                 tree = proto_item_add_subtree(item, ett_frstransblobs_compressedDataFormat);
206         }
207         
208         offset = frstransblobs_dissect_element_compressedDataFormat_Signature(tvb, offset, pinfo, tree, drep);
209
210         offset = frstransblobs_dissect_element_compressedDataFormat_block(tvb, offset, pinfo, tree, drep);
211
212
213         proto_item_set_len(item, offset-old_offset);
214
215
216         if (di->call_data->flags & DCERPC_IS_NDR64) {
217                 ALIGN_TO_4_BYTES;
218         }
219
220         return offset;
221 }
222
223 static int
224 frstransblobs_dissect_element_decode_compressedDataFormat_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
225 {
226         offset = frstransblobs_dissect_struct_compressedDataFormat(tvb,offset,pinfo,tree,drep,hf_frstransblobs_decode_compressedDataFormat_data,0);
227
228         return offset;
229 }
230
231 /* IDL: void decode_compressedDataFormat( */
232 /* IDL: [in] compressedDataFormat data */
233 /* IDL: ); */
234
235 static int
236 frstransblobs_dissect_decode_compressedDataFormat_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
237 {
238         pinfo->dcerpc_procedure_name="decode_compressedDataFormat";
239         return offset;
240 }
241
242 static int
243 frstransblobs_dissect_decode_compressedDataFormat_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
244 {
245         pinfo->dcerpc_procedure_name="decode_compressedDataFormat";
246         offset = frstransblobs_dissect_element_decode_compressedDataFormat_data(tvb, offset, pinfo, tree, drep);
247         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
248         return offset;
249 }
250
251
252 static dcerpc_sub_dissector frstransblobs_dissectors[] = {
253         { 0, "decode_compressedDataFormat",
254            frstransblobs_dissect_decode_compressedDataFormat_request, frstransblobs_dissect_decode_compressedDataFormat_response},
255         { 0, NULL, NULL, NULL }
256 };
257
258 void proto_register_dcerpc_frstransblobs(void)
259 {
260         static hf_register_info hf[] = {
261         { &hf_frstransblobs_compressedBlock_Block_Signature,
262           { "Block Signature", "frstransblobs.compressedBlock.Block_Signature", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
263         { &hf_frstransblobs_decode_compressedDataFormat_data,
264           { "Data", "frstransblobs.decode_compressedDataFormat.data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
265         { &hf_frstransblobs_compressedDataFormat_block,
266           { "Block", "frstransblobs.compressedDataFormat.block", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
267         { &hf_frstransblobs_compressedBlock_uncompressed_size,
268           { "Uncompressed Size", "frstransblobs.compressedBlock.uncompressed_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
269         { &hf_frstransblobs_compressedBlock_compressed_size,
270           { "Compressed Size", "frstransblobs.compressedBlock.compressed_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
271         { &hf_frstransblobs_compressedDataFormat_Signature,
272           { "Signature", "frstransblobs.compressedDataFormat.Signature", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
273         { &hf_frstransblobs_compressedBlock_data,
274           { "Data", "frstransblobs.compressedBlock.data", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
275         { &hf_frstransblobs_opnum,
276           { "Operation", "frstransblobs.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
277         };
278
279
280         static gint *ett[] = {
281                 &ett_dcerpc_frstransblobs,
282                 &ett_frstransblobs_compressedBlock,
283                 &ett_frstransblobs_compressedDataFormat,
284         };
285
286         proto_dcerpc_frstransblobs = proto_register_protocol("DFS-R blobs", "FRSTRANSBLOBS", "frstransblobs");
287         proto_register_field_array(proto_dcerpc_frstransblobs, hf, array_length (hf));
288         proto_register_subtree_array(ett, array_length(ett));
289 }
290
291 void proto_reg_handoff_dcerpc_frstransblobs(void)
292 {
293         dcerpc_init_uuid(proto_dcerpc_frstransblobs, ett_dcerpc_frstransblobs,
294                 &uuid_dcerpc_frstransblobs, ver_dcerpc_frstransblobs,
295                 frstransblobs_dissectors, hf_frstransblobs_opnum);
296 }