netlink.h (845B)
1 #ifndef __LINKD_NETLINK_H__ 2 #define __LINKD_NETLINK_H__ 3 4 #include <stdint.h> 5 6 // Raw NETLINK_ROUTE mirror. No libnl/libmnl dependency by design. 7 // 8 // Ownership: nl_run() resolves dp_active() on every dispatch, never caches it. 9 // The VRF map (master table ids, member enslavement) stays inside netlink.c; 10 // only the numeric table id crosses struct dp_ops. 11 12 int nl_open(void); // bound NETLINK_ROUTE fd, or -1 13 int nl_run(int fd, int resync_interval_s); // poll loop; 0 on stop, -1 on fatal 14 void nl_request_stop(void); // async-signal-safe stop flag 15 int nl_dump(int fd, uint16_t type, int family); // one GET*+DUMP, replies via handle_nlmsg 16 int nl_resync(int fd); // filter_reset + dumps + dp resync; 0 ok, -1 fail 17 18 #endif // __LINKD_NETLINK_H__