// GrapevineProtocol.decl
// Copyright Xerox Corporation 1981, 1982
// Last modified January 4, 1982  12:32 PM by Taft

// At the moment, this file contains only those definitions having to do
// with R-Server location, authentication, and group membership.

manifest
[
// Echo protocol -- for polling Grapevine servers on socRegServerPolling
ptEchoMe = 1
ptImAnEcho = 2

// Grapevine server sockets
socRegServerEnquiry = 50B
socRegServerSpare = 51B
socRegServerPolling = 52B

// Return codes
rcDone = 0		// operation succeeded
rcNoChange = 1		// enquiry: given stamp was still valid
rcBadOperation = 4	// bad operation number
rcBadProtocol = 5	// protocol violation
rcBadRName = 6		// RName does not exist or has wrong type
rcBadPassword = 7	// what it says
rcWrongServer = 8	// the RName's registry is not in this R-Server
rcAllDown = 9		// remote R-Server was down for ACL enquiry

// RName types
rnGroup = 0		// group of names
rnIndividual = 1	// person or machine
rnNotFound = 2		// the RName does not exist
rnDead = 3		// the RName has been deleted from the data base
]

structure ReturnCode:  // Returned from all R-Server operations
   [ code byte; type byte ]

manifest  // R-Server operation codes
[
// Operations		arguments		results

opNoOp = 0	//	none			none

opReadMembers = 2  //	RName, stamp		code=done, stamp, R-List
		//				code=noChange
		//				code=badRName (#group)
		//				code=wrongServer

opReadOwners = 3  //	RName, stamp		code=done, stamp, R-List
		//				code=noChange
		//				code=badRName (#group)
		//				code=wrongServer

opReadFriends = 4  //	RName, stamp		code=done, stamp, R-List
		//				code=noChange
		//				code=badRName (#group)
		//				code=wrongServer

opReadConnect = 7  //	RName			code=done, connect
		//				code=badRName (#individual)
		//				code=wrongServer

opReadRemark = 8  //	RName			code=done, remark
		//				code=badRName (#group)
		//				code=wrongServer

opAuthenticate = 9 //	RName, Password		code=done
		//				code=badPassword
		//				code=badRName (#individual)
		//				code=wrongServer

opIsInList = 46 // Group, Member, who, list, coverage
		//				code=done, membership
		//				code=badRName (#group)
		//				code=wrongServer
	// Group and Member are RNames.
	// who, list, and coverage are sent as 8-bit bytes.
	// The following definitions are for constructing IsInACL's
	// "descriptor" argument, which consists of who, list, and coverage
	// packed into one word.
	dItself = 0 lshift 8; dItsRegistry = 1 lshift 8			// who
	dMember = 0 lshift 4; dOwner = 1 lshift 4; dFriend = 2 lshift 4	// list
	dDirect = 0; dClosure = 1; dUpArrow = 2				// coverage
]

structure ListDesc: [ blank bit 4; who bit 4; list bit 4; coverage bit 4 ]