Lines Matching +full:0 +full:x1234
26 memset(dst + (cidr + 7) / 8, 0, bits / 8 - (cidr + 7) / 8); in swap_endian_and_apply_cidr()
28 dst[(cidr + 7) / 8 - 1] &= ~0U << ((8 - (cidr % 8)) % 8); in swap_endian_and_apply_cidr()
38 u32 color = 0; in print_node()
50 hsiphash_key_t key = { { 0 } }; in print_node()
53 color = hsiphash_1u32(0xdeadbeef, &key) % 200 << 16 | in print_node()
54 hsiphash_1u32(0xbabecafe, &key) % 200 << 8 | in print_node()
55 hsiphash_1u32(0xabad1dea, &key) % 200; in print_node()
60 if (node->bit[0]) { in print_node()
62 rcu_dereference_raw(node->bit[0])->bits, bits, in print_node()
65 rcu_dereference_raw(node->bit[0])->cidr); in print_node()
66 print_node(rcu_dereference_raw(node->bit[0]), bits); in print_node()
124 memset(&mask, 0x00, 128 / 8); in horrible_cidr_to_mask()
125 memset(&mask, 0xff, cidr / 8); in horrible_cidr_to_mask()
128 (0xFFFFFFFFUL << (32 - (cidr % 32))) & 0xFFFFFFFFUL); in horrible_cidr_to_mask()
134 return hweight32(subnet.all[0]) + hweight32(subnet.all[1]) + in horrible_mask_to_cidr()
144 node->ip.ip6[0] &= node->mask.ip6[0]; in horrible_mask_self()
162 return (ip->in6_u.u6_addr32[0] & node->mask.ip6[0]) == in horrible_match_v6()
163 node->ip.ip6[0] && in horrible_match_v6()
215 return 0; in horrible_allowedips_insert_v4()
233 return 0; in horrible_allowedips_insert_v6()
292 for (i = 0; i < NUM_PEERS; ++i) { in randomized_test()
303 for (i = 0; i < NUM_RAND_ROUTES; ++i) { in randomized_test()
308 peer, &mutex) < 0) { in randomized_test()
313 cidr, peer) < 0) { in randomized_test()
317 for (j = 0; j < NUM_MUTATED_ROUTES; ++j) { in randomized_test()
321 for (k = 0; k < mutate_amount / 8; ++k) in randomized_test()
322 mutate_mask[k] = 0xff; in randomized_test()
323 mutate_mask[k] = 0xff in randomized_test()
326 mutate_mask[k] = 0; in randomized_test()
327 for (k = 0; k < 4; ++k) in randomized_test()
335 cidr, peer, &mutex) < 0) { in randomized_test()
347 for (i = 0; i < NUM_RAND_ROUTES; ++i) { in randomized_test()
352 peer, &mutex) < 0) { in randomized_test()
357 cidr, peer) < 0) { in randomized_test()
361 for (j = 0; j < NUM_MUTATED_ROUTES; ++j) { in randomized_test()
365 for (k = 0; k < mutate_amount / 8; ++k) in randomized_test()
366 mutate_mask[k] = 0xff; in randomized_test()
367 mutate_mask[k] = 0xff in randomized_test()
370 mutate_mask[k] = 0; in randomized_test()
371 for (k = 0; k < 4; ++k) in randomized_test()
379 cidr, peer, &mutex) < 0) { in randomized_test()
399 for (i = 0; i < NUM_QUERIES; ++i) { in randomized_test()
408 for (i = 0; i < NUM_QUERIES; ++i) { in randomized_test()
425 for (i = 0; i < NUM_PEERS; ++i) in randomized_test()
437 split[0] = a; in ip4()
449 split[0] = cpu_to_be32(a); in ip6()
477 } while (0)
483 } while (0)
489 } while (0)
494 } while (0)
508 size_t i = 0, count = 0; in wg_allowedips_selftest()
520 insert(4, a, 192, 168, 4, 0, 24); in wg_allowedips_selftest()
522 insert(4, c, 192, 168, 0, 0, 16); in wg_allowedips_selftest()
526 insert(6, d, 0x26075300, 0x60006b00, 0, 0xc05f0543, 128); in wg_allowedips_selftest()
527 insert(6, c, 0x26075300, 0x60006b00, 0, 0, 64); in wg_allowedips_selftest()
528 insert(4, e, 0, 0, 0, 0, 0); in wg_allowedips_selftest()
529 insert(6, e, 0, 0, 0, 0, 0); in wg_allowedips_selftest()
531 insert(6, f, 0, 0, 0, 0, 0); in wg_allowedips_selftest()
532 insert(6, g, 0x24046800, 0, 0, 0, 32); in wg_allowedips_selftest()
534 insert(6, h, 0x24046800, 0x40040800, 0xdeadbeef, 0xdeadbeef, 64); in wg_allowedips_selftest()
535 insert(6, a, 0x24046800, 0x40040800, 0xdeadbeef, 0xdeadbeef, 128); in wg_allowedips_selftest()
536 insert(6, c, 0x24446800, 0x40e40800, 0xdeaebeef, 0xdefbeef, 128); in wg_allowedips_selftest()
537 insert(6, b, 0x24446800, 0xf0e40800, 0xeeaebeef, 0, 98); in wg_allowedips_selftest()
538 insert(4, g, 64, 15, 112, 0, 20); in wg_allowedips_selftest()
541 insert(4, a, 10, 0, 0, 0, 25); in wg_allowedips_selftest()
542 insert(4, b, 10, 0, 0, 128, 25); in wg_allowedips_selftest()
543 insert(4, a, 10, 1, 0, 0, 30); in wg_allowedips_selftest()
544 insert(4, b, 10, 1, 0, 4, 30); in wg_allowedips_selftest()
545 insert(4, c, 10, 1, 0, 8, 29); in wg_allowedips_selftest()
546 insert(4, d, 10, 1, 0, 16, 29); in wg_allowedips_selftest()
556 test(4, a, 192, 168, 4, 0); in wg_allowedips_selftest()
561 test(6, d, 0x26075300, 0x60006b00, 0, 0xc05f0543); in wg_allowedips_selftest()
562 test(6, c, 0x26075300, 0x60006b00, 0, 0xc02e01ee); in wg_allowedips_selftest()
563 test(6, f, 0x26075300, 0x60006b01, 0, 0); in wg_allowedips_selftest()
564 test(6, g, 0x24046800, 0x40040806, 0, 0x1006); in wg_allowedips_selftest()
565 test(6, g, 0x24046800, 0x40040806, 0x1234, 0x5678); in wg_allowedips_selftest()
566 test(6, f, 0x240467ff, 0x40040806, 0x1234, 0x5678); in wg_allowedips_selftest()
567 test(6, f, 0x24046801, 0x40040806, 0x1234, 0x5678); in wg_allowedips_selftest()
568 test(6, h, 0x24046800, 0x40040800, 0x1234, 0x5678); in wg_allowedips_selftest()
569 test(6, h, 0x24046800, 0x40040800, 0, 0); in wg_allowedips_selftest()
570 test(6, h, 0x24046800, 0x40040800, 0x10101010, 0x10101010); in wg_allowedips_selftest()
571 test(6, a, 0x24046800, 0x40040800, 0xdeadbeef, 0xdeadbeef); in wg_allowedips_selftest()
577 test(4, a, 10, 0, 0, 52); in wg_allowedips_selftest()
578 test(4, b, 10, 0, 0, 220); in wg_allowedips_selftest()
579 test(4, a, 10, 1, 0, 2); in wg_allowedips_selftest()
580 test(4, b, 10, 1, 0, 6); in wg_allowedips_selftest()
581 test(4, c, 10, 1, 0, 10); in wg_allowedips_selftest()
582 test(4, d, 10, 1, 0, 20); in wg_allowedips_selftest()
584 insert(4, a, 1, 0, 0, 0, 32); in wg_allowedips_selftest()
585 insert(4, a, 64, 0, 0, 0, 32); in wg_allowedips_selftest()
586 insert(4, a, 128, 0, 0, 0, 32); in wg_allowedips_selftest()
587 insert(4, a, 192, 0, 0, 0, 32); in wg_allowedips_selftest()
588 insert(4, a, 255, 0, 0, 0, 32); in wg_allowedips_selftest()
590 test_negative(4, a, 1, 0, 0, 0); in wg_allowedips_selftest()
591 test_negative(4, a, 64, 0, 0, 0); in wg_allowedips_selftest()
592 test_negative(4, a, 128, 0, 0, 0); in wg_allowedips_selftest()
593 test_negative(4, a, 192, 0, 0, 0); in wg_allowedips_selftest()
594 test_negative(4, a, 255, 0, 0, 0); in wg_allowedips_selftest()
598 insert(4, a, 192, 168, 0, 0, 16); in wg_allowedips_selftest()
599 insert(4, a, 192, 168, 0, 0, 24); in wg_allowedips_selftest()
601 test_negative(4, a, 192, 168, 0, 1); in wg_allowedips_selftest()
606 for (i = 0; i < 128; ++i) { in wg_allowedips_selftest()
608 memset(&ip, 0xff, 16); in wg_allowedips_selftest()
617 insert(6, a, 0x26075300, 0x60006b00, 0, 0xc05f0543, 128); in wg_allowedips_selftest()
618 insert(4, a, 10, 1, 0, 20, 29); in wg_allowedips_selftest()
619 insert(6, a, 0x26075300, 0x6d8a6bf8, 0xdab1f1df, 0xc05f1523, 83); in wg_allowedips_selftest()
620 insert(6, a, 0x26075300, 0x6d8a6bf8, 0xdab1f1df, 0xc05f1523, 21); in wg_allowedips_selftest()
631 !memcmp(ip, ip6(0x26075300, 0x60006b00, 0, 0xc05f0543), in wg_allowedips_selftest()
635 !memcmp(ip, ip4(10, 1, 0, 16), sizeof(struct in_addr))) in wg_allowedips_selftest()
638 !memcmp(ip, ip6(0x26075300, 0x6d8a6bf8, 0xdab1e000, 0), in wg_allowedips_selftest()
642 !memcmp(ip, ip6(0x26075000, 0, 0, 0), in wg_allowedips_selftest()