6#ifndef NETLINK_LINK_BRIDGE_H_
7#define NETLINK_LINK_BRIDGE_H_
9#include <netlink/netlink.h>
10#include <netlink/route/link.h>
16#define RTNL_LINK_BRIDGE_VLAN_BITMAP_MAX 4096
17#define RTNL_LINK_BRIDGE_VLAN_BITMAP_LEN (RTNL_LINK_BRIDGE_VLAN_BITMAP_MAX / 32)
22 uint32_t vlan_bitmap[RTNL_LINK_BRIDGE_VLAN_BITMAP_LEN];
23 uint32_t untagged_bitmap[RTNL_LINK_BRIDGE_VLAN_BITMAP_LEN];
31 RTNL_BRIDGE_HAIRPIN_MODE = 0x0001,
32 RTNL_BRIDGE_BPDU_GUARD = 0x0002,
33 RTNL_BRIDGE_ROOT_BLOCK = 0x0004,
34 RTNL_BRIDGE_FAST_LEAVE = 0x0008,
35 RTNL_BRIDGE_UNICAST_FLOOD = 0x0010,
36 RTNL_BRIDGE_LEARNING = 0x0020,
37 RTNL_BRIDGE_LEARNING_SYNC = 0x0040,
40#define RTNL_BRIDGE_HWMODE_VEB BRIDGE_MODE_VEB
41#define RTNL_BRIDGE_HWMODE_VEPA BRIDGE_MODE_VEPA
42#define RTNL_BRIDGE_HWMODE_MAX BRIDGE_MODE_VEPA
43#define RTNL_BRIDGE_HWMODE_UNDEF BRIDGE_MODE_UNDEF
68extern char * rtnl_link_bridge_flags2str(
int,
char *,
size_t);
69extern int rtnl_link_bridge_str2flags(
const char *);
71extern char * rtnl_link_bridge_portstate2str(
int,
char *,
size_t);
72extern int rtnl_link_bridge_str2portstate(
const char *);
74extern char * rtnl_link_bridge_hwmode2str(uint16_t,
char *,
size_t);
75extern uint16_t rtnl_link_bridge_str2hwmode(
const char *);
79extern int rtnl_link_bridge_pvid(
struct rtnl_link *link);
80extern int rtnl_link_bridge_has_vlan(
struct rtnl_link *link);
int rtnl_link_bridge_set_cost(struct rtnl_link *, uint32_t)
Set Spanning Tree Protocol (STP) path cost.
int rtnl_link_bridge_get_port_state(struct rtnl_link *)
Get Spanning Tree Protocol (STP) port state.
int rtnl_link_bridge_set_hwmode(struct rtnl_link *, uint16_t)
Set hardware mode.
rtnl_link_bridge_flags
Bridge flags.
int rtnl_link_bridge_has_ext_info(struct rtnl_link *)
Check if bridge has extended information.
int rtnl_link_bridge_add(struct nl_sock *sk, const char *name)
Create a new kernel bridge device.
int rtnl_link_is_bridge(struct rtnl_link *)
Check if a link is a bridge.
int rtnl_link_bridge_set_port_state(struct rtnl_link *, uint8_t)
Set Spanning Tree Protocol (STP) port state.
int rtnl_link_bridge_set_self(struct rtnl_link *)
Set link change type to self.
struct rtnl_link * rtnl_link_bridge_alloc(void)
Allocate link object of type bridge.
int rtnl_link_bridge_get_hwmode(struct rtnl_link *, uint16_t *)
Get hardware mode.
int rtnl_link_bridge_get_flags(struct rtnl_link *)
Get flags.
int rtnl_link_bridge_get_cost(struct rtnl_link *, uint32_t *)
Get Spanning Tree Protocol (STP) path cost.
int rtnl_link_bridge_get_priority(struct rtnl_link *)
Get priority.
int rtnl_link_bridge_unset_flags(struct rtnl_link *, unsigned int)
Unset flags.
int rtnl_link_bridge_set_priority(struct rtnl_link *, uint16_t)
Set priority.
int rtnl_link_bridge_set_flags(struct rtnl_link *, unsigned int)
Set flags.