2000-08-11 13:37:21 +00:00
|
|
|
/* packet-rpc.h
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2000-08-11 13:37:21 +00:00
|
|
|
*
|
|
|
|
* (c) 1999 Uwe Girlich
|
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
2001-05-30 06:01:02 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
2000-08-11 13:37:21 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-08-11 13:37:21 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-08-11 13:37:21 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
1999-10-29 01:11:23 +00:00
|
|
|
|
|
|
|
#ifndef __PACKET_RPC_H__
|
|
|
|
#define __PACKET_RPC_H__
|
|
|
|
|
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/conversation.h>
|
1999-10-29 01:11:23 +00:00
|
|
|
|
|
|
|
#define RPC_CALL 0
|
|
|
|
#define RPC_REPLY 1
|
|
|
|
|
|
|
|
#define AUTH_NULL 0
|
|
|
|
#define AUTH_UNIX 1
|
|
|
|
#define AUTH_SHORT 2
|
|
|
|
#define AUTH_DES 3
|
2000-08-24 22:58:56 +00:00
|
|
|
#define RPCSEC_GSS 6
|
2003-05-02 21:58:23 +00:00
|
|
|
#define AUTH_GSSAPI 300001
|
1999-10-29 01:11:23 +00:00
|
|
|
|
|
|
|
#define MSG_ACCEPTED 0
|
|
|
|
#define MSG_DENIED 1
|
|
|
|
|
|
|
|
#define SUCCESS 0
|
|
|
|
#define PROG_UNAVAIL 1
|
|
|
|
#define PROG_MISMATCH 2
|
|
|
|
#define PROC_UNAVAIL 3
|
|
|
|
#define GARBAGE_ARGS 4
|
2005-05-04 13:09:46 +00:00
|
|
|
#define SYSTEM_ERROR 5
|
1999-10-29 01:11:23 +00:00
|
|
|
|
|
|
|
#define RPC_MISMATCH 0
|
|
|
|
#define AUTH_ERROR 1
|
|
|
|
|
|
|
|
#define AUTH_BADCRED 1
|
|
|
|
#define AUTH_REJECTEDCRED 2
|
|
|
|
#define AUTH_BADVERF 3
|
|
|
|
#define AUTH_REJECTEDVERF 4
|
|
|
|
#define AUTH_TOOWEAK 5
|
2000-08-24 22:58:56 +00:00
|
|
|
#define RPCSEC_GSSCREDPROB 13
|
|
|
|
#define RPCSEC_GSSCTXPROB 14
|
2000-07-17 20:34:00 +00:00
|
|
|
|
2000-08-24 22:58:56 +00:00
|
|
|
#define RPCSEC_GSS_DATA 0
|
|
|
|
#define RPCSEC_GSS_INIT 1
|
|
|
|
#define RPCSEC_GSS_CONTINUE_INIT 2
|
|
|
|
#define RPCSEC_GSS_DESTROY 3
|
2000-07-17 20:34:00 +00:00
|
|
|
|
2003-05-02 21:58:23 +00:00
|
|
|
#define AUTH_GSSAPI_EXIT 0
|
|
|
|
#define AUTH_GSSAPI_INIT 1
|
|
|
|
#define AUTH_GSSAPI_CONTINUE_INIT 2
|
|
|
|
#define AUTH_GSSAPI_MSG 3
|
|
|
|
#define AUTH_GSSAPI_DESTROY 4
|
|
|
|
|
2000-08-24 22:58:56 +00:00
|
|
|
#define RPCSEC_GSS_SVC_NONE 1
|
|
|
|
#define RPCSEC_GSS_SVC_INTEGRITY 2
|
|
|
|
#define RPCSEC_GSS_SVC_PRIVACY 3
|
1999-10-29 01:11:23 +00:00
|
|
|
|
2001-05-25 20:13:04 +00:00
|
|
|
#define AUTHDES_NAMEKIND_FULLNAME 0
|
|
|
|
#define AUTHDES_NAMEKIND_NICKNAME 1
|
|
|
|
|
2001-10-29 20:49:28 +00:00
|
|
|
extern value_string rpc_authgss_svc[];
|
2002-01-12 10:24:47 +00:00
|
|
|
typedef enum {
|
|
|
|
FLAVOR_UNKNOWN, /* authentication flavor unknown */
|
|
|
|
FLAVOR_NOT_GSSAPI, /* flavor isn't GSSAPI */
|
|
|
|
FLAVOR_GSSAPI_NO_INFO, /* flavor is GSSAPI, procedure & service unknown */
|
2003-05-02 21:58:23 +00:00
|
|
|
FLAVOR_GSSAPI, /* flavor is GSSAPI, procedure & service known */
|
|
|
|
FLAVOR_AUTHGSSAPI, /* AUTH_GSSAPI flavor */
|
|
|
|
FLAVOR_AUTHGSSAPI_MSG /* AUTH_GSSAPI flavor, AUTH_GSSAPI message */
|
2002-01-12 10:24:47 +00:00
|
|
|
} flavor_t;
|
|
|
|
|
|
|
|
typedef struct _rpc_call_info_value {
|
|
|
|
guint32 req_num; /* frame number of first request seen */
|
|
|
|
guint32 rep_num; /* frame number of first reply seen */
|
|
|
|
guint32 prog;
|
|
|
|
guint32 vers;
|
|
|
|
guint32 proc;
|
|
|
|
guint32 xid;
|
|
|
|
flavor_t flavor;
|
|
|
|
guint32 gss_proc;
|
|
|
|
guint32 gss_svc;
|
|
|
|
struct _rpc_proc_info_value* proc_info;
|
|
|
|
gboolean request; /* Is this a request or not ?*/
|
|
|
|
nstime_t req_time;
|
2002-05-09 12:10:06 +00:00
|
|
|
void *private_data;
|
2002-01-12 10:24:47 +00:00
|
|
|
} rpc_call_info_value;
|
|
|
|
|
2001-10-29 20:49:28 +00:00
|
|
|
|
2001-01-28 03:39:48 +00:00
|
|
|
typedef int (dissect_function_t)(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* tree);
|
|
|
|
|
1999-10-29 01:11:23 +00:00
|
|
|
typedef struct _vsff {
|
|
|
|
guint32 value;
|
2005-07-28 07:53:38 +00:00
|
|
|
const gchar *strptr;
|
1999-10-29 01:11:23 +00:00
|
|
|
dissect_function_t *dissect_call;
|
|
|
|
dissect_function_t *dissect_reply;
|
|
|
|
} vsff;
|
|
|
|
|
1999-11-19 23:23:41 +00:00
|
|
|
extern const value_string rpc_auth_flavor[];
|
1999-11-19 13:09:56 +00:00
|
|
|
|
2002-10-23 21:17:03 +00:00
|
|
|
extern void rpc_init_proc_table(guint prog, guint vers, const vsff *proc_table,
|
|
|
|
int procedure_hf);
|
1999-10-29 01:11:23 +00:00
|
|
|
extern void rpc_init_prog(int proto, guint32 prog, int ett);
|
2005-07-24 19:01:28 +00:00
|
|
|
extern const char *rpc_prog_name(guint32 prog);
|
2005-07-29 03:49:23 +00:00
|
|
|
extern const char *rpc_proc_name(guint32 prog, guint32 vers, guint32 proc);
|
2003-09-05 10:26:44 +00:00
|
|
|
extern int rpc_prog_hf(guint32 prog, guint32 vers);
|
1999-10-29 01:11:23 +00:00
|
|
|
|
1999-11-15 14:17:20 +00:00
|
|
|
extern unsigned int rpc_roundup(unsigned int a);
|
2002-04-03 13:24:13 +00:00
|
|
|
extern int dissect_rpc_bool(tvbuff_t *tvb,
|
2000-08-08 06:19:52 +00:00
|
|
|
proto_tree *tree, int hfindex, int offset);
|
2002-04-03 13:24:13 +00:00
|
|
|
extern int dissect_rpc_string(tvbuff_t *tvb,
|
2000-08-08 06:19:52 +00:00
|
|
|
proto_tree *tree, int hfindex, int offset, char **string_buffer_ret);
|
2003-05-21 02:48:40 +00:00
|
|
|
int dissect_rpc_opaque_data(tvbuff_t *tvb, int offset,
|
|
|
|
proto_tree *tree,
|
|
|
|
packet_info *pinfo,
|
|
|
|
int hfindex,
|
|
|
|
gboolean fixed_length, guint32 length,
|
|
|
|
gboolean string_data, char **string_buffer_ret,
|
|
|
|
dissect_function_t *dissect_it);
|
2002-04-03 13:24:13 +00:00
|
|
|
extern int dissect_rpc_data(tvbuff_t *tvb,
|
2000-08-08 06:19:52 +00:00
|
|
|
proto_tree *tree, int hfindex, int offset);
|
2002-11-13 21:45:59 +00:00
|
|
|
extern int dissect_rpc_bytes(tvbuff_t *tvb,
|
|
|
|
proto_tree *tree, int hfindex, int offset, guint32 length,
|
|
|
|
gboolean string_data, char **string_buffer_ret);
|
2001-05-30 06:01:02 +00:00
|
|
|
extern int dissect_rpc_list(tvbuff_t *tvb, packet_info *pinfo,
|
2001-01-28 03:39:48 +00:00
|
|
|
proto_tree *tree, int offset, dissect_function_t *rpc_list_dissector);
|
2001-05-30 06:01:02 +00:00
|
|
|
extern int dissect_rpc_array(tvbuff_t *tvb, packet_info *pinfo,
|
2001-05-07 20:36:39 +00:00
|
|
|
proto_tree *tree, int offset, dissect_function_t *rpc_array_dissector,
|
|
|
|
int hfindex);
|
2002-04-03 13:24:13 +00:00
|
|
|
extern int dissect_rpc_uint32(tvbuff_t *tvb,
|
2000-08-08 06:19:52 +00:00
|
|
|
proto_tree *tree, int hfindex, int offset);
|
2002-04-03 13:24:13 +00:00
|
|
|
extern int dissect_rpc_uint64(tvbuff_t *tvb,
|
2000-08-08 06:19:52 +00:00
|
|
|
proto_tree *tree, int hfindex, int offset);
|
1999-10-29 01:11:23 +00:00
|
|
|
|
2001-02-09 06:49:29 +00:00
|
|
|
extern int dissect_rpc_indir_call(tvbuff_t *tvb, packet_info *pinfo,
|
2001-02-09 07:59:00 +00:00
|
|
|
proto_tree *tree, int offset, int args_id, guint32 prog, guint32 vers,
|
|
|
|
guint32 proc);
|
|
|
|
extern int dissect_rpc_indir_reply(tvbuff_t *tvb, packet_info *pinfo,
|
|
|
|
proto_tree *tree, int offset, int result_id, int prog_id, int vers_id,
|
|
|
|
int proc_id);
|
1999-10-29 01:11:23 +00:00
|
|
|
|
2002-09-04 09:40:29 +00:00
|
|
|
|
|
|
|
typedef struct _rpc_prog_info_key {
|
|
|
|
guint32 prog;
|
|
|
|
} rpc_prog_info_key;
|
|
|
|
|
|
|
|
typedef struct _rpc_prog_info_value {
|
2003-11-16 23:17:27 +00:00
|
|
|
protocol_t *proto;
|
|
|
|
int proto_id;
|
2002-09-04 09:40:29 +00:00
|
|
|
int ett;
|
2005-07-24 19:01:28 +00:00
|
|
|
const char* progname;
|
2002-10-23 21:17:03 +00:00
|
|
|
GArray *procedure_hfs;
|
2002-09-04 09:40:29 +00:00
|
|
|
} rpc_prog_info_value;
|
|
|
|
|
2004-05-09 10:03:41 +00:00
|
|
|
/* rpc_progs is also used in tap. With MSVC and a
|
|
|
|
* libethereal.dll, we need a special declaration.
|
|
|
|
*/
|
|
|
|
ETH_VAR_IMPORT GHashTable *rpc_progs;
|
2002-09-04 09:40:29 +00:00
|
|
|
|
|
|
|
typedef struct _rpc_proc_info_key {
|
|
|
|
guint32 prog;
|
|
|
|
guint32 vers;
|
|
|
|
guint32 proc;
|
|
|
|
} rpc_proc_info_key;
|
|
|
|
|
|
|
|
typedef struct _rpc_proc_info_value {
|
2005-07-29 03:49:23 +00:00
|
|
|
const gchar *name;
|
2002-09-04 09:40:29 +00:00
|
|
|
dissect_function_t *dissect_call;
|
|
|
|
dissect_function_t *dissect_reply;
|
|
|
|
} rpc_proc_info_value;
|
|
|
|
|
2004-05-09 10:03:41 +00:00
|
|
|
/* rpc_procs is also used in tap. With MSVC and a
|
|
|
|
* libethereal.dll, we need a special declaration.
|
|
|
|
*/
|
|
|
|
ETH_VAR_IMPORT GHashTable *rpc_procs;
|
2002-09-04 09:40:29 +00:00
|
|
|
|
1999-10-29 01:11:23 +00:00
|
|
|
#endif /* packet-rpc.h */
|
|
|
|
|