FreeBSD/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c
/*
 * Prepare the variable (bridge interface name) for the private
 * begemot notifications.
 */
Prepare the variable (bridge interface name) for the private
begemot notifications.
Prepare the variable ( bridge interface name ) for the private begemot notifications .
static struct snmp_value*
bridge_basename_var(struct bridge_if *bif, struct snmp_value* b_val)
{
	uint i;
	b_val->var = oid_begemotBrigeName;
	b_val->var.subs[b_val->var.len++] = strlen(bif->bif_name);
	if ((b_val->v.octetstring.octets = (u_char *)
	    malloc(strlen(bif->bif_name))) == NULL)
		return (NULL);
	for (i = 0; i < strlen(bif->bif_name); i++)
		b_val->var.subs[b_val->var.len++] = bif->bif_name[i];
	b_val->v.octetstring.len = strlen(bif->bif_name);
	bcopy(bif->bif_name, b_val->v.octetstring.octets,
	    strlen(bif->bif_name));
	b_val->syntax = SNMP_SYNTAX_OCTETSTRING;
	return (b_val);
}
static struct snmp_value * bridge_basename_var ( struct bridge_if * bif , struct snmp_value * b_val ) { uint i ; b_val -> var = oid_begemotBrigeName ; b_val -> var . subs [ b_val -> var . len ++ ] = strlen ( bif -> bif_name ) ; if ( ( b_val -> v . octetstring . octets = ( u_char * ) malloc ( strlen ( bif -> bif_name ) ) ) == NULL ) return ( NULL ) ; for ( i = 0 ; i < strlen ( bif -> bif_name ) ; i ++ ) b_val -> var . subs [ b_val -> var . len ++ ] = bif -> bif_name [ i ] ; b_val -> v . octetstring . len = strlen ( bif -> bif_name ) ; bcopy ( bif -> bif_name , b_val -> v . octetstring . octets , strlen ( bif -> bif_name ) ) ; b_val -> syntax = SNMP_SYNTAX_OCTETSTRING ; return ( b_val ) ; }
Prepare the variable (bridge interface name) for the private
 begemot notifications.
Prepare the variable ( bridge interface name ) for the private begemot notifications .