Line data Source code
1 : #ifndef HEADER_fd_src_waltz_neigh_fd_neigh4_map_h 2 : #define HEADER_fd_src_waltz_neigh_fd_neigh4_map_h 3 : 4 : /* fd_neigh4.h provides APIs for IPv4 neighbor discovery using ARP. */ 5 : 6 : #include "../../util/log/fd_log.h" /* fd_log_wallclock */ 7 : 8 : struct __attribute__((aligned(16))) fd_neigh4_entry { 9 : uint ip4_addr; 10 : uchar mac_addr[6]; /* MAC address */ 11 : uchar state; 12 : uchar _pad[1]; 13 : long probe_suppress_until; 14 : }; 15 : 16 : typedef struct fd_neigh4_entry fd_neigh4_entry_t; 17 : 18 0 : #define FD_NEIGH4_STATE_INCOMPLETE (0) 19 0 : #define FD_NEIGH4_STATE_ACTIVE (1) 20 : 21 : #include "fd_neigh4_map_defines.h" 22 : #define MAP_IMPL_STYLE 1 23 : #include "../../util/tmpl/fd_map_slot_para.c" 24 : 25 : FD_PROTOTYPES_BEGIN 26 : 27 : #if FD_HAS_HOSTED 28 : 29 : /* fd_neigh4_hmap_fprintf prints the routing table to the given FILE * 30 : pointer (or target equivalent). Order of routes is undefined but 31 : guaranteed to be stable between calls. Outputs ASCII encoding with LF 32 : newlines. Returns errno on failure and 0 on success. Only works on 33 : ACTIVE tables. */ 34 : 35 : int 36 : fd_neigh4_hmap_fprintf( fd_neigh4_hmap_t const * map, 37 : void * file ); 38 : 39 : #endif /* FD_HAS_HOSTED */ 40 : 41 : FD_PROTOTYPES_END 42 : 43 : #endif /* HEADER_fd_src_waltz_neigh_fd_neigh4_map_h */