rx.h revision 75115
11573Srgrimes/*
21573Srgrimes * Rx protocol format
31573Srgrimes *
41573Srgrimes * $Id: rx.h,v 1.3 2000/10/03 02:55:02 itojun Exp $
51573Srgrimes */
61573Srgrimes
71573Srgrimes#define FS_RX_PORT	7000
81573Srgrimes#define CB_RX_PORT	7001
91573Srgrimes#define PROT_RX_PORT	7002
101573Srgrimes#define VLDB_RX_PORT	7003
111573Srgrimes#define KAUTH_RX_PORT	7004
121573Srgrimes#define VOL_RX_PORT	7005
131573Srgrimes#define ERROR_RX_PORT	7006		/* Doesn't seem to be used */
141573Srgrimes#define BOS_RX_PORT	7007
151573Srgrimes
161573Srgrimes#ifndef AFSNAMEMAX
171573Srgrimes#define AFSNAMEMAX 256
181573Srgrimes#endif
191573Srgrimes
201573Srgrimes#ifndef AFSOPAQUEMAX
211573Srgrimes#define AFSOPAQUEMAX 1024
221573Srgrimes#endif
231573Srgrimes
241573Srgrimes#define PRNAMEMAX 64
251573Srgrimes#define VLNAMEMAX 65
261573Srgrimes#define KANAMEMAX 64
271573Srgrimes#define BOSNAMEMAX 256
281573Srgrimes
291573Srgrimes#define	PRSFS_READ		1 /* Read files */
301573Srgrimes#define	PRSFS_WRITE		2 /* Write files */
311573Srgrimes#define	PRSFS_INSERT		4 /* Insert files into a directory */
321573Srgrimes#define	PRSFS_LOOKUP		8 /* Lookup files into a directory */
331573Srgrimes#define	PRSFS_DELETE		16 /* Delete files */
341573Srgrimes#define	PRSFS_LOCK		32 /* Lock files */
351573Srgrimes#define	PRSFS_ADMINISTER	64 /* Change ACL's */
361573Srgrimes
371573Srgrimesstruct rx_header {
381573Srgrimes	u_int32_t epoch;
391573Srgrimes	u_int32_t cid;
401573Srgrimes	u_int32_t callNumber;
411573Srgrimes	u_int32_t seq;
421573Srgrimes	u_int32_t serial;
431573Srgrimes	u_int8_t type;
441573Srgrimes#define RX_PACKET_TYPE_DATA		1
451573Srgrimes#define RX_PACKET_TYPE_ACK		2
461573Srgrimes#define RX_PACKET_TYPE_BUSY		3
471573Srgrimes#define RX_PACKET_TYPE_ABORT		4
481573Srgrimes#define RX_PACKET_TYPE_ACKALL		5
491573Srgrimes#define RX_PACKET_TYPE_CHALLENGE	6
501573Srgrimes#define RX_PACKET_TYPE_RESPONSE		7
511573Srgrimes#define RX_PACKET_TYPE_DEBUG		8
521573Srgrimes#define RX_PACKET_TYPE_PARAMS		9
531573Srgrimes#define RX_PACKET_TYPE_VERSION		13
541573Srgrimes	u_int8_t flags;
551573Srgrimes#define RX_CLIENT_INITIATED	1
561573Srgrimes#define RX_REQUEST_ACK		2
57#define RX_LAST_PACKET		4
58#define RX_MORE_PACKETS		8
59#define RX_FREE_PACKET		16
60	u_int8_t userStatus;
61	u_int8_t securityIndex;
62	u_int16_t spare;		/* How clever: even though the AFS */
63	u_int16_t serviceId;		/* header files indicate that the */
64};					/* serviceId is first, it's really */
65					/* encoded _after_ the spare field */
66					/* I wasted a day figuring that out! */
67
68#define NUM_RX_FLAGS 5
69
70#define RX_MAXACKS 255
71
72struct rx_ackPacket {
73	u_int16_t bufferSpace;		/* Number of packet buffers available */
74	u_int16_t maxSkew;		/* Max diff between ack'd packet and */
75					/* highest packet received */
76	u_int32_t firstPacket;		/* The first packet in ack list */
77	u_int32_t previousPacket;	/* Previous packet recv'd (obsolete) */
78	u_int32_t serial;		/* # of packet that prompted the ack */
79	u_int8_t reason;		/* Reason for acknowledgement */
80	u_int8_t nAcks;			/* Number of acknowledgements */
81	u_int8_t acks[RX_MAXACKS];	/* Up to RX_MAXACKS acknowledgements */
82};
83
84/*
85 * Values for the acks array
86 */
87
88#define RX_ACK_TYPE_NACK	0	/* Don't have this packet */
89#define RX_ACK_TYPE_ACK		1	/* I have this packet */
90