Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include "headers.h"
2
 
3
NbGlobals nbglobals;
4
 
5
NbName nbnameany = { '*' };
6
 
7
int
8
nbinit(void)
9
{
10
	Ipifc *ipifc;
11
	int i;
12
	fmtinstall('I', eipfmt);
13
	fmtinstall('B', nbnamefmt);
14
	ipifc = readipifc("/net", nil, 0);
15
	if (ipifc == nil || ipifc->lifc == nil) {
16
		print("no network interface");
17
		return -1;
18
	}
19
	ipmove(nbglobals.myipaddr, ipifc->lifc->ip);
20
	ipmove(nbglobals.bcastaddr, ipifc->lifc->ip);
21
	nbmknamefromstring(nbglobals.myname, sysname());
22
	for (i = 0; i < IPaddrlen; i++)
23
		nbglobals.bcastaddr[i] |= ~ipifc->lifc->mask[i];
24
	return 0;
25
}