aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/dcerpc
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-03-19 14:30:05 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-03-19 14:30:05 +0000
commitf4eb9215d9091f3b848e61089c39071cde5a953b (patch)
tree84fcca0c78c98ab1e1bcf48b5a68480ccb598ee1 /epan/dissectors/dcerpc
parent2970e03650e13bc2b44cd170a6aaf494cd8a8443 (diff)
make idl2eth handle 8bit bitmaps
make atsvc an autogenerated dcerpc dissector git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13808 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/dcerpc')
-rw-r--r--epan/dissectors/dcerpc/atsvc/Makefile16
-rw-r--r--epan/dissectors/dcerpc/atsvc/atsvc.cnf14
-rw-r--r--epan/dissectors/dcerpc/atsvc/atsvc.idl127
-rwxr-xr-xepan/dissectors/dcerpc/atsvc/template.c101
-rwxr-xr-xepan/dissectors/dcerpc/atsvc/template.h34
-rw-r--r--epan/dissectors/dcerpc/idl2eth.c28
6 files changed, 317 insertions, 3 deletions
diff --git a/epan/dissectors/dcerpc/atsvc/Makefile b/epan/dissectors/dcerpc/atsvc/Makefile
new file mode 100644
index 0000000000..adbd8357c6
--- /dev/null
+++ b/epan/dissectors/dcerpc/atsvc/Makefile
@@ -0,0 +1,16 @@
+# $Id: Makefile 13071 2005-01-16 10:19:21Z guy $
+
+DISSECTOR_FILES=packet-dcerpc-atsvc.c packet-dcerpc-atsvc.h
+
+all: generate_dissector
+
+generate_dissector: $(DISSECTOR_FILES)
+
+$(DISSECTOR_FILES): ../idl2eth atsvc.idl atsvc.cnf template.c template.h
+ ../idl2eth atsvc
+
+clean:
+ rm -f ETH_* $(DISSECTOR_FILES)
+
+copy_files: generate_dissector
+ cp $(DISSECTOR_FILES) ../..
diff --git a/epan/dissectors/dcerpc/atsvc/atsvc.cnf b/epan/dissectors/dcerpc/atsvc/atsvc.cnf
new file mode 100644
index 0000000000..890d9e3f9d
--- /dev/null
+++ b/epan/dissectors/dcerpc/atsvc/atsvc.cnf
@@ -0,0 +1,14 @@
+#
+NOEMIT atsvc_dissect_JobTime
+TYPE JobTime atsvc_dissect_JobTime FT_UINT32 BASE_HEX 0 NULL 4
+HF_FIELD hf_atsvc_job_time "JobTime" atsvc.JobTime FT_UINT32 BASE_HEX NULL 0 "Job Time"
+HF_RENAME hf_atsvc_JobInfo_job_time hf_atsvc_job_time
+HF_RENAME hf_atsvc_JobEnumInfo_job_time hf_atsvc_job_time
+#
+#
+# Make all job_id point to the same hf filter
+HF_FIELD hf_atsvc_job_id "Job ID" atsvc.JobId FT_UINT32 BASE_HEX NULL 0 "Job Id"
+HF_RENAME hf_atsvc_JobAdd_job_id hf_atsvc_job_id
+HF_RENAME hf_atsvc_JobEnumInfo_job_id hf_atsvc_job_id
+HF_RENAME hf_atsvc_JobGetInfo_job_id hf_atsvc_job_id
+#
diff --git a/epan/dissectors/dcerpc/atsvc/atsvc.idl b/epan/dissectors/dcerpc/atsvc/atsvc.idl
new file mode 100644
index 0000000000..db5a89501a
--- /dev/null
+++ b/epan/dissectors/dcerpc/atsvc/atsvc.idl
@@ -0,0 +1,127 @@
+/* from samba 4 revision 5661 but modified */
+
+/*
+ atsvc interface definition
+*/
+
+#include "idl_types.h"
+
+[ uuid("1ff70682-0a51-30e8-076d-740be8cee98b"),
+ version(1.0),
+ pointer_default(unique),
+ helpstring("Queue/List/Remove jobs for later execution"),
+ endpoint("ncacn_np:[\\pipe\\atsvc]", "ncalrpc:")
+] interface atsvc
+{
+ typedef [bitmap32bit] bitmap {
+ First = 0x00000001,
+ Second = 0x00000002,
+ Third = 0x00000004,
+ Fourth = 0x00000008,
+ Fifth = 0x00000010,
+ Sixth = 0x00000020,
+ Seventh = 0x00000040,
+ Eight = 0x00000080,
+ Ninth = 0x00000100,
+ Tenth = 0x00000200,
+ Eleventh= 0x00000400,
+ Twelfth = 0x00000800,
+ Thitteenth = 0x00001000,
+ Fourteenth = 0x00002000,
+ Fifteenth = 0x00004000,
+ Sixteenth = 0x00008000,
+ Seventeenth = 0x00010000,
+ Eighteenth = 0x00020000,
+ Ninteenth = 0x00040000,
+ Twentyth = 0x00080000,
+ Twentyfirst = 0x00100000,
+ Twentysecond = 0x00200000,
+ Twentythird = 0x00400000,
+ Twentyfourth = 0x00800000,
+ Twentyfifth = 0x01000000,
+ Twentysixth = 0x02000000,
+ Twentyseventh = 0x04000000,
+ Twentyeighth = 0x08000000,
+ Twentyninth = 0x10000000,
+ Thirtieth = 0x20000000,
+ Thirtyfirst = 0x40000000,
+ } atsvc_DaysOfMonth;
+
+ typedef [bitmap8bit] bitmap {
+ Monday = 0x01,
+ Tuesday = 0x02,
+ Wednesday = 0x04,
+ Thursday = 0x08,
+ Friday = 0x10,
+ Saturday = 0x20,
+ Sunday = 0x40
+ } atsvc_DaysOfWeek;
+
+ typedef [bitmap8bit] bitmap {
+ JOB_RUN_PERIODICALLY = 0x01,
+ JOB_EXEC_ERROR = 0x02,
+ JOB_RUNS_TODAY = 0x04,
+ JOB_ADD_CURRENT_DATE = 0x08,
+ JOB_NONINTERACTIVE = 0x10
+ } atsvc_Flags;
+
+ typedef struct {
+ uint32 job_time;
+ } atsvc_JobTime;
+
+ typedef struct {
+ atsvc_JobTime job_time;
+ atsvc_DaysOfMonth days_of_month;
+ atsvc_DaysOfWeek days_of_week;
+ atsvc_Flags flags;
+ unistr *command;
+ } atsvc_JobInfo;
+
+ /******************/
+ /* Function: 0x00 */
+ NTSTATUS atsvc_JobAdd(
+ [in] unistr *servername,
+ [in,ref] atsvc_JobInfo *job_info,
+ [out] uint32 job_id
+ );
+
+ /******************/
+ /* Function: 0x01 */
+ NTSTATUS atsvc_JobDel(
+ [in] unistr *servername,
+ [in] uint32 min_job_id,
+ [in] uint32 max_job_id
+ );
+
+ typedef struct {
+ uint32 job_id;
+ atsvc_JobTime job_time;
+ atsvc_DaysOfMonth days_of_month;
+ atsvc_DaysOfWeek days_of_week;
+ atsvc_Flags flags;
+ unistr *command;
+ } atsvc_JobEnumInfo;
+
+ typedef struct {
+ uint32 entries_read;
+ [size_is(entries_read)] atsvc_JobEnumInfo *first_entry[];
+ } atsvc_enum_ctr;
+
+ /******************/
+ /* Function: 0x02 */
+ NTSTATUS atsvc_JobEnum(
+ [in] unistr *servername,
+ [in,out,ref] atsvc_enum_ctr *ctr,
+ [in] uint32 preferred_max_len,
+ [out] uint32 total_entries,
+ [in,out] uint32 *resume_handle
+ );
+
+ /******************/
+ /* Function: 0x03 */
+ [public] NTSTATUS atsvc_JobGetInfo(
+ [in] unistr *servername,
+ [in] uint32 job_id,
+ [out] atsvc_JobInfo *job_info
+ );
+}
diff --git a/epan/dissectors/dcerpc/atsvc/template.c b/epan/dissectors/dcerpc/atsvc/template.c
new file mode 100755
index 0000000000..08cddffe08
--- /dev/null
+++ b/epan/dissectors/dcerpc/atsvc/template.c
@@ -0,0 +1,101 @@
+/* DO NOT EDIT
+ * This dissector is autogenerated
+ */
+
+/* packet-dcerpc-atsvc.c
+ * Routines for ATSVC packet disassembly
+ * based on the original dissector that was
+ * * Copyright 2003 Jean-Baptiste Marchand <jbm@hsc.fr>
+ * and IDL file from samba 4
+ *
+ * $Id: packet-dcerpc-atsvc.c 11592 2004-08-03 02:28:49Z guy $
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@ethereal.com>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <glib.h>
+#include <string.h>
+
+#include <epan/packet.h>
+#include "packet-dcerpc.h"
+#include "packet-dcerpc-nt.h"
+#include "packet-windows-common.h"
+#include "packet-dcerpc-atsvc.h"
+
+static int proto_atsvc = -1;
+ETH_HF
+
+ETH_ETT
+
+int
+atsvc_dissect_JobTime(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
+{
+ guint32 job_time;
+ guint8 job_hour, job_min, job_sec;
+ guint16 job_msec;
+
+ offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
+ -1, &job_time);
+
+ job_hour = job_time / 3600000;
+ job_min = (job_time - job_hour * 3600000) / 60000;
+ job_sec = (job_time - (job_hour * 3600000) - (job_min * 60000)) / 1000;
+ job_msec = (job_time - (job_hour * 3600000) - (job_min * 60000) - (job_sec * 1000));
+
+ proto_tree_add_uint_format(tree, hf_index, tvb, offset - 4,
+ 4, job_time, "Time: %02d:%02d:%02d:%03d", job_hour, job_min, job_sec, job_msec);
+
+ return offset;
+}
+
+ETH_CODE
+
+void
+proto_register_atsvc(void)
+{
+ static hf_register_info hf[] = {
+ETH_HFARR
+ };
+
+ static gint *ett[] = {
+ETH_ETTARR
+ };
+
+ proto_atsvc = proto_register_protocol(
+ "Microsoft Task Scheduler Service",
+ "ATSVC", "atsvc");
+ proto_register_field_array(proto_atsvc, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
+}
+
+static dcerpc_sub_dissector function_dissectors[] = {
+ETH_FT
+ { 0, NULL, NULL, NULL },
+};
+
+void
+proto_reg_handoff_atsvc(void)
+{
+ETH_HANDOFF
+}
+
diff --git a/epan/dissectors/dcerpc/atsvc/template.h b/epan/dissectors/dcerpc/atsvc/template.h
new file mode 100755
index 0000000000..600b5a7eb1
--- /dev/null
+++ b/epan/dissectors/dcerpc/atsvc/template.h
@@ -0,0 +1,34 @@
+/* DO NOT EDIT
+ * This dissector is autogenerated
+ * Autogenerated based on the IDL definitions from samba 4
+ */
+/* packet-dcerpc-atsvc.h
+ * Routines for ATSVC packet disassembly
+ *
+ * $Id: packet-dcerpc-atsvc.h 11410 2004-07-18 18:06:47Z gram $
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@ethereal.com>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __PACKET_DCERPC_ATSVC_H
+#define __PACKET_DCERPC_ATSVC_H
+
+ETH_HDR
+
+#endif /* packet-dcerpc-atsvc.h */
diff --git a/epan/dissectors/dcerpc/idl2eth.c b/epan/dissectors/dcerpc/idl2eth.c
index 9d4b49b348..af68d6ae85 100644
--- a/epan/dissectors/dcerpc/idl2eth.c
+++ b/epan/dissectors/dcerpc/idl2eth.c
@@ -93,8 +93,9 @@ typedef struct _pointer_item_t {
#define BI_SIZE_IS 0x00000010
#define BI_LENGTH_IS 0x00000020
#define BI_POINTER 0x00000040
-#define BI_BITMAP32 0x00000100
-#define BI_SWITCH_TYPE 0x00000200
+#define BI_BITMAP8 0x00000100
+#define BI_BITMAP32 0x00000200
+#define BI_SWITCH_TYPE 0x00000400
typedef struct _bracket_item_t {
long int flags;
char *case_name;
@@ -656,6 +657,13 @@ parsebrackets(token_item_t *ti, bracket_item_t **bracket){
continue;
}
+ /* bitmap8bit */
+ if(!strcmp(ti->str, "bitmap8bit")){
+ br->flags|=BI_BITMAP8;
+ ti=ti->next;
+ continue;
+ }
+
/* bitmap32bit */
if(!strcmp(ti->str, "bitmap32bit")){
br->flags|=BI_BITMAP32;
@@ -1857,13 +1865,16 @@ void parsetypedefbitmap(int pass)
}
/* check that we know how to handle the bracket thing */
if(bi){
- if(bi->flags&(~(BI_BITMAP32))){
+ if(bi->flags&(~(BI_BITMAP32|BI_BITMAP8))){
fprintf(stderr, "ERROR: typedefbitmap unknown bracket flags encountered : 0x%08x\n",bi->flags);
Exit(10);
}
if(bi->flags&BI_BITMAP32){
alignment=4;
}
+ if(bi->flags&BI_BITMAP8){
+ alignment=1;
+ }
}
@@ -1906,6 +1917,10 @@ void parsetypedefbitmap(int pass)
FPRINTF(eth_code, " proto_item *item=NULL;\n");
FPRINTF(eth_code, " proto_tree *tree=NULL;\n");
switch(alignment){
+ case 1:
+ FPRINTF(eth_code, " guint8 flags;\n");
+ FPRINTF(eth_code, "\n");
+ break;
case 4:
FPRINTF(eth_code, " guint32 flags;\n");
FPRINTF(eth_code, "\n");
@@ -1922,6 +1937,10 @@ void parsetypedefbitmap(int pass)
FPRINTF(eth_code, " }\n");
FPRINTF(eth_code, "\n");
switch(alignment){
+ case 1:
+ FPRINTF(eth_code, " offset=dissect_ndr_uint8(tvb, offset, pinfo, NULL, drep, -1, &flags);\n");
+ FPRINTF(eth_code, "\n");
+ break;
case 4:
FPRINTF(eth_code, " offset=dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &flags);\n");
FPRINTF(eth_code, "\n");
@@ -2005,6 +2024,9 @@ void parsetypedefbitmap(int pass)
FPRINTF(eth_code, " return offset;\n");
FPRINTF(eth_code, "}\n");
switch(alignment){
+ case 1:
+ register_new_type(bitmap_name, dissectorname, "FT_UINT8", "BASE_HEX", "0", "NULL", alignment);
+ break;
case 4:
register_new_type(bitmap_name, dissectorname, "FT_UINT32", "BASE_HEX", "0", "NULL", alignment);
break;