15 #ifndef __included_lacp_node_h__ 16 #define __included_lacp_node_h__ 46 #define LACP_DBG(n, args...) \ 48 lacp_main_t *_lm = &lacp_main; \ 49 if (_lm->debug || n->debug) \ 50 clib_warning (args); \ 53 #define LACP_DBG2(n, e, s, m, t) \ 55 lacp_main_t *_lm = &lacp_main; \ 56 if ((m)->debug && (_lm->debug || (n)->debug)) \ 57 (*m->debug)(n, e, s, t); \ 61 #define foreach_lacp_error \ 62 _ (NONE, "good lacp packets -- consumed") \ 63 _ (CACHE_HIT, "good lacp packets -- cache hit") \ 64 _ (UNSUPPORTED, "unsupported slow protocol packets") \ 65 _ (TOO_SMALL, "bad lacp packets -- packet too small") \ 66 _ (BAD_TLV, "bad lacp packets -- bad TLV length") \ 67 _ (DISABLED, "lacp packets received on disabled interfaces") 71 #define _(sym,str) LACP_ERROR_##sym, 77 #define SECS_IN_A_DAY 86400.0 95 u8 interface_name[64];
100 u8 bond_interface_name[64];
108 u8 partner_system[6];
150 u16 port_number,
u32 group);
168 return (timer != 0.0);
176 return (now >= timer);
183 #define _(b, s, n) {.bit = b, .str = #s, }, 188 int state = va_arg (*args,
int);
191 if (state >= (
sizeof (lacp_rx_sm_state_array) /
sizeof (*state_entry)))
192 s =
format (s,
"Bad state %d", state);
194 s =
format (s,
"%s", state_entry[state].str);
203 #define _(b, s, n) {.bit = b, .str = #s, }, 208 int state = va_arg (*args,
int);
211 if (state >= (
sizeof (lacp_tx_sm_state_array) /
sizeof (*state_entry)))
212 s =
format (s,
"Bad state %d", state);
214 s =
format (s,
"%s", state_entry[state].str);
223 #define _(b, s, n) {.bit = b, .str = #s, }, 228 int state = va_arg (*args,
int);
231 if (state >= (
sizeof (lacp_mux_sm_state_array) /
sizeof (*state_entry)))
232 s =
format (s,
"Bad state %d", state);
234 s =
format (s,
"%s", state_entry[state].str);
243 #define _(b, s, n) {.bit = b, .str = #s, }, 248 int state = va_arg (*args,
int);
251 if (state >= (
sizeof (lacp_ptx_sm_state_array) /
sizeof (*state_entry)))
252 s =
format (s,
"Bad state %d", state);
254 s =
format (s,
"%s", state_entry[state].str);
262 if (val & (1 << bit))
void lacp_periodic(vlib_main_t *vm)
void lacp_init_ptx_machine(vlib_main_t *vm, slave_if_t *sif)
static f64 vlib_time_now(vlib_main_t *vm)
int lacp_dump_ifs(lacp_interface_details_t **out_bondids)
u16 partner_system_priority
void lacp_init_neighbor(slave_if_t *sif, u8 *hw_address, u16 port_number, u32 group)
void lacp_init_mux_machine(vlib_main_t *vm, slave_if_t *sif)
static u8 * format_rx_sm_state(u8 *s, va_list *args)
static u8 lacp_timer_is_running(f64 timer)
static u8 lacp_timer_is_expired(vlib_main_t *vm, f64 timer)
lacp_error_t lacp_input(vlib_main_t *vm, vlib_buffer_t *b0, u32 bi0)
u16 partner_port_priority
LACP interface details struct.
static void lacp_stop_timer(f64 *timer)
void lacp_create_periodic_process(void)
lacp_packet_template_id_t
static u8 * format_mux_sm_state(u8 *s, va_list *args)
void lacp_init_rx_machine(vlib_main_t *vm, slave_if_t *sif)
void lacp_send_lacp_pdu(vlib_main_t *vm, slave_if_t *sif)
#define foreach_lacp_error
static u8 * format_ptx_sm_state(u8 *s, va_list *args)
void lacp_init_tx_machine(vlib_main_t *vm, slave_if_t *sif)
void lacp_selection_logic(vlib_main_t *vm, slave_if_t *sif)
u8 * lacp_input_format_trace(u8 *s, va_list *args)
u32 lacp_process_node_index
u16 actor_system_priority
VLIB buffer representation.
void lacp_init_state_machines(vlib_main_t *vm, slave_if_t *sif)
static int lacp_bit_test(u8 val, u8 bit)
clib_error_t * lacp_plugin_api_hookup(vlib_main_t *vm)
vl_api_dhcp_client_state_t state
static u8 * format_tx_sm_state(u8 *s, va_list *args)
u16 msg_id_base
API message ID base.
marker_packet_template_id_t