#include	<sys/ipc.h>
#include	<sys/shm.h>

#define		MAX_SHM	20

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


struct  shm_form {
        unsigned char    type;          /* 0x00 not use         */
                                        /* 0x01 リクエスト　    */
                                        /* 0x02 リプライ        */
                                        /* 0x03 未登録          */
                                        /* 0x04 転送先無し	*/
                                        /* 0xff 削除            */
        char    protocol;

        union {
                struct {
                        char    dstRep[8];
                        char    Rep2Call[8];
                        char    Rep1Call[8];
                        char    dstCall[8];
                        char    srcCall[8];
                };
                struct {
                        char    rep_name[8];
                        char    trust_name[16];
                        char    reserve[16];
                };
        };
        in_port_t       srcPort;
        struct  in_addr srcIP;
	unsigned char	PacketID[2];
};

struct	shm_form_t
{
	struct	shm_form	mem;
	struct	timeval		e_time;
};

struct	{
	struct	shm_form_t	shmem[MAX_SHM];
} *shm_msg;

struct	shm_form	send_msg;

struct	shm_form	recv_msg;

