summaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-cp/one_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/lisp-cp/one_api.c')
-rw-r--r--src/vnet/lisp-cp/one_api.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/vnet/lisp-cp/one_api.c b/src/vnet/lisp-cp/one_api.c
index fa67536c32d..56cb74b0c77 100644
--- a/src/vnet/lisp-cp/one_api.c
+++ b/src/vnet/lisp-cp/one_api.c
@@ -155,7 +155,8 @@ unformat_one_locs (vl_api_one_remote_locator_t * rmt_locs, u32 rloc_num)
/* remote locators */
r = &rmt_locs[i];
clib_memset (&loc, 0, sizeof (loc));
- gid_address_ip_set (&loc.address, &r->addr, r->is_ip4 ? IP4 : IP6);
+ gid_address_ip_set (&loc.address, &r->addr,
+ r->is_ip4 ? AF_IP4 : AF_IP6);
loc.priority = r->priority;
loc.weight = r->weight;
@@ -298,13 +299,13 @@ unformat_one_eid_api (gid_address_t * dst, u32 vni, u8 type, void *src,
{
case 0: /* ipv4 */
gid_address_type (dst) = GID_ADDR_IP_PREFIX;
- gid_address_ip_set (dst, src, IP4);
+ gid_address_ip_set (dst, src, AF_IP4);
gid_address_ippref_len (dst) = len;
ip_prefix_normalize (&gid_address_ippref (dst));
break;
case 1: /* ipv6 */
gid_address_type (dst) = GID_ADDR_IP_PREFIX;
- gid_address_ip_set (dst, src, IP6);
+ gid_address_ip_set (dst, src, AF_IP6);
gid_address_ippref_len (dst) = len;
ip_prefix_normalize (&gid_address_ippref (dst));
break;
@@ -405,7 +406,7 @@ vl_api_one_add_del_map_server_t_handler (vl_api_one_add_del_map_server_t * mp)
clib_memset (&addr, 0, sizeof (addr));
- ip_address_set (&addr, mp->ip_address, mp->is_ipv6 ? IP6 : IP4);
+ ip_address_set (&addr, mp->ip_address, mp->is_ipv6 ? AF_IP6 : AF_IP4);
rv = vnet_lisp_add_del_map_server (&addr, mp->is_add);
REPLY_MACRO (VL_API_ONE_ADD_DEL_MAP_SERVER_REPLY);
@@ -422,7 +423,7 @@ vl_api_one_add_del_map_resolver_t_handler (vl_api_one_add_del_map_resolver_t
clib_memset (a, 0, sizeof (a[0]));
a->is_add = mp->is_add;
- ip_address_set (&a->address, mp->ip_address, mp->is_ipv6 ? IP6 : IP4);
+ ip_address_set (&a->address, mp->ip_address, mp->is_ipv6 ? AF_IP6 : AF_IP4);
rv = vnet_lisp_add_del_map_resolver (a);
@@ -528,7 +529,7 @@ vl_api_one_use_petr_t_handler (vl_api_one_use_petr_t * mp)
int rv = 0;
ip_address_t addr;
- ip_address_set (&addr, &mp->address, mp->is_ip4 ? IP4 : IP6);
+ ip_address_set (&addr, &mp->address, mp->is_ip4 ? AF_IP4 : AF_IP6);
rv = vnet_lisp_use_petr (&addr, mp->is_add);
REPLY_MACRO (VL_API_ONE_USE_PETR_REPLY);
@@ -567,12 +568,12 @@ vl_api_show_one_use_petr_t_handler (vl_api_show_one_use_petr_t * mp)
ip_address_t *ip = &gid_address_ip (&addr);
switch (ip_addr_version (ip))
{
- case IP4:
+ case AF_IP4:
clib_memcpy (rmp->address, &ip_addr_v4 (ip),
sizeof (ip_addr_v4 (ip)));
break;
- case IP6:
+ case AF_IP6:
clib_memcpy (rmp->address, &ip_addr_v6 (ip),
sizeof (ip_addr_v6 (ip)));
break;
@@ -580,7 +581,7 @@ vl_api_show_one_use_petr_t_handler (vl_api_show_one_use_petr_t * mp)
default:
ASSERT (0);
}
- rmp->is_ip4 = (gid_address_ip_version (&addr) == IP4);
+ rmp->is_ip4 = (gid_address_ip_version (&addr) == AF_IP4);
});
/* *INDENT-ON* */
}
@@ -827,7 +828,7 @@ one_fid_put_api (u8 * dst, fid_address_t * src, u8 * prefix_length)
switch (fid_addr_type (src))
{
case FID_ADDR_IP_PREF:
- if (ip_prefix_version (ippref) == IP4)
+ if (ip_prefix_version (ippref) == AF_IP4)
clib_memcpy (dst, &ip_prefix_v4 (ippref), 4);
else
clib_memcpy (dst, &ip_prefix_v6 (ippref), 16);
@@ -854,9 +855,9 @@ fid_type_to_api_type (fid_address_t * fid)
{
case FID_ADDR_IP_PREF:
ippref = &fid_addr_ippref (fid);
- if (ip_prefix_version (ippref) == IP4)
+ if (ip_prefix_version (ippref) == AF_IP4)
return 0;
- else if (ip_prefix_version (ippref) == IP6)
+ else if (ip_prefix_version (ippref) == AF_IP6)
return 1;
else
return ~0;
@@ -936,7 +937,7 @@ send_one_eid_table_details (mapping_t * mapit,
break;
case GID_ADDR_IP_PREFIX:
rmp->eid_prefix_len = ip_prefix_len (ip_prefix);
- if (ip_prefix_version (ip_prefix) == IP4)
+ if (ip_prefix_version (ip_prefix) == AF_IP4)
{
rmp->eid_type = 0; /* ipv4 type */
clib_memcpy (rmp->eid, &ip_prefix_v4 (ip_prefix),
@@ -1022,13 +1023,13 @@ send_one_map_server_details (ip_address_t * ip, vl_api_registration_t * reg,
switch (ip_addr_version (ip))
{
- case IP4:
+ case AF_IP4:
rmp->is_ipv6 = 0;
clib_memcpy (rmp->ip_address, &ip_addr_v4 (ip),
sizeof (ip_addr_v4 (ip)));
break;
- case IP6:
+ case AF_IP6:
rmp->is_ipv6 = 1;
clib_memcpy (rmp->ip_address, &ip_addr_v6 (ip),
sizeof (ip_addr_v6 (ip)));
@@ -1071,13 +1072,13 @@ send_one_map_resolver_details (ip_address_t * ip,
switch (ip_addr_version (ip))
{
- case IP4:
+ case AF_IP4:
rmp->is_ipv6 = 0;
clib_memcpy (rmp->ip_address, &ip_addr_v4 (ip),
sizeof (ip_addr_v4 (ip)));
break;
- case IP6:
+ case AF_IP6:
rmp->is_ipv6 = 1;
clib_memcpy (rmp->ip_address, &ip_addr_v6 (ip),
sizeof (ip_addr_v6 (ip)));
@@ -1184,7 +1185,7 @@ one_adjacency_copy (vl_api_one_adjacency_t * dst, lisp_adjacency_t * adjs)
case GID_ADDR_IP_PREFIX:
a.reid_prefix_len = gid_address_ippref_len (&adj->reid);
a.leid_prefix_len = gid_address_ippref_len (&adj->leid);
- if (gid_address_ip_version (&adj->reid) == IP4)
+ if (gid_address_ip_version (&adj->reid) == AF_IP4)
{
a.eid_type = 0; /* ipv4 type */
clib_memcpy (a.reid, &gid_address_ip (&adj->reid), 4);
@@ -1469,7 +1470,7 @@ lisp_fid_addr_to_api (fid_address_t * fid, u8 * dst, u8 * api_eid_type,
{
case FID_ADDR_IP_PREF:
*prefix_length = fid_addr_prefix_length (fid);
- if (fid_addr_ip_version (fid) == IP4)
+ if (fid_addr_ip_version (fid) == AF_IP4)
{
*api_eid_type = 0; /* ipv4 type */
clib_memcpy (dst, &fid_addr_ippref (fid), 4);
@@ -1518,7 +1519,7 @@ vl_api_one_stats_dump_t_handler (vl_api_one_stats_dump_t * mp)
&rmp->seid_pref_len);
rmp->vni = clib_host_to_net_u32 (stat->vni);
- rmp->is_ip4 = ip_addr_version (&stat->rmt_rloc) == IP4 ? 1 : 0;
+ rmp->is_ip4 = ip_addr_version (&stat->rmt_rloc) == AF_IP4 ? 1 : 0;
ip_address_copy_addr (rmp->rloc, &stat->rmt_rloc);
ip_address_copy_addr (rmp->lloc, &stat->loc_rloc);
@@ -1542,7 +1543,7 @@ static void
gid_address_arp_bd (arp) = clib_net_to_host_u32 (mp->bd);
/* vpp keeps ip4 addresses in network byte order */
- ip_address_set (&gid_address_arp_ndp_ip (arp), &mp->ip4, IP4);
+ ip_address_set (&gid_address_arp_ndp_ip (arp), &mp->ip4, AF_IP4);
rv = vnet_lisp_add_del_l2_arp_ndp_entry (arp, mp->mac, mp->is_add);
@@ -1559,7 +1560,7 @@ vl_api_one_add_del_ndp_entry_t_handler (vl_api_one_add_del_ndp_entry_t * mp)
gid_address_type (g) = GID_ADDR_NDP;
gid_address_ndp_bd (g) = clib_net_to_host_u32 (mp->bd);
- ip_address_set (&gid_address_arp_ndp_ip (g), mp->ip6, IP6);
+ ip_address_set (&gid_address_arp_ndp_ip (g), mp->ip6, AF_IP6);
rv = vnet_lisp_add_del_l2_arp_ndp_entry (g, mp->mac, mp->is_add);