Lines Matching refs:key_ipv4

334 	struct bpf_lpm_trie_key_u8 *key_ipv4;  in test_lpm_ipaddr()  local
342 key_size_ipv4 = sizeof(*key_ipv4) + sizeof(__u32); in test_lpm_ipaddr()
344 key_ipv4 = alloca(key_size_ipv4); in test_lpm_ipaddr()
359 key_ipv4->prefixlen = 16; in test_lpm_ipaddr()
360 inet_pton(AF_INET, "192.168.0.0", key_ipv4->data); in test_lpm_ipaddr()
361 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
364 key_ipv4->prefixlen = 24; in test_lpm_ipaddr()
365 inet_pton(AF_INET, "192.168.0.0", key_ipv4->data); in test_lpm_ipaddr()
366 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
369 key_ipv4->prefixlen = 24; in test_lpm_ipaddr()
370 inet_pton(AF_INET, "192.168.128.0", key_ipv4->data); in test_lpm_ipaddr()
371 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
374 key_ipv4->prefixlen = 24; in test_lpm_ipaddr()
375 inet_pton(AF_INET, "192.168.1.0", key_ipv4->data); in test_lpm_ipaddr()
376 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
379 key_ipv4->prefixlen = 23; in test_lpm_ipaddr()
380 inet_pton(AF_INET, "192.168.0.0", key_ipv4->data); in test_lpm_ipaddr()
381 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
389 key_ipv4->prefixlen = 32; in test_lpm_ipaddr()
393 inet_pton(AF_INET, "192.168.128.23", key_ipv4->data); in test_lpm_ipaddr()
394 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == 0); in test_lpm_ipaddr()
397 inet_pton(AF_INET, "192.168.0.1", key_ipv4->data); in test_lpm_ipaddr()
398 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == 0); in test_lpm_ipaddr()
410 inet_pton(AF_INET, "10.0.0.1", key_ipv4->data); in test_lpm_ipaddr()
411 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == -ENOENT); in test_lpm_ipaddr()
413 inet_pton(AF_INET, "11.11.11.11", key_ipv4->data); in test_lpm_ipaddr()
414 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == -ENOENT); in test_lpm_ipaddr()