Add RouteListFilteredIter API.

Allows for listing large numbers of routes without
buffering the whole list in memory at once.

Add benchmarks for RouteListFiltered variants.
This commit is contained in:
Shaun Crampton
2024-04-09 10:04:24 +01:00
committed by Alessandro Boch
parent b7b7ca8632
commit b54f85093f
4 changed files with 263 additions and 58 deletions

View File

@@ -23,7 +23,7 @@ import (
type tearDownNetlinkTest func()
func skipUnlessRoot(t *testing.T) {
func skipUnlessRoot(t testing.TB) {
t.Helper()
if os.Getuid() != 0 {
@@ -53,7 +53,7 @@ func skipUnlessKModuleLoaded(t *testing.T, module ...string) {
}
}
func setUpNetlinkTest(t *testing.T) tearDownNetlinkTest {
func setUpNetlinkTest(t testing.TB) tearDownNetlinkTest {
skipUnlessRoot(t)
// new temporary namespace so we don't pollute the host