|
mptcpd
Multipath TCP Daemon
|
mptcpd network device monitoring. More...
#include <string.h>#include <stdlib.h>#include <assert.h>#include <linux/rtnetlink.h>#include <arpa/inet.h>#include <net/if.h>#include <netinet/in.h>#include <ell/ell.h>#include <mptcpd/private/path_manager.h>#include <mptcpd/private/sockaddr.h>#include <mptcpd/private/network_monitor.h>#include <mptcpd/network_monitor.h>
Classes | |
| struct | nm_ops_info |
| Network monitoring event tracking callback information. More... | |
| struct | mptcpd_nm |
| Data needed to run the network monitor. More... | |
| struct | mptcpd_rtm_addr |
| Encapsulate network address information. More... | |
| struct | nm_addr_info |
| Convenience structure to bundle address information. More... | |
| struct | mptcpd_interface_callback_data |
| Callback information supplied by the user. More... | |
Macros | |
| #define | _POSIX_C_SOURCE 200112L |
| For XSI-compliant strerror_r(). | |
| #define | _DEFAULT_SOURCE |
| For standard network interface flags. | |
| #define | MPTCPD_MAX_ROUTE_CHECK 3 |
Typedefs | |
| typedef void(* | handle_ifaddr_func_t) (struct mptcpd_nm *nm, struct mptcpd_interface *interface, struct mptcpd_rtm_addr const *rtm_addr) |
| Network address handler function signature. | |
Functions | |
| struct mptcpd_nm * | mptcpd_nm_create (uint32_t flags) |
| Create a network monitor. | |
| void | mptcpd_nm_destroy (struct mptcpd_nm *nm) |
| Destroy a network monitor. | |
| void | mptcpd_nm_foreach_interface (struct mptcpd_nm const *nm, mptcpd_nm_callback callback, void *callback_data) |
| Iterate over all monitored network interfaces. | |
| bool | mptcpd_nm_register_ops (struct mptcpd_nm *nm, struct mptcpd_nm_ops const *ops, void *user_data) |
| Subscribe to mptcpd network monitor events. | |
| bool | mptcpd_nm_monitor_loopback (struct mptcpd_nm *nm, bool enable) |
| Enable monitoring of the loopback network interface. | |
mptcpd network device monitoring.
Copyright (c) 2017-2022, 2024, Intel Corporation
| struct mptcpd_nm * mptcpd_nm_create | ( | uint32_t | flags | ) |
Create a network monitor.
| [in] | flags | Flags controlling address notification, any of: MPTCPD_NOTIFY_FLAG_EXISTING, MPTCPD_NOTIFY_FLAG_SKIP_LL, MPTCPD_NOTIFY_FLAG_SKIP_HOST |
NULL on failure. Get network interface information.
RTM_GETLINK response, which resulted in an EBUSY error.| void mptcpd_nm_destroy | ( | struct mptcpd_nm * | nm | ) |
Destroy a network monitor.
| [in,out] | nm | Network monitor to be destroyed. |
| void mptcpd_nm_foreach_interface | ( | struct mptcpd_nm const * | nm, |
| mptcpd_nm_callback | callback, | ||
| void * | data | ||
| ) |
Iterate over all monitored network interfaces.
| [in] | nm | Pointer to the mptcpd network monitor object. |
| [in] | callback | Function to be called during each network interface iteration. |
| [in] | data | Data to pass to the callback function during each iteration. |
| bool mptcpd_nm_monitor_loopback | ( | struct mptcpd_nm * | nm, |
| bool | enable | ||
| ) |
Enable monitoring of the loopback network interface.
Mptcpd normally only monitors non-loopback network interfaces. Call this function to enable monitoring of loopback network interfaces.
| [in,out] | nm | Pointer to the mptcpd network monitor object. |
| [in] | enable | Enable or disable monitoring of loopback network interfaces. |
| true | Successfully enable or disabled. |
| false | Invalid nm argument. |
| bool mptcpd_nm_register_ops | ( | struct mptcpd_nm * | nm, |
| struct mptcpd_nm_ops const * | ops, | ||
| void * | user_data | ||
| ) |
Subscribe to mptcpd network monitor events.
Register a set of operations that will be called on a corresponding mptcpd network monitoring event, e.g. network interface or address addition, update, or removal.
| [in,out] | nm | Pointer to the mptcpd network monitor object. |
| [in] | ops | Set of network monitoring event handling functions. |
| [in] | user_data | Data to be passed to the network event tracking operations. |
| true | Registration succeeded. |
| false | Registration failed. |