1 /* packet-dcerpc-butc.c
2 * Routines for butc dissection
3 * Copyright 2002, Jaime Fournier <Jaime.Fournier@hush.com>
4 * This information is based off the released idl files from opengroup.
5 * ftp://ftp.opengroup.org/pub/dce122/dce/src/file.tar.gz bubasics/butc.idl
7 * $Id: packet-dcerpc-butc.c,v 1.4 2004/02/20 22:35:43 guy Exp $
9 * Ethereal - Network traffic analyzer
10 * By Gerald Combs <gerald@ethereal.com>
11 * Copyright 1998 Gerald Combs
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 #ifdef HAVE_SYS_TYPES_H
34 #include <sys/types.h>
40 #include <epan/packet.h>
41 #include "packet-dcerpc.h"
43 static int proto_butc = -1;
44 static int hf_butc_opnum = -1;
47 static gint ett_butc = -1;
50 static e_uuid_t uuid_butc = { 0x1d193c08, 0x000b, 0x11ca, { 0xba, 0x1d, 0x02, 0x60, 0x8c, 0x2e, 0xa9, 0x6e } };
51 static guint16 ver_butc = 4;
54 #define TC_DEFAULT_STACK_SIZE (150*1024) /* stack size for tc threads */
55 #define TC_MAXGENNAMELEN 512 /* length of generic name */
56 #define TC_MAXDUMPPATH 256 /* dump path names*/
57 #define TC_MAXNAMELEN 128 /* name length */
58 #define TC_MAXFORMATLEN 100 /*size of the format statement */
59 #define TC_MAXHOSTLEN 128 /*for server/machine names */
60 #define TC_MAXTAPELEN 256 /*max tape name allowed */
61 #define TC_STAT_DONE 1 /* all done */
62 #define TC_STAT_OPRWAIT 2 /* waiting for user interaction */
63 #define TC_STAT_DUMP 4 /* true if dump, false if restore */
64 #define TC_STAT_ABORTED 8 /* the operation was aborted */
65 #define TC_STAT_ERROR 16 /* error ocuured in the operation */
66 #define TSK_STAT_FIRST 0x1 /* get id of first task */
67 #define TSK_STAT_END 0x2 /* no more tasks */
68 #define TSK_STAT_NOTFOUND 0x4 /* couldn't find task id requested */
71 #define TCOP_READLABEL 1
72 #define TCOP_LABELTAPE 2
74 #define TCOP_RESTORE 4
75 #define TCOP_SCANTAPE 5
77 #define TCOP_RESTOREDB 7
82 static dcerpc_sub_dissector butc_dissectors[] = {
83 { 0, "PerformDump", NULL, NULL},
84 { 1, "PerformRestore", NULL, NULL},
85 { 2, "AbortDump", NULL, NULL},
86 { 3, "LabelTape", NULL, NULL},
87 { 4, "ReadLabel", NULL, NULL},
88 { 5, "ScanDumps", NULL, NULL},
89 { 6, "TCInfo", NULL, NULL},
90 { 7, "SaveDb", NULL, NULL},
91 { 8, "RestoreDb", NULL, NULL},
92 { 9, "EndStatus", NULL, NULL},
93 { 10, "GetStatus", NULL, NULL},
94 { 11, "RequestAbort", NULL, NULL},
95 { 12, "ScanStatus", NULL, NULL},
96 { 13, "GetServerInterfaces", NULL, NULL},
97 { 0, NULL, NULL, NULL }
101 proto_register_butc (void)
103 static hf_register_info hf[] = {
105 { "Operation", "butc.opnum", FT_UINT16, BASE_DEC, NULL, 0x0, "Operation", HFILL }},
108 static gint *ett[] = {
111 proto_butc = proto_register_protocol ("DCE/RPC BUTC", "BUTC", "butc");
112 proto_register_field_array (proto_butc, hf, array_length (hf));
113 proto_register_subtree_array (ett, array_length (ett));
117 proto_reg_handoff_butc (void)
119 /* Register the protocol as dcerpc */
120 dcerpc_init_uuid (proto_butc, ett_butc, &uuid_butc, ver_butc, butc_dissectors, hf_butc_opnum);