24 ip6_address_t * ip6_src,
u8 ip6_src_len,
25 u8 ea_bits_len,
u8 psid_offset,
31 if (ea_bits_len > 0 && (ip6_prefix_len + ea_bits_len) > 64)
50 if (ip4_prefix_len + ea_bits_len < 32)
54 suffix_len = ea_bits_len;
59 suffix_len = 32 - ip4_prefix_len;
63 d->
psid_shift = 16 - psid_length - psid_offset;
66 if (ip6_prefix_len + suffix_len + d->
psid_length > 64)
90 ip6_address_t ip6_src;
92 ip4_prefix.as_u32 = clib_host_to_net_u32(0x14000000);
93 ip6_prefix.as_u64[0] = clib_host_to_net_u64(0x20010db800000000);
95 ip6_src.as_u64[0] = clib_host_to_net_u64(0x20010db8ffff0000);
96 map_domain_t * d =
get_domain (&
ip4_prefix, 8, &
ip6_prefix, 40, &ip6_src, 96, 24, 0, 0, 0,
MAP_DOMAIN_TRANSLATION);
102 assert(dst6.as_u64[0] == 0x20010db800a9c9db);
103 assert(dst6.as_u64[1] == 0x000014a9c9db0000);
119 ip6_address_t ip6_src;
122 ip4_prefix.as_u32 = clib_host_to_net_u32(0x14000000);
123 ip6_prefix.as_u64[0] = clib_host_to_net_u64(0x20010db800000000);
125 ip6_src.as_u64[0] = clib_host_to_net_u64(0x20010db8ffff0000);
126 ip6_src.as_u64[1] = clib_host_to_net_u64(0x0000000000000001);
128 128, 16, 6, 8, 0, 0);
136 assert(dst6.as_u64[0] == 0x20010db8a0000000);
137 assert(dst6.as_u64[1] == 0x000014a000000000);
144 assert(dst6.as_u64[0] == 0x20010db8a9000000);
145 assert(dst6.as_u64[1] == 0x000014a900000000);
149 128, 10, 0, 0, 0, 0);
152 assert(dst6.as_u64[0] == 0x20010db8a9c00000);
153 assert(dst6.as_u64[1] == 0x000014a9c0000000);
157 128, 16, 0, 0, 0, 0);
160 assert(dst6.as_u64[0] == 0x20010db8a9c90000);
161 assert(dst6.as_u64[1] == 0x000014a9c9000000);
165 128, 20, 0, 0, 0, 0);
168 assert(dst6.as_u64[0] == 0x20010db8a9c9d000);
169 assert(dst6.as_u64[1] == 0x000014a9c9d00000);
173 128, 23, 0, 0, 0, 0);
176 assert(dst6.as_u64[0] == 0x20010db8a9c9da00);
177 assert(dst6.as_u64[1] == 0x000014a9c9da0000);
184 assert(dst6.as_u64[0] == 0x20010db8a8000000);
185 assert(dst6.as_u64[1] == 0x000014a800000000);
188 #define foreach_test_case \
195 #define _(_test_name) \
196 test_ ## _test_name ();