mptcpd
Multipath TCP Daemon
|
Common path manager plugin functions. More...
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <dlfcn.h>
#include <errno.h>
#include <unistd.h>
#include <assert.h>
#include <ell/ell.h>
#include <linux/genetlink.h>
#include <mptcpd/private/plugin.h>
#include <mptcpd/plugin.h>
Classes | |
struct | plugin_info |
Plugin information. More... | |
struct | plugin_address_info |
Convenience structure to bundle address information. More... | |
struct | plugin_interface_info |
Convenience structure to bundle interface information. More... | |
Macros | |
#define | MPTCP_PM_NAME_LEN GENL_NAMSIZ |
Functions | |
bool | mptcpd_plugin_load (char const *dir, char const *default_name, struct l_queue const *plugins_to_load, struct mptcpd_pm *pm) |
Load mptcpd plugins. | |
void | mptcpd_plugin_unload (struct mptcpd_pm *pm) |
Unload mptcpd plugins. | |
bool | mptcpd_plugin_register_ops (char const *name, struct mptcpd_plugin_ops const *ops) |
Register path manager operations. | |
void | mptcpd_plugin_new_connection (char const *name, mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool server_side, struct mptcpd_pm *pm) |
Notify plugin of new MPTCP connection pending completion. | |
void | mptcpd_plugin_connection_established (mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool server_side, struct mptcpd_pm *pm) |
Notify plugin of MPTCP connection completion. | |
void | mptcpd_plugin_connection_closed (mptcpd_token_t token, struct mptcpd_pm *pm) |
Notify plugin of MPTCP connection closure. | |
void | mptcpd_plugin_new_address (mptcpd_token_t token, mptcpd_aid_t id, struct sockaddr const *addr, struct mptcpd_pm *pm) |
Notify plugin of new address advertised by a peer. | |
void | mptcpd_plugin_address_removed (mptcpd_token_t token, mptcpd_aid_t id, struct mptcpd_pm *pm) |
Notify plugin of address no longer advertised by a peer. | |
void | mptcpd_plugin_new_subflow (mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool backup, struct mptcpd_pm *pm) |
Notify plugin that a peer has joined the MPTCP connection. | |
void | mptcpd_plugin_subflow_closed (mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool backup, struct mptcpd_pm *pm) |
Notify plugin of MPTCP subflow closure. | |
void | mptcpd_plugin_subflow_priority (mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool backup, struct mptcpd_pm *pm) |
Notify plugin of MPTCP subflow priority change. | |
void | mptcpd_plugin_listener_created (char const *name, struct sockaddr const *laddr, struct mptcpd_pm *pm) |
Notify plugin of MPTCP listener creation. | |
void | mptcpd_plugin_listener_closed (char const *name, struct sockaddr const *laddr, struct mptcpd_pm *pm) |
Notify plugin of MPTCP listener closure. | |
void | mptcpd_plugin_new_interface (struct mptcpd_interface const *i, void *pm) |
Notify plugin of new network interface. | |
void | mptcpd_plugin_update_interface (struct mptcpd_interface const *i, void *pm) |
Notify plugin of updated network interface. | |
void | mptcpd_plugin_delete_interface (struct mptcpd_interface const *i, void *pm) |
Notify plugin of removed network interface. | |
void | mptcpd_plugin_new_local_address (struct mptcpd_interface const *i, struct sockaddr const *sa, void *pm) |
Notify plugin of new network address. | |
void | mptcpd_plugin_delete_local_address (struct mptcpd_interface const *i, struct sockaddr const *sa, void *pm) |
Notify plugin of removed network address. | |
Common path manager plugin functions.
Copyright (c) 2018-2022, Intel Corporation
#define MPTCP_PM_NAME_LEN GENL_NAMSIZ |
GENL_NAMSIZ
is used as the size since the path manager name attribute in the deprecated MPTCP generic netlink API contained a fixed length string of that size. void mptcpd_plugin_address_removed | ( | mptcpd_token_t | token, |
mptcpd_aid_t | id, | ||
struct mptcpd_pm * | pm | ||
) |
Notify plugin of address no longer advertised by a peer.
[in] | token | MPTCP connection token. |
[in] | id | Remote address identifier. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_connection_closed | ( | mptcpd_token_t | token, |
struct mptcpd_pm * | pm | ||
) |
Notify plugin of MPTCP connection closure.
[in] | token | MPTCP connection token. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_connection_established | ( | mptcpd_token_t | token, |
struct sockaddr const * | laddr, | ||
struct sockaddr const * | raddr, | ||
bool | server_side, | ||
struct mptcpd_pm * | pm | ||
) |
Notify plugin of MPTCP connection completion.
[in] | token | MPTCP connection token. |
[in] | laddr | Local address information. |
[in] | raddr | Remote address information. |
[in] | server_side | Server side connection flag. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_delete_interface | ( | struct mptcpd_interface const * | i, |
void * | pm | ||
) |
Notify plugin of removed network interface.
[in] | i | Network interface information. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_delete_local_address | ( | struct mptcpd_interface const * | i, |
struct sockaddr const * | sa, | ||
void * | pm | ||
) |
Notify plugin of removed network address.
[in] | i | Network interface information. |
[in] | sa | Network address information. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_listener_closed | ( | char const * | name, |
struct sockaddr const * | laddr, | ||
struct mptcpd_pm * | pm | ||
) |
Notify plugin of MPTCP listener closure.
[in] | laddr | Local address information. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_listener_created | ( | char const * | name, |
struct sockaddr const * | laddr, | ||
struct mptcpd_pm * | pm | ||
) |
Notify plugin of MPTCP listener creation.
[in] | laddr | Local address information. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
bool mptcpd_plugin_load | ( | char const * | dir, |
char const * | default_name, | ||
struct l_queue const * | plugins_to_load, | ||
struct mptcpd_pm * | pm | ||
) |
Load mptcpd plugins.
[in] | dir | Directory from which plugins will be loaded. |
[in] | default_name | Name of plugin to be considered the default. |
[in] | plugins_to_load | List of plugins to be loaded. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
true
on successful load, false
otherwise. Create map of connection token to path manager plugin.
unsigned
int
.unsigned
int
is a 32 bit type. void mptcpd_plugin_new_address | ( | mptcpd_token_t | token, |
mptcpd_aid_t | id, | ||
struct sockaddr const * | addr, | ||
struct mptcpd_pm * | pm | ||
) |
Notify plugin of new address advertised by a peer.
[in] | token | MPTCP connection token. |
[in] | id | Remote address identifier. |
[in] | addr | Remote address information. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_new_connection | ( | char const * | name, |
mptcpd_token_t | token, | ||
struct sockaddr const * | laddr, | ||
struct sockaddr const * | raddr, | ||
bool | server_side, | ||
struct mptcpd_pm * | pm | ||
) |
Notify plugin of new MPTCP connection pending completion.
[in] | name | Plugin name. |
[in] | token | MPTCP connection token. |
[in] | laddr | Local address information. |
[in] | raddr | Remote address information. |
[in] | server_side | Server side connection flag. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_new_interface | ( | struct mptcpd_interface const * | i, |
void * | pm | ||
) |
Notify plugin of new network interface.
[in] | i | Network interface information. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_new_local_address | ( | struct mptcpd_interface const * | i, |
struct sockaddr const * | sa, | ||
void * | pm | ||
) |
Notify plugin of new network address.
[in] | i | Network interface information. |
[in] | sa | Network address information. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_new_subflow | ( | mptcpd_token_t | token, |
struct sockaddr const * | laddr, | ||
struct sockaddr const * | raddr, | ||
bool | backup, | ||
struct mptcpd_pm * | pm | ||
) |
Notify plugin that a peer has joined the MPTCP connection.
[in] | token | MPTCP connection token. |
[in] | laddr | Local address information. |
[in] | raddr | Remote address information. |
[in] | backup | Backup priority flag. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
bool mptcpd_plugin_register_ops | ( | char const * | name, |
struct mptcpd_plugin_ops const * | ops | ||
) |
Register path manager operations.
Path manager plugins should call this function in their init
function to register their MPTCP path manager event handling functions.
[in] | name | Plugin name. |
[in] | ops | Set of MPTCP path manager event handling functions provided by the path manager plugin. |
true | Registration succeeded. |
false | Registration failed. Failure should only occur if plugins were not loaded prior to calling this function. Plugin developers should generally not have to worry about that since the load is guaranteed to have occurred prior to their init function being called. |
false
if all of the callbacks in ops are NULL
? void mptcpd_plugin_subflow_closed | ( | mptcpd_token_t | token, |
struct sockaddr const * | laddr, | ||
struct sockaddr const * | raddr, | ||
bool | backup, | ||
struct mptcpd_pm * | pm | ||
) |
Notify plugin of MPTCP subflow closure.
[in] | token | MPTCP connection token. |
[in] | laddr | Local address information. |
[in] | raddr | Remote address information. |
[in] | backup | Backup priority flag. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_subflow_priority | ( | mptcpd_token_t | token, |
struct sockaddr const * | laddr, | ||
struct sockaddr const * | raddr, | ||
bool | backup, | ||
struct mptcpd_pm * | pm | ||
) |
Notify plugin of MPTCP subflow priority change.
[in] | token | MPTCP connection token. |
[in] | laddr | Local address information. |
[in] | raddr | Remote address information. |
[in] | backup | Backup priority flag. |
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_unload | ( | struct mptcpd_pm * | pm | ) |
Unload mptcpd plugins.
[in] | pm | Opaque pointer to mptcpd path manager object. |
void mptcpd_plugin_update_interface | ( | struct mptcpd_interface const * | i, |
void * | pm | ||
) |
Notify plugin of updated network interface.
[in] | i | Network interface information. |
[in] | pm | Opaque pointer to mptcpd path manager object. |