]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/network/netdev/bridge.h
tree-wide: use -EINVAL for enum invalid values
[thirdparty/systemd.git] / src / network / netdev / bridge.h
index 7fc993bb8d25ed3de1148f6eff6e66026427dfaa..459a5eed689fa306a76b09b2694d39338501f956 100644 (file)
@@ -1,26 +1,14 @@
-/* SPDX-License-Identifier: LGPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-/***
-  This file is part of systemd.
+#include <netinet/in.h>
+#include <linux/if_bridge.h>
 
-  Copyright 2014 Tom Gundersen <teg@jklm.no>
+#include "conf-parser.h"
+#include "netdev.h"
 
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include "netdev/netdev.h"
+#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
+#define LINK_BRIDGE_PORT_PRIORITY_MAX 63
 
 typedef struct Bridge {
         NetDev meta;
@@ -28,10 +16,12 @@ typedef struct Bridge {
         int mcast_querier;
         int mcast_snooping;
         int vlan_filtering;
+        int vlan_protocol;
         int stp;
         uint16_t priority;
         uint16_t group_fwd_mask;
         uint16_t default_pvid;
+        uint8_t igmp_version;
 
         usec_t forward_delay;
         usec_t hello_time;
@@ -39,5 +29,23 @@ 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 = -EINVAL,
+} 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);
+CONFIG_PARSER_PROTOTYPE(config_parse_bridge_igmp_version);
+CONFIG_PARSER_PROTOTYPE(config_parse_bridge_port_priority);