-static ipip_tunnel_t *
-ipip_tunnel_from_fib_node (fib_node_t * node)
-{
- ipip_main_t *gm = &ipip_main;
- ASSERT (gm->fib_node_type == node->fn_type);
- return ((ipip_tunnel_t *) (((char *) node) -
- offsetof (ipip_tunnel_t, p2p.node)));
-}
-
-static fib_node_back_walk_rc_t
-ipip_tunnel_back_walk (fib_node_t * node, fib_node_back_walk_ctx_t * ctx)
-{
- ipip_tunnel_restack (ipip_tunnel_from_fib_node (node));
-
- return (FIB_NODE_BACK_WALK_CONTINUE);
-}
-
-static fib_node_t *
-ipip_tunnel_fib_node_get (fib_node_index_t index)
-{
- ipip_tunnel_t *gt;
- ipip_main_t *gm;
-
- gm = &ipip_main;
- gt = pool_elt_at_index (gm->tunnels, index);
-
- return (>->p2p.node);
-}
-
-static void
-ipip_tunnel_last_lock_gone (fib_node_t * node)
-{
- /*
- * The MPLS IPIP tunnel is a root of the graph. As such
- * it never has children and thus is never locked.
- */
- ASSERT (0);
-}
-
-/*
- * Virtual function table registered by IPIP tunnels
- * for participation in the FIB object graph.
- */
-const static fib_node_vft_t ipip_vft = {
- .fnv_get = ipip_tunnel_fib_node_get,
- .fnv_last_lock = ipip_tunnel_last_lock_gone,
- .fnv_back_walk = ipip_tunnel_back_walk,
-};
-
-static void
-ipip_fib_add (ipip_tunnel_t * t)
-{
- ipip_main_t *gm = &ipip_main;
- fib_prefix_t dst = {.fp_len = t->transport == IPIP_TRANSPORT_IP6 ? 128 : 32,
- .fp_proto =
- t->transport ==
- IPIP_TRANSPORT_IP6 ? FIB_PROTOCOL_IP6 : FIB_PROTOCOL_IP4,
- .fp_addr = t->tunnel_dst
- };
-
- t->p2p.fib_entry_index =
- fib_table_entry_special_add (t->fib_index, &dst, FIB_SOURCE_RR,
- FIB_ENTRY_FLAG_NONE);
- t->p2p.sibling_index =
- fib_entry_child_add (t->p2p.fib_entry_index, gm->fib_node_type,
- t->dev_instance);
-}
-
-static void
-ipip_fib_delete (ipip_tunnel_t * t)
-{
- fib_entry_child_remove (t->p2p.fib_entry_index, t->p2p.sibling_index);
- fib_table_entry_delete_index (t->p2p.fib_entry_index, FIB_SOURCE_RR);
- fib_node_deinit (&t->p2p.node);
-}
-