Lines Matching refs:key_ipv4
332 struct bpf_lpm_trie_key *key_ipv4; in test_lpm_ipaddr() local
340 key_size_ipv4 = sizeof(*key_ipv4) + sizeof(__u32); in test_lpm_ipaddr()
342 key_ipv4 = alloca(key_size_ipv4); in test_lpm_ipaddr()
357 key_ipv4->prefixlen = 16; in test_lpm_ipaddr()
358 inet_pton(AF_INET, "192.168.0.0", key_ipv4->data); in test_lpm_ipaddr()
359 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
362 key_ipv4->prefixlen = 24; in test_lpm_ipaddr()
363 inet_pton(AF_INET, "192.168.0.0", key_ipv4->data); in test_lpm_ipaddr()
364 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
367 key_ipv4->prefixlen = 24; in test_lpm_ipaddr()
368 inet_pton(AF_INET, "192.168.128.0", key_ipv4->data); in test_lpm_ipaddr()
369 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
372 key_ipv4->prefixlen = 24; in test_lpm_ipaddr()
373 inet_pton(AF_INET, "192.168.1.0", key_ipv4->data); in test_lpm_ipaddr()
374 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
377 key_ipv4->prefixlen = 23; in test_lpm_ipaddr()
378 inet_pton(AF_INET, "192.168.0.0", key_ipv4->data); in test_lpm_ipaddr()
379 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
387 key_ipv4->prefixlen = 32; in test_lpm_ipaddr()
391 inet_pton(AF_INET, "192.168.128.23", key_ipv4->data); in test_lpm_ipaddr()
392 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == 0); in test_lpm_ipaddr()
395 inet_pton(AF_INET, "192.168.0.1", key_ipv4->data); in test_lpm_ipaddr()
396 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == 0); in test_lpm_ipaddr()
408 inet_pton(AF_INET, "10.0.0.1", key_ipv4->data); in test_lpm_ipaddr()
409 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == -1 && in test_lpm_ipaddr()
412 inet_pton(AF_INET, "11.11.11.11", key_ipv4->data); in test_lpm_ipaddr()
413 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == -1 && in test_lpm_ipaddr()