File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed
Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ /* SPDX-License-Identifier: LGPL-2.1+ */
2+
3+ #include "bridge-util.h"
4+ #include "string-table.h"
5+
6+ static const char * const bridge_state_table [_NETDEV_BRIDGE_STATE_MAX ] = {
7+ [NETDEV_BRIDGE_STATE_DISABLED ] = "disabled" ,
8+ [NETDEV_BRIDGE_STATE_LISTENING ] = "listening" ,
9+ [NETDEV_BRIDGE_STATE_LEARNING ] = "learning" ,
10+ [NETDEV_BRIDGE_STATE_FORWARDING ] = "forwading" ,
11+ };
12+
13+ DEFINE_STRING_TABLE_LOOKUP (bridge_state , BridgeState );
Original file line number Diff line number Diff line change 1+ /* SPDX-License-Identifier: LGPL-2.1+ */
2+ #pragma once
3+
4+ #include <netinet/in.h>
5+ #include <linux/if_bridge.h>
6+
7+ #include "conf-parser.h"
8+
9+ typedef enum BridgeState {
10+ NETDEV_BRIDGE_STATE_DISABLED = BR_STATE_DISABLED ,
11+ NETDEV_BRIDGE_STATE_LISTENING = BR_STATE_LISTENING ,
12+ NETDEV_BRIDGE_STATE_LEARNING = BR_STATE_LEARNING ,
13+ NETDEV_BRIDGE_STATE_FORWARDING = BR_STATE_FORWARDING ,
14+ NETDEV_BRIDGE_STATE_BLOCKING = BR_STATE_BLOCKING ,
15+ _NETDEV_BRIDGE_STATE_MAX ,
16+ _NETDEV_BRIDGE_STATE_INVALID = -1 ,
17+ } BridgeState ;
18+
19+ const char * bridge_state_to_string (BridgeState d ) _const_ ;
20+ BridgeState bridge_state_from_string (const char * d ) _pure_ ;
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ shared_sources = files('''
2121 bootspec.h
2222 bpf-program.c
2323 bpf-program.h
24+ bridge-util.c
25+ bridge-util.h
2426 bus-unit-procs.c
2527 bus-unit-procs.h
2628 bus-unit-util.c
You can’t perform that action at this time.
0 commit comments