2 * Copyright (c) 2017 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef __LACP_RX_MACHINE_H__
17 #define __LACP_RX_MACHINE_H__
20 #include <lacp/machine.h>
22 #define foreach_lacp_rx_event \
23 _(0, BEGIN, "begin") \
24 _(1, PORT_DISABLED, "port disabled") \
25 _(2, PORT_MOVED, "port moved") \
26 _(3, LACP_ENABLED, "lacp enabled") \
27 _(4, LACP_DISABLED, "lacp disabled") \
28 _(5, PDU_RECEIVED, "pdu received") \
29 _(6, TIMER_EXPIRED, "timer expired")
33 #define _(a, b, c) LACP_RX_EVENT_##b = (a),
38 #define foreach_lacp_rx_sm_state \
39 _(0, INITIALIZE, "initialize") \
40 _(1, PORT_DISABLED, "port disabled") \
41 _(2, EXPIRED, "expired") \
42 _(3, LACP_DISABLED, "lacp disabled") \
43 _(4, DEFAULTED, "defaulted") \
44 _(5, CURRENT, "current")
48 #define _(a, b, c) LACP_RX_STATE_##b = (a),
49 foreach_lacp_rx_sm_state
53 extern lacp_machine_t lacp_rx_machine;
55 int lacp_rx_action_initialize (void *, void *);
56 int lacp_rx_action_port_disabled (void *, void *);
57 int lacp_rx_action_pdu_received (void *, void *);
58 int lacp_rx_action_expired (void *, void *);
59 int lacp_rx_action_lacp_disabled (void *, void *);
60 int lacp_rx_action_defaulted (void *, void *);
61 int lacp_rx_action_current (void *, void *);
62 void lacp_rx_debug_func (slave_if_t * sif, int event, int state,
63 lacp_fsm_state_t * transition);
65 #define LACP_ACTION_INITIALIZE \
66 LACP_ACTION_ROUTINE(lacp_rx_action_initialize)
67 #define LACP_ACTION_PORT_DISABLED \
68 LACP_ACTION_ROUTINE(lacp_rx_action_port_disabled)
69 #define LACP_ACTION_EXPIRED \
70 LACP_ACTION_ROUTINE(lacp_rx_action_expired)
71 #define LACP_ACTION_LACP_DISABLED \
72 LACP_ACTION_ROUTINE(lacp_rx_action_lacp_disabled)
73 #define LACP_ACTION_DEFAULTED LACP_ACTION_ROUTINE(lacp_rx_action_defaulted)
74 #define LACP_ACTION_CURRENT LACP_ACTION_ROUTINE(lacp_rx_action_current)
77 lacp_start_current_while_timer (vlib_main_t * vm, slave_if_t * sif,
80 sif->current_while_timer = vlib_time_now (vm) + expiration;
83 #endif /* __LACP_RX_MACHINE_H__ */
86 * fd.io coding-style-patch-verification: ON
89 * eval: (c-set-style "gnu")