summaryrefslogtreecommitdiff
path: root/src/network/netdev
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-05-11 00:02:58 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-05-11 06:24:04 +0900
commit8e2cb51ce042d582e9ba59c47f7e825b0e8db6e3 (patch)
treecf51b15909427a0aedfea36e3ff981eded26f20d /src/network/netdev
parent86e2be7bc3e0707f70f85642191d94e87097cace (diff)
downloadsystemd-8e2cb51ce042d582e9ba59c47f7e825b0e8db6e3.tar.gz
network: move MulticastRouter to netdev/bridge.[ch]
Diffstat (limited to 'src/network/netdev')
-rw-r--r--src/network/netdev/bridge.c12
-rw-r--r--src/network/netdev/bridge.h20
2 files changed, 31 insertions, 1 deletions
diff --git a/src/network/netdev/bridge.c b/src/network/netdev/bridge.c
index 54390cad0e..f20130d264 100644
--- a/src/network/netdev/bridge.c
+++ b/src/network/netdev/bridge.c
@@ -7,8 +7,20 @@
#include "netdev/bridge.h"
#include "network-internal.h"
#include "networkd-manager.h"
+#include "string-table.h"
#include "vlan-util.h"
+static const char* const multicast_router_table[_MULTICAST_ROUTER_MAX] = {
+ [MULTICAST_ROUTER_NONE] = "no",
+ [MULTICAST_ROUTER_TEMPORARY_QUERY] = "query",
+ [MULTICAST_ROUTER_PERMANENT] = "permanent",
+ [MULTICAST_ROUTER_TEMPORARY] = "temporary",
+};
+
+DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(multicast_router, MulticastRouter, _MULTICAST_ROUTER_INVALID);
+DEFINE_CONFIG_PARSE_ENUM(config_parse_multicast_router, multicast_router, MulticastRouter,
+ "Failed to parse bridge multicast router setting");
+
/* callback for bridge netdev's parameter set */
static int netdev_bridge_set_handler(sd_netlink *rtnl, sd_netlink_message *m, NetDev *netdev) {
int r;
diff --git a/src/network/netdev/bridge.h b/src/network/netdev/bridge.h
index b03084790a..2954155c37 100644
--- a/src/network/netdev/bridge.h
+++ b/src/network/netdev/bridge.h
@@ -1,7 +1,11 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-#include "netdev/netdev.h"
+#include <netinet/in.h>
+#include <linux/if_bridge.h>
+
+#include "conf-parser.h"
+#include "netdev.h"
typedef struct Bridge {
NetDev meta;
@@ -20,7 +24,21 @@ typedef struct Bridge {
usec_t ageing_time;
} Bridge;
+typedef enum MulticastRouter {
+ MULTICAST_ROUTER_NONE = MDB_RTR_TYPE_DISABLED,
+ MULTICAST_ROUTER_TEMPORARY_QUERY = MDB_RTR_TYPE_TEMP_QUERY,
+ MULTICAST_ROUTER_PERMANENT = MDB_RTR_TYPE_PERM,
+ MULTICAST_ROUTER_TEMPORARY = MDB_RTR_TYPE_TEMP,
+ _MULTICAST_ROUTER_MAX,
+ _MULTICAST_ROUTER_INVALID = -1,
+} MulticastRouter;
+
DEFINE_NETDEV_CAST(BRIDGE, Bridge);
extern const NetDevVTable bridge_vtable;
int link_set_bridge(Link *link);
+
+const char* multicast_router_to_string(MulticastRouter i) _const_;
+MulticastRouter multicast_router_from_string(const char *s) _pure_;
+
+CONFIG_PARSER_PROTOTYPE(config_parse_multicast_router);