diff options
author | Thomas Graf <tgraf@redhat.com> | 2011-09-16 10:57:52 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@redhat.com> | 2011-09-16 10:57:52 (GMT) |
commit | 96f17ce146b35fda3f745a418352d731c522265e (patch) | |
tree | ebe42825cd376471ec8c0dc3326a29ff0a85cdb0 /include | |
parent | 5151cbc2f6e5ca81cfc66eeb1d4a5c6c4e886108 (diff) | |
download | libnl-96f17ce146b35fda3f745a418352d731c522265e.zip libnl-96f17ce146b35fda3f745a418352d731c522265e.tar.gz libnl-96f17ce146b35fda3f745a418352d731c522265e.tar.bz2 |
bonding: API to create/enslave/release
Although it has been possible to create bonding devices, enslave and
release using the regular link API. The added API simplifies usage
and hides some of the compatibility logic.
F.e. enslave() and release() will both verify that the master assignment
has in fact been changed and return -NLE_OPNOTSUPP if it did not.
Also the API will make sure to use RTM_NEWLINK or RTM_SETLINK depending
on what is availble.
Examples are provided in src/ as nl-link-enslave.c and nl-link-release.c
Diffstat (limited to 'include')
-rw-r--r-- | include/netlink/route/link/bonding.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/netlink/route/link/bonding.h b/include/netlink/route/link/bonding.h new file mode 100644 index 0000000..cca777a --- /dev/null +++ b/include/netlink/route/link/bonding.h @@ -0,0 +1,37 @@ +/* + * netlink/route/link/bonding.h Bonding Interface + * + * This library 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 version 2.1 + * of the License. + * + * Copyright (c) 2011 Thomas Graf <tgraf@suug.ch> + */ + +#ifndef NETLINK_LINK_VLAN_H_ +#define NETLINK_LINK_VLAN_H_ + +#include <netlink/netlink.h> +#include <netlink/route/link.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern int rtnl_link_bond_add(struct nl_sock *, const char *, + struct rtnl_link *); + +extern int rtnl_link_bond_enslave_ifindex(struct nl_sock *, int, int); +extern int rtnl_link_bond_enslave(struct nl_sock *, struct rtnl_link *, + struct rtnl_link *); + +extern int rtnl_link_bond_release_ifindex(struct nl_sock *, int); +extern int rtnl_link_bond_release(struct nl_sock *, struct rtnl_link *); + +#ifdef __cplusplus +} +#endif + +#endif + |