libnl 3.12.0
bonding.h
1/* SPDX-License-Identifier: LGPL-2.1-only */
2/*
3 * Copyright (c) 2011-2013 Thomas Graf <tgraf@suug.ch>
4 */
5
6#ifndef NETLINK_LINK_BONDING_H_
7#define NETLINK_LINK_BONDING_H_
8
9#include <netlink/netlink.h>
10#include <netlink/route/link.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16extern struct rtnl_link *rtnl_link_bond_alloc(void);
17
18extern int rtnl_link_is_bond(struct rtnl_link *);
19
20extern int rtnl_link_bond_add(struct nl_sock *, const char *,
21 struct rtnl_link *);
22
23extern int rtnl_link_bond_enslave_ifindex(struct nl_sock *, int, int);
24extern int rtnl_link_bond_enslave(struct nl_sock *, struct rtnl_link *,
25 struct rtnl_link *);
26
27extern int rtnl_link_bond_release_ifindex(struct nl_sock *, int);
28extern int rtnl_link_bond_release(struct nl_sock *, struct rtnl_link *);
29
30extern void rtnl_link_bond_set_mode(struct rtnl_link *link, uint8_t mode);
31extern int rtnl_link_bond_get_mode(struct rtnl_link *link, uint8_t *mode);
32
33extern void rtnl_link_bond_set_activeslave(struct rtnl_link *link, int active_slave);
34extern int rtnl_link_bond_get_activeslave(struct rtnl_link *link, int *active_slave);
35
36extern void rtnl_link_bond_set_hashing_type(struct rtnl_link *link, uint8_t type);
37extern int rtnl_link_bond_get_hashing_type(struct rtnl_link *link, uint8_t *type);
38
39extern void rtnl_link_bond_set_miimon(struct rtnl_link *link, uint32_t miimon);
40extern int rtnl_link_bond_get_miimon(struct rtnl_link *link, uint32_t *miimon);
41
42extern void rtnl_link_bond_set_min_links(struct rtnl_link *link, uint32_t min_links);
43extern int rtnl_link_bond_get_min_links(struct rtnl_link *link, uint32_t *min_links);
44
45#ifdef __cplusplus
46}
47#endif
48
49#endif
50
void rtnl_link_bond_set_mode(struct rtnl_link *link, uint8_t mode)
Set bond mode.
Definition bonding.c:254
void rtnl_link_bond_set_min_links(struct rtnl_link *link, uint32_t min_links)
Set the minimum number of member ports that must be up before marking the bond device as up.
Definition bonding.c:387
int rtnl_link_bond_get_min_links(struct rtnl_link *link, uint32_t *min_links)
Get the minimum number of member ports that must be up before marking the bond device as up.
Definition bonding.c:407
int rtnl_link_bond_get_miimon(struct rtnl_link *link, uint32_t *miimon)
Get MII monitoring interval.
Definition bonding.c:362
void rtnl_link_bond_set_activeslave(struct rtnl_link *link, int active_slave)
Set active slave for bond.
Definition bonding.c:210
int rtnl_link_bond_get_mode(struct rtnl_link *link, uint8_t *mode)
Get bond mode.
Definition bonding.c:274
int rtnl_link_bond_get_hashing_type(struct rtnl_link *link, uint8_t *type)
Get hashing type.
Definition bonding.c:318
int rtnl_link_bond_enslave_ifindex(struct nl_sock *, int, int)
Add a link to a bond (enslave)
Definition bonding.c:514
int rtnl_link_bond_add(struct nl_sock *, const char *, struct rtnl_link *)
Create a new kernel bonding device.
Definition bonding.c:468
struct rtnl_link * rtnl_link_bond_alloc(void)
Allocate link object of type bond.
Definition bonding.c:429
int rtnl_link_bond_enslave(struct nl_sock *, struct rtnl_link *, struct rtnl_link *)
Add a link to a bond (enslave)
Definition bonding.c:570
int rtnl_link_bond_release(struct nl_sock *, struct rtnl_link *)
Release a link from a bond.
Definition bonding.c:614
void rtnl_link_bond_set_hashing_type(struct rtnl_link *link, uint8_t type)
Set hashing type.
Definition bonding.c:298
int rtnl_link_is_bond(struct rtnl_link *)
Check if a link is a bond.
Definition bonding.c:496
int rtnl_link_bond_release_ifindex(struct nl_sock *, int)
Release a link from a bond.
Definition bonding.c:590
void rtnl_link_bond_set_miimon(struct rtnl_link *link, uint32_t miimon)
Set MII monitoring interval.
Definition bonding.c:342
int rtnl_link_bond_get_activeslave(struct rtnl_link *link, int *active_slave)
Get active slave for bond.
Definition bonding.c:230