#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;
/* 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;
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);
return 0;
}
-
-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");
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-#include <netinet/in.h>
-#include <linux/if_bridge.h>
-
#include "sd-bus.h"
#include "sd-device.h"
#include "conf-parser.h"
#include "dhcp-identifier.h"
#include "hashmap.h"
+#include "netdev/bridge.h"
#include "netdev/netdev.h"
#include "networkd-address-label.h"
#include "networkd-address.h"
_RADV_PREFIX_DELEGATION_INVALID = -1,
} RADVPrefixDelegation;
-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;
-
typedef struct Manager Manager;
struct Network {
CONFIG_PARSER_PROTOTYPE(config_parse_iaid);
CONFIG_PARSER_PROTOTYPE(config_parse_required_for_online);
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_max_attempts);
-CONFIG_PARSER_PROTOTYPE(config_parse_multicast_router);
/* Legacy IPv4LL support */
CONFIG_PARSER_PROTOTYPE(config_parse_ipv4ll);
const char* radv_prefix_delegation_to_string(RADVPrefixDelegation i) _const_;
RADVPrefixDelegation radv_prefix_delegation_from_string(const char *s) _pure_;
-
-const char* multicast_router_to_string(MulticastRouter i) _const_;
-MulticastRouter multicast_router_from_string(const char *s) _pure_;