+def find_route(test, ip_addr, len, table_id=0, inet=AF_INET):
+ if inet == AF_INET:
+ s = 4
+ routes = test.vapi.ip_fib_dump()
+ else:
+ s = 16
+ routes = test.vapi.ip6_fib_dump()
+
+ route_addr = inet_pton(inet, ip_addr)
+ for e in routes:
+ if route_addr == e.address[:s] \
+ and len == e.address_length \
+ and table_id == e.table_id:
+ return True
+ return False
+
+