FreeBSD/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c
/*
 * Create a new entry for a bridge interface and insert
 * it in the list.
 */
Create a new entry for a bridge interface and insert
it in the list.
Create a new entry for a bridge interface and insert it in the list .
static struct bridge_if *
bridge_new_bif(const char *bif_n, uint32_t sysindex, const u_char *physaddr)
{
	struct bridge_if *bif;
	if ((bif = (struct bridge_if *) malloc(sizeof(*bif)))== NULL) {
		syslog(LOG_ERR, "bridge new interface failed: %s",
		    strerror(errno));
		return (NULL);
	}
	bzero(bif, sizeof(struct bridge_if));
	strlcpy(bif->bif_name, bif_n, IFNAMSIZ);
	bcopy(physaddr, bif->br_addr.octet, ETHER_ADDR_LEN);
	bif->sysindex = sysindex;
	bif->br_type = BaseType_transparent_only;
	bif->hold_time = 1 * 100;
	bif->prot_spec = dot1dStpProtocolSpecification_ieee8021d;
	bridge_ifs_insert(&bridge_ifs, bif);
	return (bif);
}
static struct bridge_if * bridge_new_bif ( const char * bif_n , uint32_t sysindex , const u_char * physaddr ) { struct bridge_if * bif ; if ( ( bif = ( struct bridge_if * ) malloc ( sizeof ( * bif ) ) ) == NULL ) { syslog ( LOG_ERR , " " , strerror ( errno ) ) ; return ( NULL ) ; } bzero ( bif , sizeof ( struct bridge_if ) ) ; strlcpy ( bif -> bif_name , bif_n , IFNAMSIZ ) ; bcopy ( physaddr , bif -> br_addr . octet , ETHER_ADDR_LEN ) ; bif -> sysindex = sysindex ; bif -> br_type = BaseType_transparent_only ; bif -> hold_time = 1 * 100 ; bif -> prot_spec = dot1dStpProtocolSpecification_ieee8021d ; bridge_ifs_insert ( & bridge_ifs , bif ) ; return ( bif ) ; }
Create a new entry for a bridge interface and insert
 it in the list.
Create a new entry for a bridge interface and insert it in the list .
/* 1 - all bridges default hold time * 100 - centi-seconds */