diff options
author | Susant Sahani <ssahani@vmware.com> | 2020-03-24 12:23:08 +0100 |
---|---|---|
committer | Susant Sahani <ssahani@vmware.com> | 2020-03-24 14:22:50 +0100 |
commit | af94bb24b59a2abc8d9f3ba6b5ba168372c9237c (patch) | |
tree | c1dfe707c9c3d552535b90118a8cb27a63e4177f /src/shared/bridge-util.h | |
parent | 12ef8fb6f17e7a31e19c7d85daab969468dd3258 (diff) | |
download | systemd-af94bb24b59a2abc8d9f3ba6b5ba168372c9237c.tar.gz |
shared: Introduce bridge util
Diffstat (limited to 'src/shared/bridge-util.h')
-rw-r--r-- | src/shared/bridge-util.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/shared/bridge-util.h b/src/shared/bridge-util.h new file mode 100644 index 0000000000..5b1c3e9ea9 --- /dev/null +++ b/src/shared/bridge-util.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include <netinet/in.h> +#include <linux/if_bridge.h> + +#include "conf-parser.h" + +typedef enum BridgeState { + NETDEV_BRIDGE_STATE_DISABLED = BR_STATE_DISABLED, + NETDEV_BRIDGE_STATE_LISTENING = BR_STATE_LISTENING, + NETDEV_BRIDGE_STATE_LEARNING = BR_STATE_LEARNING, + NETDEV_BRIDGE_STATE_FORWARDING = BR_STATE_FORWARDING, + NETDEV_BRIDGE_STATE_BLOCKING = BR_STATE_BLOCKING, + _NETDEV_BRIDGE_STATE_MAX, + _NETDEV_BRIDGE_STATE_INVALID = -1, +} BridgeState; + +const char *bridge_state_to_string(BridgeState d) _const_; +BridgeState bridge_state_from_string(const char *d) _pure_; |