

Preliminary message formats for SRX (send right transfer protocol):


RR -- holder of receive right
NSR -- new holder of send right
OSR -- original holder of send right

The RPC protocol distinguishes requests from replies implicitly.
The state of a protocol's use of the RPC determines whether an
incoming message is a request or reply, hence there is no need
for separate type markers.

The only reply type expected is "success".  Provision is made for
"port unknown" which might be legitimate in some cases.  Other failure
types will cause deletion of the right; they indicate serious internal
failure.

Message formats by type:

SEND_RIGHT_LOCK (sent by OSR to holder of the receive right (RR))
    request:
	network port ID
    reply:
	reply_code

SEND_UNLOCK_NO_TRANSFER: (OSR to RR)
    request:
	network port ID
    reply:
	reply_code

SEND_UNLOCK_WITH_TRANSFER: (OSR to RR)
    request:
	network port ID
	NSR host, bootId
    reply:
	reply_code

NEW_SEND_RIGHT: (sent by OSR to NSR)
    request:
	network port ID
	msgId -- ID of the message which will contain the right
	RR host, bootId
	OSR host, bootId
			
    reply:
	reply code;


Composite Message Type:  
	request:
		msg type
		OSR host, BootId
		NSR host, BootId
		RR host, BootId
		network port information
	reply:
		msg type
		reply code (success or failure)


typedef struct {
    u_char	type;
    u_char	unused[3];
    mnetport	port;		
    IPhost	nsrHost;	
    BootId	osrBid;
    BootId	nsrBid;    
    BootId	rrBid;
    MsgId	msgId;
} SrxReqMsg;
  

typedef struct {
    u_char	type;
    u_char	replyCode;
    u_char	unused[2];
} SrxRepMsg;


/* 
 * request types
 */
#define SRX_LOCK			1
#define SRX_UNLOCK_NO_TRANSFER		2
#define SRX_UNLOCK_WITH_TRANSFER	3
#define SRX_TRANSFER			4

/* 
 * reply codes
 */
#define SRX_SUCCESS			1
#define SRX_FAILURE_PORT_UNKNOWN	2
#define SRX_FAILURE_PORT_DUPLICATE	3
#define SRX_AUTHENTICATION_FAILURE	4


Preliminary message formats for RRX (receive right transfer protocol):

RR -- holder of receive right
NSR -- new holder of send right
SR's -- holders of send rights

message formats by msg type:

RECEIVE_RIGHT_LOCK: (sent from ORR to SR's and NRR)
    request:
	network port ID
    reply:
	reply code

UNLOCK_SEND_RIGHT: (sent from ORR to SR's)
    request:
	network port ID
	NRR host, BootId
    reply:
	reply code

NEW_RECEIVE_RIGHT: (sent from ORR to NRR)
   request:
	network port ID
	network port info
	list of senders, BootId's
	msgId -- ID of the message which will transfer the right
   reply:
	reply code

typedef struct {
    u_char	type;
    u_char	unused[3];
    mnetport	port;		
    IPhost	nrrHost;	
    BootId	nrrBid;
} SrxReqMsg;
  

/* 
 * SrxTransferMsg follows is second part of header if 
 * type == RRX_TRANSFER
 */
typedef struct {
    MsgId	msgId;
    int		numSenders;
    struct {
	IPhost	h;
	BootId	bid;
    } senders[numSenders];
} SrxTransferMsg;	/* variable length header */


typedef struct {
    u_char	type;
    u_char	replyCode;
    u_char	unused[2];
} SrxRepMsg;


/* 
 * request types
 */
#define RRX_LOCK_REQUEST	1
#define RRX_UNLOCK_REQUEST	2
#define RRX_TRANSFER		3

/* 
 * reply codes
 */
#define RRX_SUCCESS			1
#define RRX_FAILURE_PORT_UNKNOWN	2
#define RRX_FAILURE_PORT_DUPLICATE	3
#define RRX_AUTHENTICATION_FAILURE	4
