Initial source import
[drsuapi_dissector.git] / drsuapi / packet-dcerpc-drsuapi-template.c
blob8a4e18983b92da5c94dc76467eed9df8160e8d96
1 /* DO NOT EDIT
2 * This dissector is autogenerated
3 */
5 /* packet-dcerpc-drsuapi.c
6 * Routines for DRSUAPI packet disassembly
7 * ronnie sahlberg 2005
9 * $Id: packet-dcerpc-drsuapi-template.c 30422 2009-10-09 09:12:59Z krj $
11 * Wireshark - Network traffic analyzer
12 * By Gerald Combs <gerald@wireshark.org>
13 * Copyright 1998 Gerald Combs
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 #ifdef HAVE_CONFIG_H
31 #include "config.h"
32 #endif
34 #include <glib.h>
35 #include <string.h>
37 #include <epan/packet.h>
38 #include "packet-dcerpc.h"
39 #include "packet-dcerpc-nt.h"
40 #include "packet-windows-common.h"
41 #include "packet-dcerpc-drsuapi.h"
43 static int proto_drsuapi = -1;
44 static int hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn = -1;
45 ETH_HF
47 ETH_ETT
49 static int
50 ucarray_drsuapi_dissect_DsReplicaSyncRequest1Info_nc_dn(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
52 header_field_info *hfinfo;
53 static guint32 len;
54 dcerpc_info *di;
55 char *s;
56 int old_offset;
58 di=pinfo->private_data;
59 if(di->conformant_run){
60 /*just a run to handle conformant arrays, nothing to dissect
61 but we need to remember how long this array was.
62 see packet-dcerpc.c for examples of conformant_run
63 and what it is.
65 old_offset=offset;
66 offset=dissect_dcerpc_uint32(tvb, offset, pinfo, NULL, drep, -1, &len);
67 di->array_max_count_offset=offset-4;
68 di->conformant_run=1;
69 di->conformant_eaten=offset-old_offset;
70 return offset;
73 ALIGN_TO_2_BYTES;
75 s = tvb_fake_unicode(tvb, offset, len, TRUE);
76 if (tree && len) {
77 hfinfo = proto_registrar_get_nth(hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn);
78 if (hfinfo->type == FT_STRING) {
79 proto_tree_add_string(tree, hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn, tvb, offset,
80 len, s);
81 } else {
82 proto_tree_add_item(tree, hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn, tvb, offset,
83 len, drep[0] & 0x10);
87 offset+=2*len;
88 return offset;
91 static int
92 drsuapi_dissect_a_string(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
94 offset=dissect_ndr_vstring(tvb, offset, pinfo, tree, drep, 1, hf_index, FALSE, NULL);
95 return offset;
98 ETH_CODE
100 void
101 proto_register_drsuapi(void)
103 static hf_register_info hf[] = {
104 { &hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn,
105 { "nc_dn", "drsuapi.DsReplicaSyncRequest1Info.nc_dn", FT_STRING, BASE_NONE,
106 NULL, 0,
107 NULL, HFILL }},
109 ETH_HFARR
112 static gint *ett[] = {
113 ETH_ETTARR
116 proto_drsuapi = proto_register_protocol(
117 "DRSUAPI",
118 "DRSUAPI", "drsuapi");
119 proto_register_field_array(proto_drsuapi, hf, array_length(hf));
120 proto_register_subtree_array(ett, array_length(ett));
123 static dcerpc_sub_dissector function_dissectors[] = {
124 ETH_FT
125 { 0, NULL, NULL, NULL },
128 void
129 proto_reg_handoff_drsuapi(void)
131 ETH_HANDOFF