Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions base/cvd/allocd/net/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ cf_cc_library(
":netlink",
"//cuttlefish/posix:strerror",
"//cuttlefish/result",
"//linux_headers",
"@abseil-cpp//absl/strings",
],
)
Expand All @@ -44,6 +45,7 @@ cf_cc_test(
"//allocd/test:nft_messages_helper",
"//cuttlefish/result",
"//cuttlefish/result:result_matchers",
"//linux_headers",
],
)

Expand Down
1 change: 1 addition & 0 deletions base/cvd/allocd/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ cf_cc_library(
],
deps = [
"//allocd/net:netlink",
"//linux_headers",
"@googletest//:gtest",
],
)
95 changes: 95 additions & 0 deletions base/cvd/linux_headers/uapi/linux/if_link.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ enum {
IFLA_GRO_IPV4_MAX_SIZE,
IFLA_DPLL_PIN,
IFLA_MAX_PACING_OFFLOAD_HORIZON,
IFLA_NETNS_IMMUTABLE,
IFLA_HEADROOM,
IFLA_TAILROOM,
__IFLA_MAX
};

Expand Down Expand Up @@ -741,6 +744,11 @@ enum in6_addr_gen_mode {
* @IFLA_BR_FDB_MAX_LEARNED
* Set the number of max dynamically learned FDB entries for the current
* bridge.
*
* @IFLA_BR_STP_MODE
* Set the STP mode for the bridge, which controls how the bridge
* selects between userspace and kernel STP. The valid values are
* documented below in the ``BR_STP_MODE_*`` constants.
*/
enum {
IFLA_BR_UNSPEC,
Expand Down Expand Up @@ -793,11 +801,45 @@ enum {
IFLA_BR_MCAST_QUERIER_STATE,
IFLA_BR_FDB_N_LEARNED,
IFLA_BR_FDB_MAX_LEARNED,
IFLA_BR_STP_MODE,
__IFLA_BR_MAX,
};

#define IFLA_BR_MAX (__IFLA_BR_MAX - 1)

/**
* DOC: Bridge STP mode values
*
* @BR_STP_MODE_AUTO
* Default. The kernel invokes the ``/sbin/bridge-stp`` helper to hand
* the bridge to a userspace STP daemon (e.g. mstpd). Only attempted in
* the initial network namespace; in other namespaces this falls back to
* kernel STP.
*
* @BR_STP_MODE_USER
* Directly enable userspace STP (``BR_USER_STP``) without invoking the
* ``/sbin/bridge-stp`` helper. Works in any network namespace.
* Userspace is responsible for ensuring an STP daemon manages the
* bridge.
*
* @BR_STP_MODE_KERNEL
* Directly enable kernel STP (``BR_KERNEL_STP``) without invoking the
* helper.
*
* The mode controls how the bridge selects between userspace and kernel
* STP when STP is enabled via ``IFLA_BR_STP_STATE``. It can only be
* changed while STP is disabled (``IFLA_BR_STP_STATE`` == 0), returns
* ``-EBUSY`` otherwise. The default value is ``BR_STP_MODE_AUTO``.
*/
enum br_stp_mode {
BR_STP_MODE_AUTO,
BR_STP_MODE_USER,
BR_STP_MODE_KERNEL,
__BR_STP_MODE_MAX
};

#define BR_STP_MODE_MAX (__BR_STP_MODE_MAX - 1)

struct ifla_bridge_id {
__u8 prio[2];
__u8 addr[6]; /* ETH_ALEN */
Expand Down Expand Up @@ -1043,6 +1085,22 @@ enum {
* Note that this option only takes effect when *IFLA_BRPORT_NEIGH_SUPPRESS*
* is enabled for a given port.
*
* @IFLA_BRPORT_NEIGH_FORWARD_GRAT
* Controls whether gratuitous ARP packets and unsolicited Neighbor
* Advertisement packets are forwarded on a given port even when neighbor
* suppression is enabled.
* By default this flag is off, meaning gratuitous ARP and unsolicited NA
* packets will be suppressed when neighbor suppression is enabled.
* Setting this flag to on allows these packets to be forwarded even
* when *IFLA_BRPORT_NEIGH_SUPPRESS* or *IFLA_BRPORT_NEIGH_VLAN_SUPPRESS*
* is enabled.
*
* Note that this option only takes effect when *IFLA_BRPORT_NEIGH_SUPPRESS*
* or *IFLA_BRPORT_NEIGH_VLAN_SUPPRESS* is enabled for a given port.
* When *IFLA_BRPORT_NEIGH_VLAN_SUPPRESS* is set, this port-level flag is
* ignored and per-VLAN control is available via
* *BRIDGE_VLANDB_ENTRY_NEIGH_FORWARD_GRAT*.
*
* @IFLA_BRPORT_BACKUP_NHID
* The FDB nexthop object ID to attach to packets being redirected to a
* backup port that has VLAN tunnel mapping enabled (via the
Expand Down Expand Up @@ -1095,6 +1153,7 @@ enum {
IFLA_BRPORT_MCAST_MAX_GROUPS,
IFLA_BRPORT_NEIGH_VLAN_SUPPRESS,
IFLA_BRPORT_BACKUP_NHID,
IFLA_BRPORT_NEIGH_FORWARD_GRAT,
__IFLA_BRPORT_MAX
};
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
Expand Down Expand Up @@ -1293,6 +1352,11 @@ enum netkit_mode {
NETKIT_L3,
};

enum netkit_pairing {
NETKIT_DEVICE_PAIR,
NETKIT_DEVICE_SINGLE,
};

/* NETKIT_SCRUB_NONE leaves clearing skb->{mark,priority} up to
* the BPF program if attached. This also means the latter can
* consume the two fields if they were populated earlier.
Expand All @@ -1317,6 +1381,7 @@ enum {
IFLA_NETKIT_PEER_SCRUB,
IFLA_NETKIT_HEADROOM,
IFLA_NETKIT_TAILROOM,
IFLA_NETKIT_PAIRING,
__IFLA_NETKIT_MAX,
};
#define IFLA_NETKIT_MAX (__IFLA_NETKIT_MAX - 1)
Expand Down Expand Up @@ -1397,6 +1462,7 @@ enum {
IFLA_VXLAN_LOCALBYPASS,
IFLA_VXLAN_LABEL_POLICY, /* IPv6 flow label policy; ifla_vxlan_label_policy */
IFLA_VXLAN_RESERVED_BITS,
IFLA_VXLAN_MC_ROUTE,
__IFLA_VXLAN_MAX
};
#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
Expand Down Expand Up @@ -1438,6 +1504,10 @@ enum {
IFLA_GENEVE_TTL_INHERIT,
IFLA_GENEVE_DF,
IFLA_GENEVE_INNER_PROTO_INHERIT,
IFLA_GENEVE_PORT_RANGE,
IFLA_GENEVE_GRO_HINT,
IFLA_GENEVE_LOCAL,
IFLA_GENEVE_LOCAL6,
__IFLA_GENEVE_MAX
};
#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
Expand All @@ -1450,6 +1520,11 @@ enum ifla_geneve_df {
GENEVE_DF_MAX = __GENEVE_DF_END - 1,
};

struct ifla_geneve_port_range {
__be16 low;
__be16 high;
};

/* Bareudp section */
enum {
IFLA_BAREUDP_UNSPEC,
Expand Down Expand Up @@ -1527,6 +1602,8 @@ enum {
IFLA_BOND_MISSED_MAX,
IFLA_BOND_NS_IP6_TARGET,
IFLA_BOND_COUPLED_CONTROL,
IFLA_BOND_BROADCAST_NEIGH,
IFLA_BOND_LACP_STRICT,
__IFLA_BOND_MAX,
};

Expand Down Expand Up @@ -1555,6 +1632,9 @@ enum {
IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
IFLA_BOND_SLAVE_PRIO,
IFLA_BOND_SLAVE_ACTOR_PORT_PRIO,
IFLA_BOND_SLAVE_AD_CHURN_ACTOR_STATE,
IFLA_BOND_SLAVE_AD_CHURN_PARTNER_STATE,
__IFLA_BOND_SLAVE_MAX,
};

Expand Down Expand Up @@ -1979,4 +2059,19 @@ enum {

#define IFLA_DSA_MAX (__IFLA_DSA_MAX - 1)

/* OVPN section */

enum ovpn_mode {
OVPN_MODE_P2P,
OVPN_MODE_MP,
};

enum {
IFLA_OVPN_UNSPEC,
IFLA_OVPN_MODE,
__IFLA_OVPN_MAX,
};

#define IFLA_OVPN_MAX (__IFLA_OVPN_MAX - 1)

#endif /* _UAPI_LINUX_IF_LINK_H */
Loading
Loading