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

/* udpnxtp.c - udpnxtp */

#include <conf.h>
#include <kernel.h>
#include <network.h>

/*------------------------------------------------------------------------
 *  udpnxtp  -  return the next available UDP local "port" number
 *------------------------------------------------------------------------
 */
udpnxtp()
{
	int	i;
	int	try;
	Bool	inuse;
	struct	netq	*nqptr;
	PStype	ps;

	disable(ps);
	for (inuse=TRUE ; inuse ; ) {
		inuse = FALSE;
		try = Net.nxtprt++;
		for (i=0 ; i<NETQS ; i++)
			 if ( (nqptr= &Net.netqs[i])->valid &&
				nqptr->uport == try) {
				inuse = TRUE;
				break;
			}
	}
	restore(ps);
	return(try);
}

unix.superglobalmegacorp.com

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