/** SERVER DEFINES FOR THE NETWORK FILESYSTEM */

/** standard network file system request packet sent to our fileservers */
struct NFSReqPkt {
	long	request;		/* thing to be performed by the server */
	void	*destmem;		/* where the server should DMA the result (on the other
							   machine that is) 
							   By convention this may be set to NULL for no response */
	long	totallength;	/* total bytes to DMA back */
	short	pktsize;		/* size of the packets to send it back as */
	short	extra;
	/* notice how this is divisible into long words */
};



/** Following the above initial request is one of the following structures */
struct NFSOpenFile {
)long	action;			/* actual action we should use to open the file */
	long	lock;			/* actually an index into our open lock array (or NULL) */
	char	namelen;		/* bstr style name (on a long word boundary!!) */
	char	name[1];		/* at least 1 character */
	/* after this should come the rest of the name ALSO NULL TERMINATED! */
};

/* tack the NFSOpenFile to the end of a NFSReqPkt */
#define NFSOPENFILE(a) ((struct NFSOpenFile *)(&((a)[1])))



/** this structure is DMA'd back to the requesting machine */
struct NFSOpenFileResult {
	long	remote_res1;	/* actual result from operation (always have first) */
	long	remote_fh;		/* index into remote array of fh's */
	long	majic;			/* a majic ID number sent back */
};


/** REQUEST defines - different from the amiga dos ones! */
#define REQUEST_OPENFILE	1
#define REQUEST_CLOSEFILE	2
#define REQUEST_READ		3
#define	REQUEST_WRITE		4


struct DosMsg {
	struct StandardPacket sp;
	void	(*code)(void *);			/* code to call with the *dosmsg passed in */
};


/** MACROS TO INIT STANDARD PACKETS */
#define INIT_STD_PKT(stdpkt, replyport) \
	\
	((stdpkt)->sp_Msg.mn_Node.ln_Type	= NT_MESSAGE,\
	(stdpkt)->sp_Msg.mn_Node.ln_Name	= (char *)(&(stdpkt)->sp_Pkt),\
	(stdpkt)->sp_Msg.mn_Length			= sizeof(struct StandardPacket),\
	(stdpkt)->sp_Msg.mn_ReplyPort		= (stdpkt)->sp_Pkt.dp_Port = replyport,\
	(stdpkt)->sp_Pkt.dp_Link			= &(stdpkt)->sp_Msg)

#define STD_PKT_ARGS1(stdpkt, replyport, action, arg1)\
	((stdpkt)->sp_Pkt.dp_Type = action,\
	(stdpkt)->sp_Pkt.dp_Arg1 = arg1,\
	INIT_STD_PKT(stdpkt,replyport))

#define STD_PKT_ARGS2(stdpkt, replyport, action, arg1, arg2)\
	((stdpkt)->sp_Pkt.dp_Arg2 = arg2,\
	STD_PKT_ARGS1(stdpkt, replyport, action, arg1))

#define STD_PKT_ARGS3(stdpkt, replyport, action, arg1, arg2, arg3)\
	((stdpkt)->sp_Pkt.dp_Arg3 = arg3,\
	STD_PKT_ARGS2(stdpkt, replyport, action, arg1, arg2))


