path_manager.h
Go to the documentation of this file.
// SPDX-License-Identifier: BSD-3-Clause
#ifndef MPTCPD_LIB_PATH_MANAGER_H
#define MPTCPD_LIB_PATH_MANAGER_H
#include <mptcpd/export.h>
#include <mptcpd/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct sockaddr;
struct mptcpd_pm;
struct mptcpd_addr_info;
struct mptcpd_pm_ops
{
void (*ready)(struct mptcpd_pm *pm, void *user_data);
void (*not_ready)(struct mptcpd_pm *pm, void *user_data);
};
MPTCPD_API bool mptcpd_pm_register_ops(struct mptcpd_pm *pm,
struct mptcpd_pm_ops const *ops,
void *user_data);
MPTCPD_API bool mptcpd_pm_ready(struct mptcpd_pm const *pm);
MPTCPD_API int mptcpd_pm_add_addr(struct mptcpd_pm *pm,
struct sockaddr const *addr,
mptcpd_aid_t id,
mptcpd_token_t token);
MPTCPD_API int mptcpd_pm_remove_addr(struct mptcpd_pm *pm,
mptcpd_aid_t address_id,
mptcpd_token_t token);
MPTCPD_API int
mptcpd_pm_add_subflow(struct mptcpd_pm *pm,
mptcpd_token_t token,
mptcpd_aid_t local_address_id,
mptcpd_aid_t remote_address_id,
struct sockaddr const *local_addr,
struct sockaddr const *remote_addr,
bool backup);
MPTCPD_API int mptcpd_pm_set_backup(
struct mptcpd_pm *pm,
mptcpd_token_t token,
struct sockaddr const *local_addr,
struct sockaddr const *remote_addr,
bool backup);
MPTCPD_API int mptcpd_pm_remove_subflow(
struct mptcpd_pm *pm,
mptcpd_token_t token,
struct sockaddr const *local_addr,
struct sockaddr const *remote_addr);
MPTCPD_API int mptcpd_kpm_add_addr(struct mptcpd_pm *pm,
struct sockaddr const *addr,
mptcpd_aid_t id,
mptcpd_flags_t flags,
int index);
MPTCPD_API int mptcpd_kpm_remove_addr(struct mptcpd_pm *pm,
mptcpd_aid_t address_id);
MPTCPD_API int mptcpd_kpm_get_addr(struct mptcpd_pm *pm,
mptcpd_aid_t id,
mptcpd_kpm_get_addr_cb_t callback,
void *data,
mptcpd_complete_func_t complete);
MPTCPD_API int mptcpd_kpm_dump_addrs(struct mptcpd_pm *pm,
mptcpd_kpm_get_addr_cb_t callback,
void *data,
mptcpd_complete_func_t complete);
MPTCPD_API int mptcpd_kpm_flush_addrs(struct mptcpd_pm *pm);
MPTCPD_API int mptcpd_kpm_set_limits(struct mptcpd_pm *pm,
struct mptcpd_limit const *limits,
size_t len);
MPTCPD_API int mptcpd_kpm_get_limits(struct mptcpd_pm *pm,
mptcpd_pm_get_limits_cb callback,
void *data);
MPTCPD_API int mptcpd_kpm_set_flags(struct mptcpd_pm *pm,
struct sockaddr const *addr,
mptcpd_flags_t flags);
MPTCPD_API struct mptcpd_nm const *
mptcpd_pm_get_nm(struct mptcpd_pm const *pm);
MPTCPD_API struct mptcpd_idm *
mptcpd_pm_get_idm(struct mptcpd_pm const *pm);
#ifdef __cplusplus
}
#endif
#endif // MPTCPD_LIB_PATH_MANAGER_H
/*
Local Variables:
c-file-style: "linux"
End:
*/
export.h
mptcpd shared library symbol export/import macros.
mptcpd_pm_add_addr
MPTCPD_API int mptcpd_pm_add_addr(struct mptcpd_pm *pm, struct sockaddr const *addr, mptcpd_aid_t id, mptcpd_token_t token)
Advertise new network address to peers.
Definition: path_manager.c:238
mptcpd_pm_remove_subflow
MPTCPD_API int mptcpd_pm_remove_subflow(struct mptcpd_pm *pm, mptcpd_token_t token, struct sockaddr const *local_addr, struct sockaddr const *remote_addr)
Remove a subflow.
Definition: path_manager.c:334
mptcpd_kpm_set_flags
MPTCPD_API int mptcpd_kpm_set_flags(struct mptcpd_pm *pm, struct sockaddr const *addr, mptcpd_flags_t flags)
Set MPTCP flags for a local IP address.
Definition: path_manager.c:217
mptcpd_pm_set_backup
MPTCPD_API int mptcpd_pm_set_backup(struct mptcpd_pm *pm, mptcpd_token_t token, struct sockaddr const *local_addr, struct sockaddr const *remote_addr, bool backup)
Set priority of a subflow.
Definition: path_manager.c:309
mptcpd_kpm_get_limits
MPTCPD_API int mptcpd_kpm_get_limits(struct mptcpd_pm *pm, mptcpd_pm_get_limits_cb callback, void *data)
Get MPTCP resource limits.
Definition: path_manager.c:198
mptcpd_kpm_flush_addrs
MPTCPD_API int mptcpd_kpm_flush_addrs(struct mptcpd_pm *pm)
Flush MPTCP addresses.
Definition: path_manager.c:162
mptcpd_kpm_dump_addrs
MPTCPD_API int mptcpd_kpm_dump_addrs(struct mptcpd_pm *pm, mptcpd_kpm_get_addr_cb_t callback, void *data, mptcpd_complete_func_t complete)
Get list (array) of MPTCP network addresses.
Definition: path_manager.c:142
mptcpd_pm_register_ops
MPTCPD_API bool mptcpd_pm_register_ops(struct mptcpd_pm *pm, struct mptcpd_pm_ops const *ops, void *user_data)
Subscribe to mptcpd path manager events.
Definition: path_manager.c:45
mptcpd_kpm_set_limits
MPTCPD_API int mptcpd_kpm_set_limits(struct mptcpd_pm *pm, struct mptcpd_limit const *limits, size_t len)
Set MPTCP resource limits.
Definition: path_manager.c:179
mptcpd_pm_remove_addr
MPTCPD_API int mptcpd_pm_remove_addr(struct mptcpd_pm *pm, mptcpd_aid_t address_id, mptcpd_token_t token)
Stop advertising network address to peers.
Definition: path_manager.c:261
mptcpd_pm_ready
MPTCPD_API bool mptcpd_pm_ready(struct mptcpd_pm const *pm)
Is mptcpd path manager ready for use?
Definition: path_manager.c:72
mptcpd_pm_get_idm
MPTCPD_API struct mptcpd_idm * mptcpd_pm_get_idm(struct mptcpd_pm const *pm)
Get pointer to the global MPTCP address ID manager.
Definition: path_manager.c:364
mptcpd_kpm_get_addr
MPTCPD_API int mptcpd_kpm_get_addr(struct mptcpd_pm *pm, mptcpd_aid_t id, mptcpd_kpm_get_addr_cb_t callback, void *data, mptcpd_complete_func_t complete)
Get network address corresponding to an address ID.
Definition: path_manager.c:121
mptcpd_kpm_add_addr
MPTCPD_API int mptcpd_kpm_add_addr(struct mptcpd_pm *pm, struct sockaddr const *addr, mptcpd_aid_t id, mptcpd_flags_t flags, int index)
Advertise new network address to peers.
Definition: path_manager.c:79
mptcpd_pm_get_nm
MPTCPD_API struct mptcpd_nm const * mptcpd_pm_get_nm(struct mptcpd_pm const *pm)
Get pointer to the underlying network monitor.
Definition: path_manager.c:359
mptcpd_kpm_remove_addr
MPTCPD_API int mptcpd_kpm_remove_addr(struct mptcpd_pm *pm, mptcpd_aid_t address_id)
Stop advertising network address to peers.
Definition: path_manager.c:104
mptcpd_pm_add_subflow
MPTCPD_API int mptcpd_pm_add_subflow(struct mptcpd_pm *pm, mptcpd_token_t token, mptcpd_aid_t local_address_id, mptcpd_aid_t remote_address_id, struct sockaddr const *local_addr, struct sockaddr const *remote_addr, bool backup)
Create a new subflow.
Definition: path_manager.c:280
mptcpd_addr_info
Information associated with a network address.
Definition: addr_info.h:32
mptcpd_idm
Internal mptcpd address ID manager data.
Definition: id_manager.c:42
mptcpd_limit
MPTCP resource type/limit pair.
Definition: types.h:97
mptcpd_nm
Data needed to run the network monitor.
Definition: network_monitor.c:60
mptcpd_pm_ops
Path manager event tracking operations.
Definition: path_manager.h:40
mptcpd_pm_ops::not_ready
void(* not_ready)(struct mptcpd_pm *pm, void *user_data)
Callback triggered when the path manager is not ready.
Definition: path_manager.h:62
mptcpd_pm_ops::ready
void(* ready)(struct mptcpd_pm *pm, void *user_data)
Callback triggered when the path manager is ready.
Definition: path_manager.h:50
mptcpd_pm
Data needed to run the path manager.
Definition: path_manager.h:43
types.h
mptcpd user space path manager attribute types.
mptcpd_kpm_get_addr_cb_t
void(* mptcpd_kpm_get_addr_cb_t)(struct mptcpd_addr_info const *info, void *callback_data)
Type of function called when an address is available.
Definition: types.h:118
mptcpd_flags_t
uint32_t mptcpd_flags_t
MPTCP flags type.
Definition: types.h:51
mptcpd_pm_get_limits_cb
void(* mptcpd_pm_get_limits_cb)(struct mptcpd_limit const *limits, size_t len, void *callback_data)
Type of function called when MPTCP resource limits are available.
Definition: types.h:160
mptcpd_token_t
uint32_t mptcpd_token_t
MPTCP connection token type.
Definition: types.h:26
mptcpd_complete_func_t
void(* mptcpd_complete_func_t)(void *user_data)
Type of function called on asynchronous call completion.
Definition: types.h:144
mptcpd_aid_t
uint8_t mptcpd_aid_t
MPTCP address ID type.
Definition: types.h:29