mptcpd
Multipath TCP Daemon
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
network_monitor.h File Reference

mptcpd network device monitoring. More...

#include <mptcpd/export.h>
#include <stdbool.h>
#include <net/if.h>
Include dependency graph for network_monitor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mptcpd_interface
 Network interface-specific information. More...
 
struct  mptcpd_nm_ops
 Network monitor event tracking operations. More...
 

Typedefs

typedef void(* mptcpd_nm_callback) (struct mptcpd_interface const *interface, void *callback_data)
 Network monitor iteration function type.
 

Functions

MPTCPD_API void mptcpd_nm_foreach_interface (struct mptcpd_nm const *nm, mptcpd_nm_callback callback, void *data)
 Iterate over all monitored network interfaces.
 
MPTCPD_API bool mptcpd_nm_register_ops (struct mptcpd_nm *nm, struct mptcpd_nm_ops const *ops, void *user_data)
 Subscribe to mptcpd network monitor events.
 
MPTCPD_API bool mptcpd_nm_monitor_loopback (struct mptcpd_nm *nm, bool enable)
 Enable monitoring of the loopback network interface.
 

Detailed Description

mptcpd network device monitoring.

Copyright (c) 2017-2022, Intel Corporation

Typedef Documentation

◆ mptcpd_nm_callback

typedef void(* mptcpd_nm_callback) (struct mptcpd_interface const *interface, void *callback_data)

Network monitor iteration function type.

The mptcpd network monitor will call a function of this type when iterating over the network interfaces via mptcpd_nm_foreach_interface().

Parameters
[in]interfaceNetwork interface information.
[in,out]callback_dataData provided by the caller of mptcpd_nm_foreach_interface().

Function Documentation

◆ mptcpd_nm_foreach_interface()

MPTCPD_API void mptcpd_nm_foreach_interface ( struct mptcpd_nm const *  nm,
mptcpd_nm_callback  callback,
void *  data 
)

Iterate over all monitored network interfaces.

Parameters
[in]nmPointer to the mptcpd network monitor object.
[in]callbackFunction to be called during each network interface iteration.
[in]dataData to pass to the callback function during each iteration.

◆ mptcpd_nm_monitor_loopback()

MPTCPD_API 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.

Note
Mptcpd monitoring of loopback network interfaces is meant primarily for testing purposes.
Parameters
[in,out]nmPointer to the mptcpd network monitor object.
[in]enableEnable or disable monitoring of loopback network interfaces.
Return values
trueSuccessfully enable or disabled.
falseInvalid nm argument.

◆ mptcpd_nm_register_ops()

MPTCPD_API 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.

Parameters
[in,out]nmPointer to the mptcpd network monitor object.
[in]opsSet of network monitoring event handling functions.
[in]user_dataData to be passed to the network event tracking operations.
Return values
trueRegistration succeeded.
falseRegistration failed.