📄 rx.h
字号:
/*
* Rx protocol format
*
* $Id: rx.h,v 1.1 1999/11/17 05:45:58 assar Exp $
*/
#ifndef __RX_H
#define __RX_H
#define FS_RX_PORT 7000
#define CB_RX_PORT 7001
#define PROT_RX_PORT 7002
#define VLDB_RX_PORT 7003
#define KAUTH_RX_PORT 7004
#define VOL_RX_PORT 7005
#define ERROR_RX_PORT 7006 /* Doesn't seem to be used */
#define BOS_RX_PORT 7007
#ifndef AFSNAMEMAX
#define AFSNAMEMAX 256
#endif
#ifndef AFSOPAQUEMAX
#define AFSOPAQUEMAX 1024
#endif
#define PRNAMEMAX 64
#define VLNAMEMAX 65
#define KANAMEMAX 64
#define BOSNAMEMAX 256
#define PRSFS_READ 1 /* Read files */
#define PRSFS_WRITE 2 /* Write files */
#define PRSFS_INSERT 4 /* Insert files into a directory */
#define PRSFS_LOOKUP 8 /* Lookup files into a directory */
#define PRSFS_DELETE 16 /* Delete files */
#define PRSFS_LOCK 32 /* Lock files */
#define PRSFS_ADMINISTER 64 /* Change ACL's */
#ifdef OLD_RX_PRINTER
struct rx_header {
u_int32_t epoch;
u_int32_t cid;
u_int32_t callNumber;
u_int32_t seq;
u_int32_t serial;
u_char type;
#define RX_PACKET_TYPE_DATA 1
#define RX_PACKET_TYPE_ACK 2
#define RX_PACKET_TYPE_BUSY 3
#define RX_PACKET_TYPE_ABORT 4
#define RX_PACKET_TYPE_ACKALL 5
#define RX_PACKET_TYPE_CHALLENGE 6
#define RX_PACKET_TYPE_RESPONSE 7
#define RX_PACKET_TYPE_DEBUG 8
#define RX_PACKET_TYPE_PARAMS 9
#define RX_PACKET_TYPE_VERSION 13
u_char flags;
#define RX_CLIENT_INITIATED 1
#define RX_REQUEST_ACK 2
#define RX_LAST_PACKET 4
#define RX_MORE_PACKETS 8
#define RX_FREE_PACKET 16
u_char userStatus;
u_char securityIndex;
u_short spare; /* How clever: even though the AFS */
u_short serviceId; /* header files indicate that the */
}; /* serviceId is first, it's really */
/* encoded _after_ the spare field */
#endif
#define NUM_RX_FLAGS 5
/* $Header: /afs/stacken.kth.se/src/SourceRepository/tcpdump/rx.h,v 1.2 1998/07/19 18:04:44 mattiasa Exp $ */
/*
****************************************************************************
* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
* *
* Permission to use, copy, modify, and distribute this software and its *
* documentation for any purpose and without fee is hereby granted, *
* provided that the above copyright notice appear in all copies and *
* that both that copyright notice and this permission notice appear in *
* supporting documentation, and that the name of IBM not be used in *
* advertising or publicity pertaining to distribution of the software *
* without specific, written prior permission. *
* *
* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
****************************************************************************
*/
/* This is the address of the data portion of the packet. Any encryption
* headers will be at this address, the actual data, for a data packet, will
* start at this address + the connection's security header size.
*/
#define rx_DataOf(packet) ((char *) (packet)->wire.data)
#define rx_GetDataSize(packet) ((packet)->length)
#define rx_SetDataSize(packet, size) ((packet)->length = (size))
/* These macros used in conjunction with reuse of packet header spare as a
* packet cksum for rxkad security module.
*/
#define rx_GetPacketCksum(packet) ((packet)->header.spare)
#define rx_SetPacketCksum(packet, cksum) ((packet)->header.spare = (cksum))
/* The offset of the actual user's data in the packet, skipping any
* security header
*/
#define rx_UserDataOf(conn, packet) (((char*) (packet)->wire.data) + (conn)->securityHeaderSize)
/* This is the maximum size data packet that can be sent on this
* connection, accounting for security module-specific overheads.
*/
#define rx_MaxUserDataSize(conn) ((conn)->peer->packetSize - RX_HEADER_SIZE - \
(conn)->securityHeaderSize - (conn)->securityMaxTrailerSize)
struct rx_securityObjectStats {
char type; /* 0:unk 1:null,2:vab 3:kad */
char level;
char sparec[10]; /* force correct alignment */
int32_t flags; /* 1=>unalloc, 2=>auth, 4=>expired */
u_int32_t expires;
u_int32_t packetsReceived;
u_int32_t packetsSent;
u_int32_t bytesReceived;
u_int32_t bytesSent;
short spares[4];
int32_t sparel[8];
};
/* Bottom n-bits of the Call Identifier give the call number
*/
#define RX_MAXCALLS 4 /* Power of 2; max async calls per connection */
#define RX_CIDSHIFT 2 /* Log2(RX_MAXCALLS) */
#define RX_CHANNELMASK (RX_MAXCALLS-1)
#define RX_CIDMASK (~RX_CHANNELMASK)
#ifndef OLD_RX_PRINTER
/* The rx part of the header of a packet, in host form
*/
struct rx_header {
u_int32_t epoch; /* Start time of client process */
u_int32_t cid; /* Connection id (defined by client) */
u_int32_t callNumber; /* Current call number */
u_int32_t seq; /* Sequence number of this packet, within this call */
u_int32_t serial; /* Serial number of this packet: a new serial
* number is stamped on each packet sent out */
u_char type; /* RX packet type */
u_char flags; /* Flags, defined below */
u_char userStatus; /* User defined status information, returned/set
* by macros rx_Get/SetLocal/RemoteStatus */
u_char securityIndex; /* Which service-defined security method to use */
u_short serviceId; /* The id of the server-provided service that
* this packet is directed to */
/* This spare is now used for packet header checkksum. see
* rxi_ReceiveDataPacket and packet cksum macros above for details.
*/
u_short spare;
};
#endif
/* Flags for rx_header flags field
*/
#define RX_CLIENT_INITIATED 1 /* Packet is sent/received from client side of call */
#define RX_REQUEST_ACK 2 /* Peer requests acknowledgement */
#define RX_LAST_PACKET 4 /* This is the last packet from this side of the call */
#define RX_MORE_PACKETS 8 /* There are more packets following
* this, i.e. the next sequence number
* seen by the receiver should be greater
* than this one, rather than a retransmission
* of an earlier sequence number */
/* The following flags are preset per packet, i.e. they don't change on
* retran smission of the packet
*/
#define RX_PRESET_FLAGS (RX_CLIENT_INITIATED | RX_LAST_PACKET)
#define RX_FLAGS { "....", "C...", ".A..", "CA..", "..L.", "C.L.", ".AL.", \
"CAL.", "...M", "C..M", ".A.M", "CA.M", "..LM", "C.LM", \
".ALM", "CALM" }
#define RX_IPUDP_SIZE 28
/* to use these larger packet sizes, we probably should revise the
* packet struct so that the data buffer isn't statically defined in
* size, but the max MTU that this system can support is determined at
* startup, and the packet structures all use that instead of (eg)
* 4352, of which 3/4 would be wasted 98% of the time. So all these
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -