aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/unittest/lisp_cp_test.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-02-24 13:32:30 +0000
committerFlorin Coras <florin.coras@gmail.com>2020-03-17 14:04:02 +0000
commit3ec09e9243dceb78e7548725281b0da8eddf72b1 (patch)
treefb591d687ea796751b523bfd69cd96c127a9e75b /src/plugins/unittest/lisp_cp_test.c
parent68449850783ed6a2570a864b2d12c79ff35c4072 (diff)
ip: ip_address_t uses ip46_address_t
Type: improvement type re-use. Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Ic2a2e6babf9ae66a1e53aec53a6cd157e1893dc8
Diffstat (limited to 'src/plugins/unittest/lisp_cp_test.c')
-rw-r--r--src/plugins/unittest/lisp_cp_test.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/plugins/unittest/lisp_cp_test.c b/src/plugins/unittest/lisp_cp_test.c
index 3480b8cf8ee..ac6f65c7e47 100644
--- a/src/plugins/unittest/lisp_cp_test.c
+++ b/src/plugins/unittest/lisp_cp_test.c
@@ -81,11 +81,11 @@ test_lisp_msg_push_ecm ()
sizeof (ecm_hdr_t) + 1;
la.type = GID_ADDR_IP_PREFIX;
- la.ippref.addr.ip.v4.as_u32 = 0xa1b2c3d4;
+ la.ippref.addr.ip.ip4.as_u32 = 0xa1b2c3d4;
la.ippref.addr.version = AF_IP4;
ra.type = GID_ADDR_IP_PREFIX;
- ra.ippref.addr.ip.v4.as_u32 = 0x90817263;
+ ra.ippref.addr.ip.ip4.as_u32 = 0x90817263;
ra.ippref.addr.version = AF_IP4;
ecm_hdr_t *lh = lisp_msg_push_ecm (vm, b, lp, rp, &la, &ra);
@@ -174,9 +174,9 @@ test_lisp_msg_parse_mapping_record ()
lisp_msg_parse_mapping_record (b, &eid, &locs, &probed);
_assert (vec_len (locs) == 1);
- _assert (eid.ippref.addr.ip.v4.as_u32 == 0x66554433);
+ _assert (eid.ippref.addr.ip.ip4.as_u32 == 0x66554433);
_assert (locs[0].local == 0);
- _assert (locs[0].address.ippref.addr.ip.v4.as_u32 == 0xddccbbaa);
+ _assert (locs[0].address.ippref.addr.ip.ip4.as_u32 == 0xddccbbaa);
_assert (locs[0].address.type == GID_ADDR_IP_PREFIX);
_assert (locs[0].priority == 0xa);
_assert (locs[0].weight == 0xb);
@@ -264,24 +264,24 @@ test_lisp_msg_parse ()
u32 len = lisp_msg_parse_addr (b, &gid);
_assert (len == 2 + 4
/* Source-EID-AFI field lenght + IPv4 address length */ );
- _assert (gid.ippref.addr.ip.v4.as_u32 == 0x12345678);
+ _assert (gid.ippref.addr.ip.ip4.as_u32 == 0x12345678);
_assert (gid.ippref.addr.version == AF_IP4);
u8 rloc_count = MREQ_ITR_RLOC_COUNT (h) + 1;
lisp_msg_parse_itr_rlocs (b, &rlocs, rloc_count);
_assert (vec_len (rlocs) == 2);
- _assert (rlocs[0].ippref.addr.ip.v4.as_u32 == 0x10203040);
+ _assert (rlocs[0].ippref.addr.ip.ip4.as_u32 == 0x10203040);
_assert (rlocs[0].ippref.addr.version == AF_IP4);
- _assert (rlocs[1].ippref.addr.ip.v6.as_u32[0] == 0xffeeddcc);
- _assert (rlocs[1].ippref.addr.ip.v6.as_u32[1] == 0xbbaa9988);
- _assert (rlocs[1].ippref.addr.ip.v6.as_u32[2] == 0x77665544);
- _assert (rlocs[1].ippref.addr.ip.v6.as_u32[3] == 0x33221100);
+ _assert (rlocs[1].ippref.addr.ip.ip6.as_u32[0] == 0xffeeddcc);
+ _assert (rlocs[1].ippref.addr.ip.ip6.as_u32[1] == 0xbbaa9988);
+ _assert (rlocs[1].ippref.addr.ip.ip6.as_u32[2] == 0x77665544);
+ _assert (rlocs[1].ippref.addr.ip.ip6.as_u32[3] == 0x33221100);
_assert (rlocs[1].ippref.addr.version == AF_IP6);
lisp_msg_parse_eid_rec (b, &eid);
- _assert (eid.ippref.addr.ip.v4.as_u32 == 0x9abcdef0);
+ _assert (eid.ippref.addr.ip.ip4.as_u32 == 0x9abcdef0);
_assert (eid.ippref.addr.version == AF_IP4);
_assert (eid.ippref.len == 24);
@@ -433,7 +433,7 @@ build_test_map_records ()
.type = GID_ADDR_IP_PREFIX,
.ippref = {
.addr = {
- .ip.v4.as_u32 = 0x99887766,
+ .ip.ip4.as_u32 = 0x99887766,
.version = AF_IP4
}
}
@@ -651,7 +651,7 @@ test_lisp_parse_lcaf ()
lisp_msg_parse_mapping_record (b, &eid, &locs, &probed);
_assert (vec_len (locs) == 3);
- _assert (eid.ippref.addr.ip.v4.as_u32 == 0x66554433);
+ _assert (eid.ippref.addr.ip.ip4.as_u32 == 0x66554433);
/* check 1st locator - an LCAF with ipv4 */
_assert (locs[0].local == 0);
@@ -931,7 +931,7 @@ test_gid_parse_lcaf ()
_assert (GID_ADDR_IP_PREFIX == gid_address_type (gid_addr));
_assert (9 == gid_address_vni (gid_addr));
_assert (0x18 == gid_address_vni_mask (gid_addr));
- _assert (0xddccbb10 == gid_addr->ippref.addr.ip.v4.as_u32);
+ _assert (0xddccbb10 == gid_addr->ippref.addr.ip.ip4.as_u32);
done:
gid_address_free (gid_addr);
@@ -1128,7 +1128,7 @@ test_src_dst_with_vni_serdes (void)
.addr =
{
.version = AF_IP4,
- .ip.v4.data = { 0x1, 0x2, 0x3, 0x0 }
+ .ip.ip4.data = { 0x1, 0x2, 0x3, 0x0 }
}
}
};
@@ -1142,7 +1142,7 @@ test_src_dst_with_vni_serdes (void)
.addr =
{
.version = AF_IP4,
- .ip.v4.data = { 0x9, 0x8, 0x0, 0x0 }
+ .ip.ip4.data = { 0x9, 0x8, 0x0, 0x0 }
}
}
};