FreeBSD/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c
/*
 * Insert an entry in the bridge interface TAILQ. Keep the
 * TAILQ sorted by the bridge's interface name.
 */
Insert an entry in the bridge interface TAILQ. Keep the
TAILQ sorted by the bridge's interface name.
Insert an entry in the bridge interface TAILQ . Keep the TAILQ sorted by the bridge ' s interface name .
static void
bridge_ifs_insert(struct bridge_ifs *headp,
	struct bridge_if *b)
{
	struct bridge_if *temp;
	if ((temp = TAILQ_FIRST(headp)) == NULL ||
	    strcmp(b->bif_name, temp->bif_name) < 0) {
		TAILQ_INSERT_HEAD(headp, b, b_if);
		return;
	}
	TAILQ_FOREACH(temp, headp, b_if)
		if(strcmp(b->bif_name, temp->bif_name) < 0)
			TAILQ_INSERT_BEFORE(temp, b, b_if);
	TAILQ_INSERT_TAIL(headp, b, b_if);
}
static void bridge_ifs_insert ( struct bridge_ifs * headp , struct bridge_if * b ) { struct bridge_if * temp ; if ( ( temp = TAILQ_FIRST ( headp ) ) == NULL || strcmp ( b -> bif_name , temp -> bif_name ) < 0 ) { TAILQ_INSERT_HEAD ( headp , b , b_if ) ; return ; } TAILQ_FOREACH ( temp , headp , b_if ) if ( strcmp ( b -> bif_name , temp -> bif_name ) < 0 ) TAILQ_INSERT_BEFORE ( temp , b , b_if ) ; TAILQ_INSERT_TAIL ( headp , b , b_if ) ; }
Insert an entry in the bridge interface TAILQ.
Insert an entry in the bridge interface TAILQ .