ports.h,v

来自「TCP-IP红宝书源代码」· H,V 代码 · 共 76 行

H,V
76
字号
head	1.2;
access;
symbols;
locks
	dls:1.2; strict;
comment	@ * @;


1.2
date	97.09.21.19.26.19;	author dls;	state Dist;
branches;
next	1.1;

1.1
date	94.05.10.20.48.46;	author dls;	state Old;
branches;
next	;


desc
@@


1.2
log
@pre-3e code
@
text
@/* ports.h - isbadport */

#ifndef	NPORTS
#define	NPORTS		20		/* default max number of ports	*/
#endif	NPORTS

#define	MAXMSGS		50		/* maximum messages on all ports*/
#define	PTFREE		'\01'		/* port is Free			*/
#define	PTLIMBO		'\02'		/* port is being deleted/reset	*/
#define	PTALLOC		'\03'		/* port is allocated		*/
#define	PTEMPTY		-1		/* initial semaphore entries	*/

#define	PTNODISP	0		/* ptclear() null disposal func */

struct	ptnode	{			/* node on list of message ptrs	*/
	int	ptmsg;			/* a one-word message		*/
	struct	ptnode	*ptnext;	/* address of next node on list	*/
};

struct	pt	{			/* entry in the port table	*/
	char	ptstate;		/* port state (FREE/LIMBO/ALLOC)*/
	int	ptssem;			/* sender semaphore		*/
	int	ptrsem;			/* receiver semaphore		*/
	int	ptmaxcnt;		/* max messages to be queued	*/
	int	ptseq;			/* sequence changed at creation	*/
	struct	ptnode	*pthead;	/* list of message pointers	*/
	struct	ptnode	*pttail;	/* tail of message list		*/
};

extern	struct	ptnode	*ptfree;	/* list of free nodes		*/
extern	struct	pt	ports[];	/* port table			*/
extern	int	ptnextp;		/* next port to examine when	*/
					/*   looking for a free one	*/
#ifdef	MEMMARK
extern	MARKER	ptmark;
#endif

#define	isbadport(portid)	( (portid)<0 || (portid)>=NPORTS )
@


1.1
log
@Initial revision
@
text
@@

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?