- /* Node index of next sibling will be filled in by vlib_node_main_init. */
- n->sibling_of = r->sibling_of;
- if (r->sibling_of)
- {
- if (r->n_next_nodes > 0)
- clib_error ("sibling node should not have any next nodes `%v'",
- n->name);
-
- if (nm->flags & VLIB_NODE_MAIN_RUNTIME_STARTED)
- {
- vlib_node_t *sib;
- u32 slot, i;
-
- sib = vlib_get_node_by_name (vm, (u8 *) n->sibling_of);
-
- if (sib == 0)
- clib_error ("unknown sibling node '%s'", n->sibling_of);
-
- vec_foreach_index (i, sib->next_nodes)
- {
- slot = vlib_node_add_next_with_slot (vm, n->index,
- sib->next_nodes[i], i);
- ASSERT (slot == i);
- }
-
- vlib_node_add_to_sibling_bitmap (vm, n, sib);
-
- r->n_next_nodes = vec_len (n->next_nodes);
- }
- }
-