Line data Source code
1 : #ifndef HEADER_fd_src_disco_netlink_fd_netlink_tile_private_h 2 : #define HEADER_fd_src_disco_netlink_fd_netlink_tile_private_h 3 : 4 : #include "../../waltz/ip/fd_netlink1.h" 5 : #include "../metrics/generated/fd_metrics_netlnk.h" 6 : #include "../../waltz/ip/fd_fib4.h" 7 : #include "../../waltz/mib/fd_dbl_buf.h" 8 : #include "../../waltz/mib/fd_netdev_tbl.h" 9 : #include "../../waltz/neigh/fd_neigh4_map.h" 10 : #include "../../waltz/neigh/fd_neigh4_probe.h" 11 : 12 : /* FD_NETLINK_TILE_CTX_MAGIC uniquely identifies a fd_netlink_tile_ctx_t. 13 : CHange this whenever the fd_netlink_tile_ctx_t struct changes. */ 14 : 15 0 : #define FD_NETLINK_TILE_CTX_MAGIC (0xec431bf97929c691UL) /* random */ 16 : 17 : struct fd_netlink_tile_ctx { 18 : ulong magic; /* ==FD_NETLINK_TILE_CTX_MAGIC */ 19 : 20 : fd_netlink_t nl_monitor[1]; 21 : fd_netlink_t nl_req[1]; 22 : 23 : /* Pending actions */ 24 : ulong action; 25 0 : # define FD_NET_TILE_ACTION_ROUTE4_UPDATE (1UL<<0) 26 0 : # define FD_NET_TILE_ACTION_LINK_UPDATE (1UL<<1) 27 0 : # define FD_NET_TILE_ACTION_NEIGH_UPDATE (1UL<<2) 28 : 29 : /* Rate limit link and route table changes (in ticks) */ 30 : long update_backoff; 31 : long route4_update_ts; 32 : long link_update_ts; 33 : 34 : /* Link table */ 35 : void * netdev_local; /* local mutable table */ 36 : ulong netdev_sz; /* size of netdev table */ 37 : fd_netdev_tbl_join_t netdev_tbl[1]; /* join to local mutable table */ 38 : fd_dbl_buf_t * netdev_buf; /* global immutable copy */ 39 : 40 : /* Route tables */ 41 : fd_fib4_t * fib4_local; 42 : fd_fib4_t * fib4_main; 43 : 44 : /* Neighbor table */ 45 : fd_neigh4_hmap_t neigh4[1]; 46 : uint neigh4_ifidx; 47 : long idle_cnt; 48 : 49 : /* Neighbor table prober */ 50 : fd_neigh4_prober_t prober[1]; 51 : 52 : struct { 53 : ulong link_full_syncs; 54 : ulong route_full_syncs; 55 : ulong update_cnt[ FD_METRICS_COUNTER_NETLNK_UPDATES_CNT ]; 56 : ulong neigh_solicits_sent; 57 : ulong neigh_solicits_fails; 58 : } metrics; 59 : }; 60 : 61 : typedef struct fd_netlink_tile_ctx fd_netlink_tile_ctx_t; 62 : 63 : #endif /* HEADER_fd_src_disco_netlink_fd_netlink_tile_private_h */