static void test05 (int n) { while (n>0) { stp_init(); stp_create (test05_aux, 0); stp_create (test05_aux, 0); stp_start(); --n; } }
static struct bridge * new_bridge(struct test_case *tc, int id) { struct bridge *b = xmalloc(sizeof *b); char name[16]; b->tc = tc; b->id = id; snprintf(name, sizeof name, "stp%x", id); b->stp = stp_create(name, id, send_bpdu, b); assert(tc->n_bridges < ARRAY_SIZE(tc->bridges)); b->n_ports = 0; b->rxq_head = b->rxq_tail = 0; tc->bridges[tc->n_bridges++] = b; return b; }