- /* Generate node sibling relationships. */
- {
- vlib_node_t * n, * sib;
- uword si;
-
- for (ni = 0; ni < vec_len (nm->nodes); ni++)
- {
- n = vec_elt (nm->nodes, ni);
-
- if (! n->sibling_of)
- continue;
-
- sib = vlib_get_node_by_name (vm, (u8 *) n->sibling_of);
- if (! sib)
- clib_error ("sibling `%s' not found for node `%v'", n->sibling_of, n->name);
-
- clib_bitmap_foreach (si, sib->sibling_bitmap, ({
- vlib_node_t * m = vec_elt (nm->nodes, si);
-
- /* Connect all of sibling's siblings to us. */
- m->sibling_bitmap = clib_bitmap_ori (m->sibling_bitmap, n->index);
-
- /* Connect us to all of sibling's siblings. */
- n->sibling_bitmap = clib_bitmap_ori (n->sibling_bitmap, si);
- }));
-
- /* Connect sibling to us. */
- sib->sibling_bitmap = clib_bitmap_ori (sib->sibling_bitmap, n->index);
-
- /* Connect us to sibling. */
- n->sibling_bitmap = clib_bitmap_ori (n->sibling_bitmap, sib->index);
- }
- }
-