|
|
1.1 root 1: /* udpnxtp.c - udpnxtp */
2:
3: #include <conf.h>
4: #include <kernel.h>
5: #include <network.h>
6:
7: /*------------------------------------------------------------------------
8: * udpnxtp - return the next available UDP local "port" number
9: *------------------------------------------------------------------------
10: */
11: udpnxtp()
12: {
13: int i;
14: int try;
15: Bool inuse;
16: struct netq *nqptr;
17: PStype ps;
18:
19: disable(ps);
20: for (inuse=TRUE ; inuse ; ) {
21: inuse = FALSE;
22: try = Net.nxtprt++;
23: for (i=0 ; i<NETQS ; i++)
24: if ( (nqptr= &Net.netqs[i])->valid &&
25: nqptr->uport == try) {
26: inuse = TRUE;
27: break;
28: }
29: }
30: restore(ps);
31: return(try);
32: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.