Lines Matching refs:value

215 	uint8_t *data, *value;  in test_lpm_map()  local
231 value = alloca(keysize + 1); in test_lpm_map()
232 memset(value, 0, keysize + 1); in test_lpm_map()
246 value[j] = rand() & 0xff; in test_lpm_map()
247 value[keysize] = rand() % (8 * keysize + 1); in test_lpm_map()
249 list = tlpm_add(list, value, value[keysize]); in test_lpm_map()
251 key->prefixlen = value[keysize]; in test_lpm_map()
252 memcpy(key->data, value, keysize); in test_lpm_map()
253 r = bpf_map_update_elem(map, key, value, 0); in test_lpm_map()
265 r = bpf_map_lookup_elem(map, key, value); in test_lpm_map()
271 assert(t->n_bits == value[keysize]); in test_lpm_map()
274 (value[j / 8] & (1 << (7 - j % 8)))); in test_lpm_map()
302 r = bpf_map_lookup_elem(map, key, value); in test_lpm_map()
308 assert(t->n_bits == value[keysize]); in test_lpm_map()
311 (value[j / 8] & (1 << (7 - j % 8)))); in test_lpm_map()
340 __u64 value; in test_lpm_ipaddr() local
348 key_size_ipv4, sizeof(value), in test_lpm_ipaddr()
353 key_size_ipv6, sizeof(value), in test_lpm_ipaddr()
358 value = 1; in test_lpm_ipaddr()
361 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
363 value = 2; in test_lpm_ipaddr()
366 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
368 value = 3; in test_lpm_ipaddr()
371 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
373 value = 5; in test_lpm_ipaddr()
376 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
378 value = 4; in test_lpm_ipaddr()
381 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
383 value = 0xdeadbeef; in test_lpm_ipaddr()
386 assert(bpf_map_update_elem(map_fd_ipv6, key_ipv6, &value, 0) == 0); in test_lpm_ipaddr()
394 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == 0); in test_lpm_ipaddr()
395 assert(value == 3); in test_lpm_ipaddr()
398 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == 0); in test_lpm_ipaddr()
399 assert(value == 2); in test_lpm_ipaddr()
402 assert(bpf_map_lookup_elem(map_fd_ipv6, key_ipv6, &value) == 0); in test_lpm_ipaddr()
403 assert(value == 0xdeadbeef); in test_lpm_ipaddr()
406 assert(bpf_map_lookup_elem(map_fd_ipv6, key_ipv6, &value) == 0); in test_lpm_ipaddr()
407 assert(value == 0xdeadbeef); in test_lpm_ipaddr()
411 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == -ENOENT); in test_lpm_ipaddr()
414 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == -ENOENT); in test_lpm_ipaddr()
417 assert(bpf_map_lookup_elem(map_fd_ipv6, key_ipv6, &value) == -ENOENT); in test_lpm_ipaddr()
429 __u64 value; in test_lpm_delete() local
435 key_size, sizeof(value), in test_lpm_delete()
451 value = 1; in test_lpm_delete()
454 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete()
456 value = 2; in test_lpm_delete()
459 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete()
461 value = 3; in test_lpm_delete()
464 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete()
466 value = 4; in test_lpm_delete()
469 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete()
474 assert(bpf_map_lookup_elem(map_fd, key, &value) == -ENOENT); in test_lpm_delete()
487 assert(bpf_map_lookup_elem(map_fd, key, &value) == 0); in test_lpm_delete()
488 assert(value == 2); in test_lpm_delete()
497 assert(bpf_map_lookup_elem(map_fd, key, &value) == 0); in test_lpm_delete()
498 assert(value == 1); in test_lpm_delete()
507 assert(bpf_map_lookup_elem(map_fd, key, &value) == 0); in test_lpm_delete()
508 assert(value == 1); in test_lpm_delete()
517 assert(bpf_map_lookup_elem(map_fd, key, &value) == 0); in test_lpm_delete()
518 assert(value == 3); in test_lpm_delete()
527 assert(bpf_map_lookup_elem(map_fd, key, &value) == -ENOENT); in test_lpm_delete()
537 __u32 value = 0; in test_lpm_get_next_key() local
544 map_fd = bpf_map_create(BPF_MAP_TYPE_LPM_TRIE, NULL, key_size, sizeof(value), 100, &opts); in test_lpm_get_next_key()
553 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
571 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
589 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
612 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
640 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
709 __u32 value = j; in lpm_test_command() local
711 assert(bpf_map_update_elem(info->map_fd, key_p, &value, 0) == 0); in lpm_test_command()
716 __u32 value; in lpm_test_command() local
717 ret = bpf_map_lookup_elem(info->map_fd, key_p, &value); in lpm_test_command()