/*
*/

/* reqType	*/
#define		NoEntry		0x00
#define		ReqConnect	0x01
#define		Ack		0x02
#define		Nak		0x03
#define		NoRoute		0x04
#define		ReqEnd		0xff


/* protocol	*/
#define		ICOM	0x00	/* G1& G2 */
#define		DPlus	0x01
#define		DCS	0x02
#define		G3	0x03


#define		RespNULL	0x00
#define		RespAck		0x03
#define		RespBusy	0x02
#define		RespNoRoute	0x01

struct	repMsg
{
	unsigned char		reqType;			/* 0x01: ReqConnect  */
								/* 0x02: Ack	     */
								/* 0x03: Nak	     */
								/* 0xff: ReqEnd      */
	union {
		struct
		{
        		unsigned char   protocol;       /* 0: ICOM   */
                      			                /* 1: DPlus  */
                                        		/* 2: DCS    */
							/* 3: G3     */
			char		Rpt2Call[8];
			char		Rpt1Call[8];
			char		YourCall[8];
			char		MyCall[8];
			char		trustname[16];
			struct	in_addr	ip;
			in_port_t	port;
			unsigned char	PacketID[2];
			unsigned char	RespFlags;
		} reqConnect;

		struct
		{
                        unsigned char   protocol;       /* 0: ICOM   */
                                                        /* 1: DPlus  */
                                                        /* 2: DCS    */
							/* 3: G3     */
                        char            Rpt2Call[8];
                        char            Rpt1Call[8];
                        char            YourCall[8];
                        char            MyCall[8];
                        char            trustname[16];
                        struct  in_addr ip;
                        in_port_t       port;
			unsigned char	PacketID[2];
			unsigned char	RespFlags;
		} ackConnect;
	};
};

struct  sockaddr_in     dbAddr;
int     dbSock;

