1 /* packet-rpc.h (c) 1999 Uwe Girlich */
2 /* $Id: packet-rpc.h,v 1.12 2000/01/22 05:49:08 guy Exp $ */
4 #ifndef __PACKET_RPC_H__
5 #define __PACKET_RPC_H__
9 #include "conversation.h"
11 #define EXTRACT_UINT(p,o) pntohl(&p[o])
21 #define MSG_ACCEPTED 0
30 #define PROG_UNAVAIL 1
31 #define PROG_MISMATCH 2
32 #define PROC_UNAVAIL 3
33 #define GARBAGE_ARGS 4
35 #define RPC_MISMATCH 0
38 #define AUTH_BADCRED 1
39 #define AUTH_REJECTEDCRED 2
40 #define AUTH_BADVERF 3
41 #define AUTH_REJECTEDVERF 4
42 #define AUTH_TOOWEAK 5
44 typedef int (dissect_function_t)(const u_char* pd, int offset, frame_data* fd, proto_tree* tree);
46 typedef struct _vsff {
49 dissect_function_t *dissect_call;
50 dissect_function_t *dissect_reply;
53 typedef struct _rpc_proc_info_key {
59 typedef struct _rpc_proc_info_value {
61 dissect_function_t *dissect_call;
62 dissect_function_t *dissect_reply;
63 } rpc_proc_info_value;
65 typedef struct _rpc_prog_info_key {
69 typedef struct _rpc_prog_info_value {
73 } rpc_prog_info_value;
75 typedef struct _rpc_call_info {
77 conversation_t *conversation;
82 rpc_proc_info_value* proc_info;
85 #define RPC_CALL_TABLE_LENGTH 1000
87 extern const value_string rpc_auth_flavor[];
89 extern void rpc_call_insert(rpc_call_info *call);
90 extern rpc_call_info* rpc_call_lookup(rpc_call_info *call);
92 extern void rpc_init_proc_table(guint prog, guint vers, const vsff *proc_table);
93 extern void rpc_init_prog(int proto, guint32 prog, int ett);
94 extern char *rpc_prog_name(guint32 prog);
96 extern void init_dissect_rpc();
97 extern void cleanup_dissect_rpc();
99 extern unsigned int rpc_roundup(unsigned int a);
100 extern int dissect_rpc_bool(const u_char *pd, int offset, frame_data *fd,
101 proto_tree *tree, int hfindex);
102 extern int dissect_rpc_string(const u_char *pd, int offset, frame_data *fd,
103 proto_tree *tree, int hfindex, char **string_buffer_ret);
104 extern int dissect_rpc_data(const u_char *pd, int offset, frame_data *fd,
105 proto_tree *tree, int hfindex);
106 extern int dissect_rpc_uint32(const u_char *pd, int offset, frame_data *fd,
107 proto_tree *tree, char* name, char* type);
108 extern int dissect_rpc_uint64(const u_char *pd, int offset, frame_data *fd,
109 proto_tree *tree, char* name, char* type);
112 #endif /* packet-rpc.h */