3 * $Id: packet-rpc.h,v 1.32 2002/01/21 07:36:41 guy Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
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.
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.
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.
27 #ifndef __PACKET_RPC_H__
28 #define __PACKET_RPC_H__
31 #include <epan/packet.h>
32 #include <epan/conversation.h>
34 #define EXTRACT_UINT(p,o) pntohl(&p[o])
45 #define MSG_ACCEPTED 0
49 #define PROG_UNAVAIL 1
50 #define PROG_MISMATCH 2
51 #define PROC_UNAVAIL 3
52 #define GARBAGE_ARGS 4
54 #define RPC_MISMATCH 0
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
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
70 #define RPCSEC_GSS_SVC_NONE 1
71 #define RPCSEC_GSS_SVC_INTEGRITY 2
72 #define RPCSEC_GSS_SVC_PRIVACY 3
74 #define AUTHDES_NAMEKIND_FULLNAME 0
75 #define AUTHDES_NAMEKIND_NICKNAME 1
77 extern value_string rpc_authgss_svc[];
79 FLAVOR_UNKNOWN, /* authentication flavor unknown */
80 FLAVOR_NOT_GSSAPI, /* flavor isn't GSSAPI */
81 FLAVOR_GSSAPI_NO_INFO, /* flavor is GSSAPI, procedure & service unknown */
82 FLAVOR_GSSAPI /* flavor is GSSAPI, procedure & service known */
85 typedef struct _rpc_call_info_value {
86 guint32 req_num; /* frame number of first request seen */
87 guint32 rep_num; /* frame number of first reply seen */
95 struct _rpc_proc_info_value* proc_info;
96 gboolean request; /* Is this a request or not ?*/
98 } rpc_call_info_value;
101 typedef int (old_dissect_function_t)(const u_char* pd, int offset, frame_data* fd, proto_tree* tree);
102 typedef int (dissect_function_t)(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* tree);
104 typedef struct _old_vsff {
107 old_dissect_function_t *dissect_call;
108 old_dissect_function_t *dissect_reply;
111 typedef struct _vsff {
114 dissect_function_t *dissect_call;
115 dissect_function_t *dissect_reply;
118 extern const value_string rpc_auth_flavor[];
120 extern void old_rpc_init_proc_table(guint prog, guint vers, const old_vsff *proc_table);
121 extern void rpc_init_proc_table(guint prog, guint vers, const vsff *proc_table);
122 extern void rpc_init_prog(int proto, guint32 prog, int ett);
123 extern char *rpc_prog_name(guint32 prog);
124 extern char *rpc_proc_name(guint32 prog, guint32 vers, guint32 proc);
126 extern unsigned int rpc_roundup(unsigned int a);
127 extern int dissect_rpc_bool(tvbuff_t *tvb, packet_info *pinfo,
128 proto_tree *tree, int hfindex, int offset);
129 extern int dissect_rpc_string(tvbuff_t *tvb, packet_info *pinfo,
130 proto_tree *tree, int hfindex, int offset, char **string_buffer_ret);
131 extern int dissect_rpc_data(tvbuff_t *tvb, packet_info *pinfo,
132 proto_tree *tree, int hfindex, int offset);
133 extern int dissect_rpc_list(tvbuff_t *tvb, packet_info *pinfo,
134 proto_tree *tree, int offset, dissect_function_t *rpc_list_dissector);
135 extern int dissect_rpc_array(tvbuff_t *tvb, packet_info *pinfo,
136 proto_tree *tree, int offset, dissect_function_t *rpc_array_dissector,
138 extern int dissect_rpc_uint32(tvbuff_t *tvb, packet_info *pinfo,
139 proto_tree *tree, int hfindex, int offset);
140 extern int dissect_rpc_uint64(tvbuff_t *tvb, packet_info *pinfo,
141 proto_tree *tree, int hfindex, int offset);
143 extern int dissect_rpc_indir_call(tvbuff_t *tvb, packet_info *pinfo,
144 proto_tree *tree, int offset, int args_id, guint32 prog, guint32 vers,
146 extern int dissect_rpc_indir_reply(tvbuff_t *tvb, packet_info *pinfo,
147 proto_tree *tree, int offset, int result_id, int prog_id, int vers_id,
150 #endif /* packet-rpc.h */