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_MUX_MACHINE_H__
17 #define __LACP_MUX_MACHINE_H__
20 #include <lacp/machine.h>
22 #define foreach_lacp_mux_event \
23 _(0, BEGIN, "begin") \
24 _(1, SELECTED, "selected") \
25 _(2, STANDBY, "standby") \
26 _(3, UNSELECTED, "unselected") \
27 _(4, READY, "ready") \
32 #define _(a, b, c) LACP_MUX_EVENT_##b = (a),
33 foreach_lacp_mux_event
37 #define foreach_lacp_mux_sm_state \
38 _(0, DETACHED, "detached") \
39 _(1, WAITING, "waiting") \
40 _(2, ATTACHED, "attached") \
41 _(3, COLLECTING_DISTRIBUTING, "collecting distributing")
45 #define _(a, b, c) LACP_MUX_STATE_##b = (a),
46 foreach_lacp_mux_sm_state
48 } lacp_mux_sm_state_t;
50 extern lacp_machine_t lacp_mux_machine;
52 int lacp_mux_action_detached (void *p1, void *p2);
53 int lacp_mux_action_attached (void *p1, void *p2);
54 int lacp_mux_action_waiting (void *p1, void *p2);
55 int lacp_mux_action_collecting_distributing (void *p1, void *p2);
56 void lacp_mux_debug_func (slave_if_t * sif, int event, int state,
57 lacp_fsm_state_t * transition);
59 #define LACP_ACTION_DETACHED LACP_ACTION_ROUTINE(lacp_mux_action_detached)
60 #define LACP_ACTION_ATTACHED LACP_ACTION_ROUTINE(lacp_mux_action_attached)
61 #define LACP_ACTION_WAITING LACP_ACTION_ROUTINE(lacp_mux_action_waiting)
62 #define LACP_ACTION_COLLECTING_DISTRIBUTING \
63 LACP_ACTION_ROUTINE(lacp_mux_action_collecting_distributing)
66 lacp_start_wait_while_timer (vlib_main_t * vm, slave_if_t * sif,
69 sif->wait_while_timer = vlib_time_now (vm) + expiration;
72 #endif /* __LACP_MUX_MACHINE_H__ */
75 * fd.io coding-style-patch-verification: ON
78 * eval: (c-set-style "gnu")