-static uword
-vtep_addr_ref (ip46_address_t * ip)
-{
- uword *vtep = ip46_address_is_ip4 (ip) ?
- hash_get (gtpu_main.vtep4, ip->ip4.as_u32) :
- hash_get_mem (gtpu_main.vtep6, &ip->ip6);
- if (vtep)
- return ++(*vtep);
- ip46_address_is_ip4 (ip) ?
- hash_set (gtpu_main.vtep4, ip->ip4.as_u32, 1) :
- hash_set_mem_alloc (>pu_main.vtep6, &ip->ip6, 1);
- return 1;
-}
-
-static uword
-vtep_addr_unref (ip46_address_t * ip)
-{
- uword *vtep = ip46_address_is_ip4 (ip) ?
- hash_get (gtpu_main.vtep4, ip->ip4.as_u32) :
- hash_get_mem (gtpu_main.vtep6, &ip->ip6);
- ALWAYS_ASSERT (vtep);
- if (--(*vtep) != 0)
- return *vtep;
- ip46_address_is_ip4 (ip) ?
- hash_unset (gtpu_main.vtep4, ip->ip4.as_u32) :
- hash_unset_mem_free (>pu_main.vtep6, &ip->ip6);
- return 0;
-}
-