filter.h (1139B)
1 #ifndef __LINKD_NETLINK_FILTER_H__ 2 #define __LINKD_NETLINK_FILTER_H__ 3 4 #include <stdbool.h> 5 #include <stdint.h> 6 7 // Single policy point for what the mirror replicates into the dataplane. 8 // 9 // v1 policy: accept-all-except-LOCAL at the route-type level, intersected with 10 // the tracked-table set so a management VRF never leaks into the ASIC. Both 11 // the event path and the dump path call into here -- there is no second copy 12 // of the policy. A future config (allow/deny lists) only extends this file's 13 // backing store. 14 15 void nl_filter_reset(void); 16 17 // Called on VRF-master discovery / removal (RTM_NEWLINK / DELLINK). 18 void nl_filter_track(uint32_t table); 19 void nl_filter_untrack(uint32_t table); 20 21 // Hard deny regardless of tracking. Used for the management VRF. 22 void nl_filter_exclude(uint32_t table); 23 24 // True when ifname looks like a management VRF (placeholder until the 25 // exclusion is config-driven; verified name lands here). 26 bool nl_filter_mgmt_name(const char *ifname); 27 28 bool nl_table_allowed(uint32_t table); 29 bool nl_route_allowed(int family, uint8_t type, uint8_t scope, uint32_t table); 30 31 #endif // __LINKD_NETLINK_FILTER_H__