The CRC is at the end of the frame, not at the end of the captured data
[obnox/wireshark/wip.git] / packet-rpc.h
1 /* packet-rpc.h (c) 1999 Uwe Girlich */
2 /* $Id: packet-rpc.h,v 1.12 2000/01/22 05:49:08 guy Exp $ */
3
4 #ifndef __PACKET_RPC_H__
5 #define __PACKET_RPC_H__
6
7 #include <glib.h>
8 #include "packet.h"
9 #include "conversation.h"
10
11 #define EXTRACT_UINT(p,o)    pntohl(&p[o])
12
13 #define RPC_CALL 0
14 #define RPC_REPLY 1
15
16 #define AUTH_NULL 0
17 #define AUTH_UNIX 1
18 #define AUTH_SHORT 2
19 #define AUTH_DES 3
20
21 #define MSG_ACCEPTED 0
22 #define MSG_DENIED 1
23
24 #define AUTH_NULL 0
25 #define AUTH_UNIX 1
26 #define AUTH_SHORT 2
27 #define AUTH_DES 3
28
29 #define SUCCESS 0
30 #define PROG_UNAVAIL 1
31 #define PROG_MISMATCH 2
32 #define PROC_UNAVAIL 3
33 #define GARBAGE_ARGS 4
34
35 #define RPC_MISMATCH 0
36 #define AUTH_ERROR 1
37
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
43
44 typedef int (dissect_function_t)(const u_char* pd, int offset, frame_data* fd, proto_tree* tree);
45
46 typedef struct _vsff {
47         guint32 value;
48         gchar   *strptr;
49         dissect_function_t *dissect_call;
50         dissect_function_t *dissect_reply;
51 } vsff;
52
53 typedef struct _rpc_proc_info_key {
54         guint32 prog;
55         guint32 vers;
56         guint32 proc;
57 } rpc_proc_info_key;
58
59 typedef struct _rpc_proc_info_value {
60         gchar           *name;
61         dissect_function_t      *dissect_call;
62         dissect_function_t      *dissect_reply;
63 } rpc_proc_info_value;
64
65 typedef struct _rpc_prog_info_key {
66         guint32 prog;
67 } rpc_prog_info_key;
68
69 typedef struct _rpc_prog_info_value {
70         int proto;
71         int ett;
72         char* progname;
73 } rpc_prog_info_value;
74
75 typedef struct _rpc_call_info {
76         guint32 xid;
77         conversation_t *conversation;
78         guint32 replies;
79         guint32 prog;
80         guint32 vers;
81         guint32 proc;
82         rpc_proc_info_value*    proc_info;
83 } rpc_call_info;
84
85 #define RPC_CALL_TABLE_LENGTH 1000
86
87 extern const value_string rpc_auth_flavor[];
88
89 extern void rpc_call_insert(rpc_call_info *call);
90 extern rpc_call_info* rpc_call_lookup(rpc_call_info *call);
91
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);
95
96 extern void init_dissect_rpc();
97 extern void cleanup_dissect_rpc();
98
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);
110
111
112 #endif /* packet-rpc.h */
113