- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for getBitFromAddr (0.23 sec)
-
pkg/util/iptree/iptree.go
child.child[getBitFromAddr(n.prefix.Addr(), pos)] = n return false } // Case 2: existing node has the same mask but different base address // add common ancestor and branch on it ancestor := findAncestor(prefix, n.prefix) link := &node[T]{ prefix: ancestor, } pos := parent.prefix.Bits() + 1 parent.child[getBitFromAddr(ancestor.Addr(), pos)] = link
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Oct 31 21:05:04 UTC 2023 - 17.7K bytes - Viewed (0) -
pkg/util/iptree/iptree_test.go
ip: netip.MustParseAddr("2001:db8::ff00:42:8329"), pos: 128, want: 1, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if got := getBitFromAddr(tt.ip, tt.pos); got != tt.want { t.Errorf("getBitFromAddr() = %v, want %v", got, tt.want) } }) } } func TestShortestPrefix(t *testing.T) { r := New[int]() keys := []string{ "10.0.0.0/8",
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Oct 31 21:05:04 UTC 2023 - 17.8K bytes - Viewed (0)