1190207Srpaulo/* @(#) $Header: /tcpdump/master/tcpdump/rpc_msg.h,v 1.2 2005-04-27 21:43:48 guy Exp $ (LBL) */
2146773Ssam/*
3146773Ssam * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4146773Ssam * unrestricted use provided that this legend is included on all tape
5146773Ssam * media and as a part of the software program in whole or part.  Users
6146773Ssam * may copy or modify Sun RPC without charge, but are not authorized
7146773Ssam * to license or distribute it to anyone else except as part of a product or
8146773Ssam * program developed by the user.
9146773Ssam *
10146773Ssam * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
11146773Ssam * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
12146773Ssam * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13146773Ssam *
14146773Ssam * Sun RPC is provided with no support and without any obligation on the
15146773Ssam * part of Sun Microsystems, Inc. to assist in its use, correction,
16146773Ssam * modification or enhancement.
17146773Ssam *
18146773Ssam * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
19146773Ssam * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
20146773Ssam * OR ANY PART THEREOF.
21146773Ssam *
22146773Ssam * In no event will Sun Microsystems, Inc. be liable for any lost revenue
23146773Ssam * or profits or other special, indirect and consequential damages, even if
24146773Ssam * Sun has been advised of the possibility of such damages.
25146773Ssam *
26146773Ssam * Sun Microsystems, Inc.
27146773Ssam * 2550 Garcia Avenue
28146773Ssam * Mountain View, California  94043
29146773Ssam *
30146773Ssam *	from: @(#)rpc_msg.h 1.7 86/07/16 SMI
31146773Ssam *	from: @(#)rpc_msg.h	2.1 88/07/29 4.0 RPCSRC
32146773Ssam * $FreeBSD$
33190207Srpaulo * FreeBSD: src/include/rpc/rpc_msg.h,v 1.11.2.1 1999/08/29 14:39:07 peter Exp
34146773Ssam */
35146773Ssam
36146773Ssam/*
37146773Ssam * rpc_msg.h
38146773Ssam * rpc message definition
39146773Ssam *
40146773Ssam * Copyright (C) 1984, Sun Microsystems, Inc.
41146773Ssam */
42146773Ssam
43146773Ssam#define SUNRPC_MSG_VERSION	((u_int32_t) 2)
44146773Ssam
45146773Ssam/*
46146773Ssam * Bottom up definition of an rpc message.
47146773Ssam * NOTE: call and reply use the same overall stuct but
48146773Ssam * different parts of unions within it.
49146773Ssam */
50146773Ssam
51146773Ssamenum sunrpc_msg_type {
52146773Ssam	SUNRPC_CALL=0,
53146773Ssam	SUNRPC_REPLY=1
54146773Ssam};
55146773Ssam
56146773Ssamenum sunrpc_reply_stat {
57146773Ssam	SUNRPC_MSG_ACCEPTED=0,
58146773Ssam	SUNRPC_MSG_DENIED=1
59146773Ssam};
60146773Ssam
61146773Ssamenum sunrpc_accept_stat {
62146773Ssam	SUNRPC_SUCCESS=0,
63146773Ssam	SUNRPC_PROG_UNAVAIL=1,
64146773Ssam	SUNRPC_PROG_MISMATCH=2,
65146773Ssam	SUNRPC_PROC_UNAVAIL=3,
66146773Ssam	SUNRPC_GARBAGE_ARGS=4,
67146773Ssam	SUNRPC_SYSTEM_ERR=5
68146773Ssam};
69146773Ssam
70146773Ssamenum sunrpc_reject_stat {
71146773Ssam	SUNRPC_RPC_MISMATCH=0,
72146773Ssam	SUNRPC_AUTH_ERROR=1
73146773Ssam};
74146773Ssam
75146773Ssam/*
76146773Ssam * Reply part of an rpc exchange
77146773Ssam */
78146773Ssam
79146773Ssam/*
80146773Ssam * Reply to an rpc request that was rejected by the server.
81146773Ssam */
82146773Ssamstruct sunrpc_rejected_reply {
83146773Ssam	u_int32_t		 rj_stat;	/* enum reject_stat */
84146773Ssam	union {
85146773Ssam		struct {
86146773Ssam			u_int32_t low;
87146773Ssam			u_int32_t high;
88146773Ssam		} RJ_versions;
89146773Ssam		u_int32_t RJ_why;  /* enum auth_stat - why authentication did not work */
90146773Ssam	} ru;
91146773Ssam#define	rj_vers	ru.RJ_versions
92146773Ssam#define	rj_why	ru.RJ_why
93146773Ssam};
94146773Ssam
95146773Ssam/*
96146773Ssam * Body of a reply to an rpc request.
97146773Ssam */
98146773Ssamstruct sunrpc_reply_body {
99146773Ssam	u_int32_t	rp_stat;		/* enum reply_stat */
100146773Ssam	struct sunrpc_rejected_reply rp_reject;	/* if rejected */
101146773Ssam};
102146773Ssam
103146773Ssam/*
104146773Ssam * Body of an rpc request call.
105146773Ssam */
106146773Ssamstruct sunrpc_call_body {
107146773Ssam	u_int32_t cb_rpcvers;	/* must be equal to two */
108146773Ssam	u_int32_t cb_prog;
109146773Ssam	u_int32_t cb_vers;
110146773Ssam	u_int32_t cb_proc;
111146773Ssam	struct sunrpc_opaque_auth cb_cred;
112146773Ssam	/* followed by opaque verifier */
113146773Ssam};
114146773Ssam
115146773Ssam/*
116146773Ssam * The rpc message
117146773Ssam */
118146773Ssamstruct sunrpc_msg {
119146773Ssam	u_int32_t		rm_xid;
120146773Ssam	u_int32_t		rm_direction;	/* enum msg_type */
121146773Ssam	union {
122146773Ssam		struct sunrpc_call_body RM_cmb;
123146773Ssam		struct sunrpc_reply_body RM_rmb;
124146773Ssam	} ru;
125146773Ssam#define	rm_call		ru.RM_cmb
126146773Ssam#define	rm_reply	ru.RM_rmb
127146773Ssam};
128146773Ssam#define	acpted_rply	ru.RM_rmb.ru.RP_ar
129146773Ssam#define	rjcted_rply	ru.RM_rmb.ru.RP_dr
130