FreeBSD/contrib/bsnmp/snmp_mibII/mibII.c
/*
 * Helper routine to extract the sockaddr structures from a routing
 * socket message.
 */
Helper routine to extract the sockaddr structures from a routing
socket message.
Helper routine to extract the sockaddr structures from a routing socket message .
void
mib_extract_addrs(int addrs, u_char *info, struct sockaddr **out)
{
	u_int i;
	for (i = 0; i < RTAX_MAX; i++) {
		if ((addrs & (1 << i)) != 0) {
			*out = (struct sockaddr *)(void *)info;
			info += roundup((*out)->sa_len, sizeof(long));
		} else
			*out = NULL;
		out++;
	}
}
void mib_extract_addrs ( int addrs , u_char * info , struct sockaddr * * out ) { u_int i ; for ( i = 0 ; i < RTAX_MAX ; i ++ ) { if ( ( addrs & ( 1 << i ) ) != 0 ) { * out = ( struct sockaddr * ) ( void * ) info ; info += roundup ( ( * out ) -> sa_len , sizeof ( long ) ) ; } else * out = NULL ; out ++ ; } }
Helper routine to extract the sockaddr structures from a routing
 socket message.
Helper routine to extract the sockaddr structures from a routing socket message .