Some warning fixes for "no previous declaration"
[obnox/wireshark/wip.git] / epan / dissectors / dcerpc / atsvc / template.c
1 /* DO NOT EDIT
2  * This dissector is autogenerated
3  */
4
5 /* packet-dcerpc-atsvc.c
6  * Routines for ATSVC packet disassembly
7  * based on the original dissector that was
8  *      * Copyright 2003 Jean-Baptiste Marchand <jbm@hsc.fr>
9  * and IDL file from samba 4
10  *
11  * $Id$
12  *
13  * Ethereal - Network traffic analyzer
14  * By Gerald Combs <gerald@ethereal.com>
15  * Copyright 1998 Gerald Combs
16  *
17  * This program is free software; you can redistribute it and/or
18  * modify it under the terms of the GNU General Public License
19  * as published by the Free Software Foundation; either version 2
20  * of the License, or (at your option) any later version.
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
30  */
31
32 #ifdef HAVE_CONFIG_H
33 #include "config.h"
34 #endif
35
36 #include <glib.h>
37 #include <string.h>
38
39 #include <epan/packet.h>
40 #include "packet-dcerpc.h"
41 #include "packet-dcerpc-nt.h"
42 #include "packet-windows-common.h"
43 #include "packet-dcerpc-atsvc.h"
44
45 static int proto_atsvc = -1;
46 ETH_HF
47
48 ETH_ETT
49
50 int
51 atsvc_dissect_JobTime(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
52 {
53         guint32 job_time;
54         guint8 job_hour, job_min, job_sec;
55         guint16 job_msec;
56
57         offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
58                         -1, &job_time);
59
60         job_hour = job_time / 3600000;
61         job_min = (job_time - job_hour * 3600000) / 60000;
62         job_sec = (job_time - (job_hour * 3600000) - (job_min * 60000)) / 1000;
63         job_msec = (job_time - (job_hour * 3600000) - (job_min * 60000) - (job_sec * 1000));
64
65         proto_tree_add_uint_format(tree, hf_index, tvb, offset - 4,
66                         4, job_time, "Time: %02d:%02d:%02d:%03d", job_hour, job_min, job_sec, job_msec);
67
68         return offset;
69 }
70
71 ETH_CODE
72
73 void
74 proto_register_atsvc(void)
75 {
76         static hf_register_info hf[] = {
77 ETH_HFARR
78         };
79
80         static gint *ett[] = {
81 ETH_ETTARR
82         };
83
84         proto_atsvc = proto_register_protocol(
85                 "Microsoft Task Scheduler Service", 
86                 "ATSVC", "atsvc");
87         proto_register_field_array(proto_atsvc, hf, array_length(hf));
88         proto_register_subtree_array(ett, array_length(ett));
89 }
90
91 static dcerpc_sub_dissector function_dissectors[] = {
92 ETH_FT
93         { 0, NULL, NULL, NULL },
94 };
95
96 void
97 proto_reg_handoff_atsvc(void)
98 {
99 ETH_HANDOFF
100 }
101