Remove more "CHECK_DISPLAY_AS_DATA()" calls and "pinfo->current_proto ="
[obnox/wireshark/wip.git] / packet-rpc.h
1 /* packet-rpc.h
2  *
3  * $Id: packet-rpc.h,v 1.22 2001/01/22 08:03:46 guy Exp $
4  *
5  * (c) 1999 Uwe Girlich
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@zing.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * 
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  * 
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  * 
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  */
26
27 #ifndef __PACKET_RPC_H__
28 #define __PACKET_RPC_H__
29
30 #include <glib.h>
31 #include "packet.h"
32 #include "conversation.h"
33
34 #define EXTRACT_UINT(p,o)    pntohl(&p[o])
35
36 #define RPC_CALL 0
37 #define RPC_REPLY 1
38
39 #define AUTH_NULL 0
40 #define AUTH_UNIX 1
41 #define AUTH_SHORT 2
42 #define AUTH_DES 3
43 #define RPCSEC_GSS 6
44
45 #define MSG_ACCEPTED 0
46 #define MSG_DENIED 1
47
48 #define SUCCESS 0
49 #define PROG_UNAVAIL 1
50 #define PROG_MISMATCH 2
51 #define PROC_UNAVAIL 3
52 #define GARBAGE_ARGS 4
53
54 #define RPC_MISMATCH 0
55 #define AUTH_ERROR 1
56
57 #define AUTH_BADCRED 1
58 #define AUTH_REJECTEDCRED 2
59 #define AUTH_BADVERF 3
60 #define AUTH_REJECTEDVERF 4
61 #define AUTH_TOOWEAK 5
62 #define RPCSEC_GSSCREDPROB 13
63 #define RPCSEC_GSSCTXPROB 14
64
65 #define RPCSEC_GSS_DATA 0
66 #define RPCSEC_GSS_INIT 1
67 #define RPCSEC_GSS_CONTINUE_INIT 2
68 #define RPCSEC_GSS_DESTROY 3
69
70 #define RPCSEC_GSS_SVC_NONE 1
71 #define RPCSEC_GSS_SVC_INTEGRITY 2
72 #define RPCSEC_GSS_SVC_PRIVACY 3
73
74 typedef int (dissect_function_t)(const u_char* pd, int offset, frame_data* fd, proto_tree* tree);
75
76 typedef struct _vsff {
77         guint32 value;
78         gchar   *strptr;
79         dissect_function_t *dissect_call;
80         dissect_function_t *dissect_reply;
81 } vsff;
82
83 typedef struct _rpc_proc_info_key {
84         guint32 prog;
85         guint32 vers;
86         guint32 proc;
87 } rpc_proc_info_key;
88
89 typedef struct _rpc_proc_info_value {
90         gchar           *name;
91         dissect_function_t      *dissect_call;
92         dissect_function_t      *dissect_reply;
93 } rpc_proc_info_value;
94
95 typedef struct _rpc_prog_info_key {
96         guint32 prog;
97 } rpc_prog_info_key;
98
99 typedef struct _rpc_prog_info_value {
100         int proto;
101         int ett;
102         char* progname;
103 } rpc_prog_info_value;
104
105 extern const value_string rpc_auth_flavor[];
106
107 extern void rpc_init_proc_table(guint prog, guint vers, const vsff *proc_table);
108 extern void rpc_init_prog(int proto, guint32 prog, int ett);
109 extern char *rpc_prog_name(guint32 prog);
110
111 extern unsigned int rpc_roundup(unsigned int a);
112 extern int dissect_rpc_bool(const u_char *pd, int offset, frame_data *fd,
113         proto_tree *tree, int hfindex);
114 extern int dissect_rpc_bool_tvb(tvbuff_t *tvb, packet_info *pinfo,
115         proto_tree *tree, int hfindex, int offset);
116 extern int dissect_rpc_string(const u_char *pd, int offset, frame_data *fd,
117         proto_tree *tree, int hfindex, char **string_buffer_ret);
118 extern int dissect_rpc_string_tvb(tvbuff_t *tvb, packet_info *pinfo,
119         proto_tree *tree, int hfindex, int offset, char **string_buffer_ret);
120 extern int dissect_rpc_data(const u_char *pd, int offset, frame_data *fd,
121         proto_tree *tree, int hfindex);
122 extern int dissect_rpc_data_tvb(tvbuff_t *tvb, packet_info *pinfo,
123         proto_tree *tree, int hfindex, int offset);
124 extern int dissect_rpc_list(const u_char *pd, int offset, frame_data *fd,
125         proto_tree *tree, dissect_function_t *rpc_list_dissector);
126 extern int dissect_rpc_uint32(const u_char *pd, int offset, frame_data *fd,
127         proto_tree *tree, char* name);
128 extern int dissect_rpc_uint32_tvb(tvbuff_t *tvb, packet_info *pinfo,
129         proto_tree *tree, int hfindex, int offset);
130 extern int dissect_rpc_uint64(const u_char *pd, int offset, frame_data *fd,
131         proto_tree *tree, char* name);
132 extern int dissect_rpc_uint64_tvb(tvbuff_t *tvb, packet_info *pinfo,
133         proto_tree *tree, int hfindex, int offset);
134
135
136 #endif /* packet-rpc.h */
137