|
static int | net_route_best_gw (const IP::Route6 &route, IPv6::Addr &best_gw6, std::string &best_iface, const std::string &iface_to_ignore="") |
|
static int | net_route_best_gw (const IP::Route4 &route, IPv4::Addr &best_gw4, std::string &best_iface, const std::string &iface_to_ignore="") |
|
static IP::Route | net_iface_addr (const std::string &iface, const int family) |
| Get interface address/netmask.
|
|
static int | net_iface_new (const std::string &iface, const std::string &type) |
| Add new interface (similar to ip link add)
|
|
static int | net_iface_del (const std::string &iface) |
|
static int | net_iface_up (std::string &iface, bool up) |
|
static int | net_iface_mtu_set (std::string &iface, uint32_t mtu) |
|
static int | net_addr_add (const std::string &iface, const IPv4::Addr &addr, const unsigned char prefixlen, const IPv4::Addr &broadcast) |
|
static int | net_addr_add (const std::string &iface, const IPv6::Addr &addr, const unsigned char prefixlen) |
|
static int | net_addr_del (const std::string &iface, const IPv4::Addr &addr, const unsigned char prefixlen) |
|
static int | net_addr_del (const std::string &iface, const IPv6::Addr &addr, const unsigned char prefixlen) |
|
static int | net_addr_ptp_add (const std::string &iface, const IPv4::Addr &local, const IPv4::Addr &remote) |
|
static int | net_addr_ptp_del (const std::string &iface, const IPv4::Addr &local, const IPv4::Addr &remote) |
|
static int | net_route_add (const IP::Route4 &route, const IPv4::Addr &gw, const std::string &iface, const uint32_t table, const int metric) |
|
static int | net_route_add (const IP::Route6 &route, const IPv6::Addr &gw, const std::string &iface, const uint32_t table, const int metric) |
|
static int | net_route_del (const IP::Route4 &route, const IPv4::Addr &gw, const std::string &iface, const uint32_t table, const int metric) |
|
static int | net_route_del (const IP::Route6 &route, const IPv6::Addr &gw, const std::string &iface, const uint32_t table, const int metric) |
|
|
static int | sitnl_addattr (struct nlmsghdr *n, int maxlen, uint16_t type, const void *data, uint16_t alen) |
|
static int | sitnl_socket (void) |
|
static int | sitnl_bind (int fd, uint32_t groups) |
|
static int | sitnl_send (struct nlmsghdr *payload, pid_t peer, unsigned int groups, sitnl_parse_reply_cb cb, void *arg_cb) |
|
static int | sitnl_route_save (struct nlmsghdr *n, void *arg) |
|
static int | sitnl_route_best_gw (const std::string &iface_to_ignore, const IP::Route &route, IP::Addr &best_gw, std::string &best_iface) |
|
static int | sitnl_iface_addr_save (struct nlmsghdr *n, void *arg) |
|
static int | sitnl_iface_addr (const int ifindex, const int family, IP::Route &route) |
|
static int | sitnl_addr_set (const unsigned short cmd, const unsigned short flags, const std::string &iface, const IP::Addr &local, const IP::Addr &remote, unsigned char prefixlen, const IP::Addr &broadcast) |
|
static int | sitnl_addr_ptp_add (const std::string &iface, const IP::Addr &local, const IP::Addr &remote) |
|
static int | sitnl_addr_ptp_del (const std::string &iface, const IP::Addr &local) |
|
static int | sitnl_route_set (const unsigned short cmd, const unsigned short flags, const std::string &iface, const IP::Route &route, const IP::Addr &gw, const enum rt_class_t table, const int metric, const enum rt_scope_t scope, const unsigned char protocol, const unsigned char type) |
|
static int | sitnl_addr_add (const std::string &iface, const IP::Addr &addr, unsigned char prefixlen, const IP::Addr &broadcast) |
|
static int | sitnl_addr_del (const std::string &iface, const IP::Addr &addr, unsigned char prefixlen) |
|
static int | sitnl_route_add (const IP::Route &route, const IP::Addr &gw, const std::string &iface, const uint32_t table, const int metric) |
|
static int | sitnl_route_del (const IP::Route &route, const IP::Addr &gw, const std::string &iface, const uint32_t table, const int metric) |
|
Definition at line 56 of file sitnl.hpp.
static int openvpn::TunNetlink::SITNL::sitnl_send |
( |
struct nlmsghdr * |
payload, |
|
|
pid_t |
peer, |
|
|
unsigned int |
groups, |
|
|
sitnl_parse_reply_cb |
cb, |
|
|
void * |
arg_cb |
|
) |
| |
|
inlinestaticprivate |
Send Netlink message and run callback on reply (if specified)
If cb is not set, will request an ack message with NLM_F_ACK. Will return the value of error attribute of the ack message unless any other error occured during send or receive. Only NLMSG_ERROR and NLMSG_DONE messages are expected and handled without a callback function.
If any other messages will be returned, a callback should be used. The callback will called on every message header except NLMSG_DONE (which ends the processing immediately). NLMSG_ERROR message is treated special in that if the callback returns a negative result on a NLMSG_ERROR message, the processing ends and that result is returned immediately. Otherwise, the function returns the return value of the callback called on the last message before NLMSG_DONE.
- Parameters
-
payload | nlmsghdr to embed into a nlmsg and send |
peer | nladdr.nl_pid to use, can be 0 |
groups | nladdr.nl_groups to use, can be 0 |
cb | callback to call on returned nlmsghdrs, can be NULL |
arg_cb | data argument for cb, can be NULL |
- Returns
- If any error occurs, negative errno. If cb is set, return value of last cb call, if not then value of error attribute in NLMSG_ERROR.
Definition at line 222 of file sitnl.hpp.