2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2016-02-16 20:05:15 +01:00
|
|
|
#pragma once
|
|
|
|
|
2019-05-10 17:02:58 +02:00
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <linux/if_bridge.h>
|
|
|
|
|
|
|
|
#include "conf-parser.h"
|
|
|
|
#include "netdev.h"
|
2014-07-06 14:07:34 +02:00
|
|
|
|
2020-10-28 15:49:05 +01:00
|
|
|
#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
|
|
|
|
#define LINK_BRIDGE_PORT_PRIORITY_MAX 63
|
|
|
|
|
2016-04-29 04:52:04 +02:00
|
|
|
typedef struct Bridge {
|
2014-07-16 13:17:10 +02:00
|
|
|
NetDev meta;
|
2015-10-05 06:08:00 +02:00
|
|
|
|
2016-04-18 13:45:52 +02:00
|
|
|
int mcast_querier;
|
2016-05-15 15:15:20 +02:00
|
|
|
int mcast_snooping;
|
2016-05-30 17:00:16 +02:00
|
|
|
int vlan_filtering;
|
2020-03-20 16:09:36 +01:00
|
|
|
int vlan_protocol;
|
2016-08-06 01:44:57 +02:00
|
|
|
int stp;
|
2016-08-31 20:06:23 +02:00
|
|
|
uint16_t priority;
|
2017-09-08 12:36:06 +02:00
|
|
|
uint16_t group_fwd_mask;
|
2016-08-31 20:06:23 +02:00
|
|
|
uint16_t default_pvid;
|
2019-07-24 14:58:57 +02:00
|
|
|
uint8_t igmp_version;
|
2016-04-18 13:45:52 +02:00
|
|
|
|
2015-10-05 06:08:00 +02:00
|
|
|
usec_t forward_delay;
|
|
|
|
usec_t hello_time;
|
|
|
|
usec_t max_age;
|
2016-08-31 20:06:23 +02:00
|
|
|
usec_t ageing_time;
|
2016-04-29 04:52:04 +02:00
|
|
|
} Bridge;
|
2014-07-16 13:17:10 +02:00
|
|
|
|
2019-05-10 17:02:58 +02:00
|
|
|
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;
|
|
|
|
|
2016-04-29 04:52:04 +02:00
|
|
|
DEFINE_NETDEV_CAST(BRIDGE, Bridge);
|
2014-07-06 14:07:34 +02:00
|
|
|
extern const NetDevVTable bridge_vtable;
|
2019-05-10 16:22:47 +02:00
|
|
|
|
|
|
|
int link_set_bridge(Link *link);
|
2019-05-10 17:02:58 +02:00
|
|
|
|
|
|
|
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);
|
2019-07-24 14:58:57 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bridge_igmp_version);
|
2020-10-28 15:49:05 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bridge_port_priority);
|