plan 9 kernel history: overview | file list | diff list

1998/0310/ip/ipifc.c (diff list | history)

1998/0307/sys/src/9/ip/ipifc.c:749,7541998/0310/sys/src/9/ip/ipifc.c:749,757 (short | long | prev | next)
1998/0307    
	*l_self = link->selflink; 
	iplinkfree(link); 
1998/0306    
 
1998/0310    
	if(p->link != nil) 
		goto out; 
 
1998/0306    
	/* remove from routing table */ 
	if(isv4(a)) 
		v4delroute(a+IPv4off, IPallbits+IPv4off); 
1998/0307/sys/src/9/ip/ipifc.c:755,7631998/0310/sys/src/9/ip/ipifc.c:758,763
1998/0306    
	else 
		v6delroute(a, IPallbits); 
	 
	if(p->link != nil) 
		goto out; 
                 
	/* no more links, remove from hash and free */ 
	*l = p->next; 
	ipselffree(p); 
1998/0307/sys/src/9/ip/ipifc.c:783,7921998/0310/sys/src/9/ip/ipifc.c:783,824
1998/0306    
			continue; 
		count = 0; 
		for(; p != nil && count++ < 6; p = p->next) 
			print("(%i %d %lux)", p->a, p->type, p); 
1998/0310    
			print("(%I %d %lux)", p->a, p->type, p); 
1998/0306    
		print("\n"); 
	} 
	qunlock(&selftab); 
1998/0310    
} 
 
static char *stformat = "%-32.32I %2.2d %4.4s\n"; 
enum 
{ 
	Nstformat= 41, 
}; 
 
long 
ipselftabread(char *cp, ulong offset, int n) 
{ 
	int i, m, nifc; 
	Ipself *p; 
	Iplink *link; 
	char state[8]; 
 
	m = 0; 
	qlock(&selftab); 
	for(i = 0; i < NHASH && m < n; i++){ 
		for(p = selftab.hash[i]; p != nil && m < n; p = p->next){ 
			if(offset == 0){ 
				nifc = 0; 
				for(link = p->link; link; link = link->selflink) 
					nifc++; 
				routetype(p->type, state); 
				m += snprint(cp + m, n - m, stformat, p->a, nifc, state); 
			} 
			offset -= Nstformat; 
		} 
	} 
	qunlock(&selftab); 
	return m; 
1998/0306    
} 
 
 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)