some compilers dont like unnamed unions and structs
[obnox/wireshark/wip.git] / epan / dissectors / packet-dcerpc-rras.c
1 /* packet-dcerpc-rras.c
2  * Routines for the rras (Routing and Remote Access service) MSRPC interface 
3  * Copyright 2005 Jean-Baptiste Marchand <jbm@hsc.fr>
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26
27 #ifdef HAVE_CONFIG_H
28 #include "config.h"
29 #endif
30
31 #include <glib.h>
32 #include <epan/packet.h>
33 #include "packet-dcerpc.h"
34 #include "packet-dcerpc-rras.h"
35
36 static int proto_dcerpc_rras = -1;
37
38 static int hf_rras_opnum = 0;
39
40 static gint ett_dcerpc_rras = -1;
41
42 /* 
43  * The rras MSRPC interface is typically reached using the ncacn_np transport
44  * and the \pipe\ROUTER named pipe as endpoint.
45  */
46
47 static e_uuid_t uuid_dcerpc_rras = {
48         0x8f09f000, 0xb7ed, 0x11ce,
49         { 0xbb, 0xd2, 0x00, 0x00, 0x1a, 0x18, 0x1c, 0xad }
50 };
51
52 static guint16 ver_dcerpc_rras = 0; 
53
54
55 static dcerpc_sub_dissector dcerpc_rras_dissectors[] = {
56         { RRAS_ADMIN_SERVER_GETINFO, 
57                 "MprAdminServerGetInfo", NULL, NULL },
58         { RRAS_ADMIN_CONNECTION_ENUM, 
59                 "RasAdminConnectionEnum", NULL, NULL },
60         { RRAS_ADMIN_CONNECTION_GETINFO, 
61                 "RasAdminConnectionGetInfo", NULL, NULL },
62         { RRAS_ADMIN_CONNECTION_CLEARSTATS, 
63                 "RasAdminConnectionClearStats", NULL, NULL },
64         { RRAS_ADMIN_PORT_ENUM, 
65                 "RasAdminPortEnum", NULL, NULL },
66         { RRAS_ADMIN_PORT_GETINFO, 
67                 "RasAdminPortGetInfo", NULL, NULL },
68         { RRAS_ADMIN_PORT_CLEARSTATS, 
69                 "RasAdminPortClearStats", NULL, NULL },
70         { RRAS_ADMIN_PORT_RESET, 
71                 "RasAdminPortReset", NULL, NULL },
72         { RRAS_ADMIN_PORT_DISCONNECT, 
73                 "RasAdminPortDisconnect", NULL, NULL },
74         { RRAS_RI_TRANS_SET_GLOBALINFO, 
75                 "RouterInterfaceTransportSetGlobalInfo", NULL, NULL },
76         { RRAS_RI_TRANS_GET_GLOBALINFO, 
77                 "RouterInterfaceTransportGetGlobalInfo", NULL, NULL },
78         { RRAS_RI_GET_HANDLE, 
79                 "RouterInterfaceGetHandle", NULL, NULL },
80         { RRAS_RI_CREATE, 
81                 "RouterInterfaceCreate", NULL, NULL },
82         { RRAS_RI_GETINFO, 
83                 "RouterInterfaceGetInfo", NULL, NULL },
84         { RRAS_RI_SETINFO, 
85                 "RouterInterfaceSetInfo", NULL, NULL },
86         { RRAS_RI_DELETE, 
87                 "RouterInterfaceDelete", NULL, NULL },
88         { RRAS_TRANS_REMOVE, 
89                 "RouterInterfaceTransportRemove", NULL, NULL },
90         { RRAS_TRANS_ADD, 
91                 "RouterInterfaceTransportAdd", NULL, NULL },
92         { RRAS_TRANS_GETINFO, 
93                 "RouterInterfaceTransportGetInfo", NULL, NULL },
94         { RRAS_TRANS_SETINFO, 
95                 "RouterInterfaceTransportSetInfo", NULL, NULL },
96         { RRAS_RI_ENUM, 
97                 "RouterInterfaceEnum", NULL, NULL },
98         { RRAS_RI_CONNECT, 
99                 "RouterInterfaceConnect", NULL, NULL },
100         { RRAS_RI_DISCONNECT, 
101                 "RouterInterfaceDisconnect", NULL, NULL },
102         { RRAS_RI_UPDATE_ROUTES, 
103                 "RouterInterfaceUpdateRoutes", NULL, NULL },
104         { RRAS_RI_QUERY_UPDATE_RESULT, 
105                 "RouterInterfaceQueryUpdateResult", NULL, NULL },
106         { RRAS_RI_UPDATE_PB_INFO, 
107                 "RouterInterfaceUpdatePhonebookInfo", NULL, NULL },
108         { RRAS_MIB_ENTRY_CREATE, "MIBEntryCreate", NULL, NULL },
109         { RRAS_MIB_ENTRY_DELETE, "MIBEntryDelete", NULL, NULL },
110         { RRAS_MIB_ENTRY_SET, "MIBEntrySet", NULL, NULL },
111         { RRAS_MIB_ENTRY_GET, "MIBEntryGet", NULL, NULL },
112         { RRAS_MIB_GET_FIRST, "MIBEntryGetFirst", NULL, NULL },
113         { RRAS_MIB_GET_NEXT, "MIBEntryGetNext", NULL, NULL },
114         { RRAS_GET_TRAP_INFO, "MIBGetTrapInfo", NULL, NULL },
115         { RRAS_SET_TRAP_INFO, "MIBSetTrapInfo", NULL, NULL },
116         { RRAS_ADMIN_CONNECTION_NOTIFICATION, 
117                 "RasAdminConnectionNotification", NULL, NULL },
118         { RRAS_ADMIN_SEND_USER_MSG, "RasAdminSendUserMessage", NULL, NULL },
119         { RRAS_ROUTER_DEVICE_ENUM, "RouterDeviceEnum", NULL, NULL },
120         { RRAS_RI_TRANSPORT_CREATE, 
121                 "RouterInterfaceTransportCreate", NULL, NULL },
122         { RRAS_RI_DEV_GETINFO, "RouterInterfaceDeviceGetInfo", NULL, NULL },
123         { RRAS_RI_DEV_SETINFO, "RouterInterfaceDeviceSetInfo", NULL, NULL },
124         { RRAS_RI_SET_CRED_EX, "RouterInterfaceSetCredentialsEx", NULL, NULL },
125         { RRAS_RI_GET_CRED_EX, "RouterInterfaceGetCredentialsEx", NULL, NULL },
126         { RRAS_ADMIN_CONNECTION_REM_QUARANT,
127                 "RasAdminConnectionRemoveQuarantine", NULL, NULL },
128         { 0, NULL, NULL,  NULL }
129 };
130
131
132 void
133 proto_register_dcerpc_rras(void)
134 {
135
136         static hf_register_info hf[] = {
137
138                 { &hf_rras_opnum, 
139                   { "Operation", "rras.opnum", FT_UINT16, BASE_DEC,
140                    NULL, 0x0, "Operation", HFILL }},    
141         };
142
143
144         static gint *ett[] = {
145                 &ett_dcerpc_rras,
146         };
147
148
149         proto_dcerpc_rras = proto_register_protocol(
150                 "Microsoft Routing and Remote Access Service", "RRAS", "rras");
151
152         proto_register_field_array(proto_dcerpc_rras, hf, array_length(hf));
153
154         proto_register_subtree_array(ett, array_length(ett));
155
156 }
157
158
159 void
160 proto_reg_handoff_dcerpc_rras(void)
161 {
162         /* register protocol as dcerpc */
163
164         dcerpc_init_uuid(
165                 proto_dcerpc_rras, ett_dcerpc_rras, &uuid_dcerpc_rras,
166                 ver_dcerpc_rras, dcerpc_rras_dissectors, hf_rras_opnum);
167 }