Update Free Software Foundation address.
[metze/wireshark/wip.git] / asn1 / ros / packet-ros-template.h
1 /* packet-ros.h
2  * Routines for ROS packet dissection
3  * Graeme Lunt 2005
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25
26 #ifndef PACKET_ROS_H
27 #define PACKET_ROS_H
28
29 #include "packet-ros-exp.h"
30
31 # include "packet-ses.h"
32
33 /* for use in the SESSION_DATA_STRUCTURE ros_op argument
34    top byte indicates ROS invocation 
35    bottom three bytes indicate operation code */
36
37 # define ROS_OP_MASK    0xff000000
38
39 # define ROS_OP_PDU_MASK  0xf0000000
40 # define ROS_OP_ARGUMENT  0x10000000
41 # define ROS_OP_RESULT  0x20000000
42 # define ROS_OP_ERROR   0x30000000
43 # define ROS_OP_REJECT  0x40000000
44
45 # define ROS_OP_TYPE_MASK 0x0f000000
46 # define ROS_OP_BIND    0x01000000
47 # define ROS_OP_UNBIND  0x02000000
48 # define ROS_OP_INVOKE  0x03000000
49
50 # define ROS_OP_OPCODE_MASK (~ROS_OP_MASK)
51
52 # define op_ros_bind   (-1) /* pseudo operation code for asn2wrs generated binds */
53 # define err_ros_bind  (-1) /* pseudo eror code for asn2wrs generated binds */
54
55 typedef struct _ros_opr_t {
56   gint32 opcode;
57   new_dissector_t arg_pdu;
58   new_dissector_t res_pdu;
59 } ros_opr_t;
60
61 typedef struct _ros_err_t {
62   gint32 errcode;
63   new_dissector_t err_pdu;
64 } ros_err_t;
65
66 typedef struct _ros_info_t {
67   const gchar         *name;
68   int                 *proto;
69   gint                *ett_proto;
70   const value_string  *opr_code_strings;
71   const ros_opr_t     *opr_code_dissectors;
72   const value_string  *err_code_strings;
73   const ros_err_t     *err_code_dissectors;
74 } ros_info_t;
75
76 void register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_rtse);
77 void register_ros_protocol_info(const char *oid, const ros_info_t *rinfo, int proto _U_, const char *name, gboolean uses_rtse);
78 int call_ros_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
79
80 #endif  /* PACKET_ROS_H */