/*
Copyright (c) 1993 Xerox Corporation.  All rights reserved.
*/
/*
$Id$

$Date$
 *
 */
/* Chauser, October 28, 1993 3:39 pm PDT */

#ifndef ←←PCR←DbgNubProtocol←h
#   define ←←PCR←DbgNubProtocol←h 1

#include <config/PCR←StdDefs.h>
#include <config/PCR←Arch.h>


/*
 * well known port
 */

#define PCR←DbgNubProtocol←LISTENER←PORT		4815

#define PCR←DbgNubProtocol←VERSION	0

#define PCR←DbgNubProtocol←MkVersion(proto,procs) ( ((proto)<<16) | (procs) )

/*
 * return codes
 */

#define PCR←DbgNubProtocol←Res←okay	PCR←ERes←okay

#define PCR←DbgNubProtocol←Res←noProc	PCR←ERes←FromRes(1)
#define PCR←DbgNubProtocol←Res←badArgs	PCR←ERes←FromRes(2)

/* the remaining codes require destroying the stream */

#define PCR←DbgNubProtocol←Res←MUST←CLOSE←CONNECTION	PCR←ERes←FromRes(128)
#define PCR←DbgNubProtocol←Res←failure	PCR←ERes←FromRes(128)
#define PCR←DbgNubProtocol←Res←failure	PCR←ERes←FromRes(129)
#define PCR←DbgNubProtocol←Res←protocol	PCR←ERes←FromRes(130)
#define PCR←DbgNubProtocol←Res←space	PCR←ERes←FromRes(131)


/*
 * types (of tagged values passed over the wire)
 */
 
typedef enum {
    PCR←DbgNubProtocol←Tag←null = 0,
    PCR←DbgNubProtocol←Tag←procID = 1,
    PCR←DbgNubProtocol←Tag←retCode = 2,
    PCR←DbgNubProtocol←Tag←card32 = 3,
    PCR←DbgNubProtocol←Tag←int32 = 4,
    PCR←DbgNubProtocol←Tag←string = 5,
    PCR←DbgNubProtocol←Tag←block8 = 6,
    PCR←DbgNubProtocol←Tag←block16 = 7,
    PCR←DbgNubProtocol←Tag←block32 = 8,
    PCR←DbgNubProtocol←Tag←last = 0x7fff
} PCR←DbgNubProtocol←Tag;


/*
 * representation on the wire
 *
 * call is args followed by procID
 * reply is results followed by retCode
 */

#if defined(PCR←Arch←STD←SIZES)
    typedef short net←16;
    typedef long net←32;
#else
#   error NYI
#endif


typedef struct {
    net←16 dnpw←tag;
    net←16 dnpw←len;
} PCR←DbgNubProtocol←Wrapper;

#endif /* ←←PCR←DbgNubProtocol←h */