FD.io VPP
v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
mux_machine.h
Go to the documentation of this file.
1
/*
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:
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
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.
14
*/
15
16
#ifndef __LACP_MUX_MACHINE_H__
17
#define __LACP_MUX_MACHINE_H__
18
19
#include <stdint.h>
20
#include <
lacp/machine.h
>
21
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") \
28
_(5, SYNC, "sync")
29
30
typedef
enum
31
{
32
#define _(a, b, c) LACP_MUX_EVENT_##b = (a),
33
foreach_lacp_mux_event
34
#undef _
35
}
lacp_mux_event_t
;
36
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")
42
43
typedef
enum
44
{
45
#define _(a, b, c) LACP_MUX_STATE_##b = (a),
46
foreach_lacp_mux_sm_state
47
#undef _
48
}
lacp_mux_sm_state_t
;
49
50
extern
lacp_machine_t
lacp_mux_machine
;
51
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);
58
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)
64
65
static
inline
void
66
lacp_start_wait_while_timer
(
vlib_main_t
*
vm
,
slave_if_t
* sif,
67
u8
expiration)
68
{
69
sif->
wait_while_timer
=
vlib_time_now
(vm) + expiration;
70
}
71
72
#endif
/* __LACP_MUX_MACHINE_H__ */
73
74
/*
75
* fd.io coding-style-patch-verification: ON
76
*
77
* Local Variables:
78
* eval: (c-set-style "gnu")
79
* End:
80
*/
lacp_start_wait_while_timer
static void lacp_start_wait_while_timer(vlib_main_t *vm, slave_if_t *sif, u8 expiration)
Definition:
mux_machine.h:66
lacp_mux_action_collecting_distributing
int lacp_mux_action_collecting_distributing(void *p1, void *p2)
Definition:
mux_machine.c:170
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition:
main.h:255
foreach_lacp_mux_sm_state
#define foreach_lacp_mux_sm_state
Definition:
mux_machine.h:37
u8
unsigned char u8
Definition:
types.h:56
lacp_mux_action_attached
int lacp_mux_action_attached(void *p1, void *p2)
Definition:
mux_machine.c:122
lacp_mux_debug_func
void lacp_mux_debug_func(slave_if_t *sif, int event, int state, lacp_fsm_state_t *transition)
Definition:
mux_machine.c:213
lacp_mux_sm_state_t
lacp_mux_sm_state_t
Definition:
mux_machine.h:43
state
vhost_vring_state_t state
Definition:
vhost_user.h:120
foreach_lacp_mux_event
#define foreach_lacp_mux_event
Definition:
mux_machine.h:22
lacp_mux_machine
lacp_machine_t lacp_mux_machine
Definition:
mux_machine.c:77
slave_if_t
Definition:
node.h:190
vm
vlib_main_t * vm
Definition:
buffer.c:312
lacp_mux_action_waiting
int lacp_mux_action_waiting(void *p1, void *p2)
Definition:
mux_machine.c:148
lacp_fsm_state_t
Definition:
machine.h:26
lacp_mux_event_t
lacp_mux_event_t
Definition:
mux_machine.h:30
vlib_main_t
Definition:
main.h:68
machine.h
lacp_mux_action_detached
int lacp_mux_action_detached(void *p1, void *p2)
Definition:
mux_machine.c:97
slave_if_t::wait_while_timer
f64 wait_while_timer
Definition:
node.h:284
lacp_machine_t
Definition:
machine.h:40
src
plugins
lacp
mux_machine.h
Generated on Mon Jun 29 2020 12:02:13 for FD.io VPP by
1.8.13