File:  [XINU] / xinu / h / net.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:39:02 2018 UTC (8 years, 2 months ago) by root
Branches: xinu, MAIN
CVS tags: xinu-19870308, HEAD
Xinu for VAX

/* net.h */

/* High-level network definitions and constants */

#define	NETBUFS		25		/* number of network buffers	*/
#ifndef	Ndg
#define	NETQS		1		/* number of xinu ports used to	*/
#else					/*  demultiplex udp datagrams	*/
#define	NETQS		Ndg
#endif
#define	NETQLEN		15		/* size of a demux queue	*/
#define	NETFQ		3		/* size of input-to-output queue*/
#ifndef	NETNLEN
#define	NETNLEN		30		/* length of network name	*/
#endif

/* Commands for the network pseudo device control call */

#define	NC_SETGW	1		/* set gateway IP address	*/

/* Network input and output processes: procedure name and parameters */

#define	NETIN		netin		/* network input daemon process	*/
#define	NETOUT		netout		/* network output process	*/
extern	int		NETIN(), NETOUT();
#define	NETISTK		1024		/* stack size for network input	*/
#define	NETOSTK		1900		/* stack size for network output*/
#define	NETIPRI		100		/* network runs at high priority*/
#define	NETOPRI		 99		/* network output priority	*/
#define	NETINAM		"netin"		/* name of network input process*/
#define	NETONAM		"netout"	/* name of network output   "	*/
#define	NETIARGC	1		/* count of args to net input	*/
#define	NETOARGC	2		/* count of args to net output	*/


/* Mapping of external network UDP "port" to internal Xinu port */

struct	netq	{			/* UDP demultiplexing info	*/
	Bool	valid;			/* is this entry in use?	*/
	short	uport;			/* local UDP "port" number	*/
	int	pid;			/* pid of process if one waiting*/
	int	xport;			/* Corresponding Xinu port on	*/
};					/*  which incoming pac. queued	*/

struct	netinfo	{			/* info and parms. for network	*/
	int	netpool;		/* network packet buffer pool	*/
	struct	netq netqs[NETQS];	/* UDP packet demux info	*/
	Bool	mnvalid;		/* is my host name field valid?	*/
	Bool	mavalid;		/* is my network address valid?	*/
	char	myname[NETNLEN];	/* domain name of this machine	*/
	IPaddr	myaddr;			/* IP address of this machine	*/
	IPaddr	mynet;			/* Network portion of myaddr	*/
	IPaddr	gateway;		/* IP address of gateway to use	*/
	int	nxtprt;			/* next available local UDP port*/
	int	nmutex;			/* output mutual excl. semaphore*/
	int	npacket;		/* # of packets processed	*/
	int	ndrop;			/* # of dropped packets		*/
	int	nover;			/* # dropped because queue full	*/
};

extern	struct	netinfo	Net;		/* All network parameters	*/

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.