path_manager.h
Go to the documentation of this file.
// SPDX-License-Identifier: BSD-3-Clause
#ifndef MPTCPD_PRIVATE_PATH_MANAGER_H
#define MPTCPD_PRIVATE_PATH_MANAGER_H
#include <mptcpd/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct sockaddr;
struct l_genl;
struct l_genl_family;
struct l_queue;
struct l_timeout;
struct mptcpd_netlink_pm;
struct mptcpd_addr_info;
struct mptcpd_limit;
struct mptcpd_nm;
struct mptcpd_idm;
struct mptcpd_pm
{
struct mptcpd_config const *config;
struct mptcpd_netlink_pm const *netlink_pm;
struct l_genl *genl;
unsigned int id;
struct l_genl_family *family;
struct l_timeout *timeout;
struct mptcpd_nm *nm;
struct mptcpd_idm *idm;
struct l_queue *event_ops;
};
// -------------------------------------------------------------------
struct pm_ops_info
{
struct mptcpd_pm_ops const *ops;
void *user_data;
};
struct mptcpd_pm_cmd_ops
{
int (*add_addr)(struct mptcpd_pm *pm,
struct sockaddr const *addr,
mptcpd_aid_t id,
mptcpd_token_t token);
int (*remove_addr)(struct mptcpd_pm *pm,
mptcpd_aid_t address_id,
mptcpd_token_t token);
int (*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);
int (*remove_subflow)(struct mptcpd_pm *pm,
mptcpd_token_t token,
struct sockaddr const *local_addr,
struct sockaddr const *remote_addr);
int (*set_backup)(struct mptcpd_pm *pm,
mptcpd_token_t token,
struct sockaddr const *local_addr,
struct sockaddr const *remote_addr,
bool backup);
};
struct mptcpd_kpm_cmd_ops
{
int (*add_addr)(struct mptcpd_pm *pm,
struct sockaddr const *addr,
mptcpd_aid_t id,
uint32_t flags,
int index);
int (*remove_addr)(struct mptcpd_pm *pm,
mptcpd_aid_t address_id);
int (*get_addr)(struct mptcpd_pm *pm,
mptcpd_aid_t id,
mptcpd_kpm_get_addr_cb_t callback,
void *data,
mptcpd_complete_func_t complete);
int (*dump_addrs)(struct mptcpd_pm *pm,
mptcpd_kpm_get_addr_cb_t callback,
void *data,
mptcpd_complete_func_t complete);
int (*flush_addrs)(struct mptcpd_pm *pm);
int (*set_limits)(struct mptcpd_pm *pm,
struct mptcpd_limit const *limits,
size_t len);
int (*get_limits)(struct mptcpd_pm *pm,
mptcpd_pm_get_limits_cb callback,
void *data);
int (*set_flags)(struct mptcpd_pm *pm,
struct sockaddr const *addr,
mptcpd_flags_t flags);
};
#ifdef __cplusplus
}
#endif
#endif /* MPTCPD_PRIVATE_PATH_MANAGER_H */
/*
Local Variables:
c-file-style: "linux"
End:
*/
mptcpd_addr_info
Information associated with a network address.
Definition: addr_info.h:32
mptcpd_config
mptcpd configuration parameters
Definition: configuration.h:29
mptcpd_idm
Internal mptcpd address ID manager data.
Definition: id_manager.c:42
mptcpd_kpm_cmd_ops
Kernel-side MPTCP path management netlink commands.
Definition: path_manager.h:235
mptcpd_kpm_cmd_ops::get_addr
int(* 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.h:297
mptcpd_kpm_cmd_ops::dump_addrs
int(* dump_addrs)(struct mptcpd_pm *pm, mptcpd_kpm_get_addr_cb_t callback, void *data, mptcpd_complete_func_t complete)
Dump list of network addresses.
Definition: path_manager.h:320
mptcpd_kpm_cmd_ops::add_addr
int(* add_addr)(struct mptcpd_pm *pm, struct sockaddr const *addr, mptcpd_aid_t id, uint32_t flags, int index)
Advertise new network address to peers.
Definition: path_manager.h:254
mptcpd_kpm_cmd_ops::set_limits
int(* set_limits)(struct mptcpd_pm *pm, struct mptcpd_limit const *limits, size_t len)
Set MPTCP resource limits.
Definition: path_manager.h:347
mptcpd_kpm_cmd_ops::set_flags
int(* 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.h:377
mptcpd_kpm_cmd_ops::flush_addrs
int(* flush_addrs)(struct mptcpd_pm *pm)
Flush MPTCP addresses.
Definition: path_manager.h:335
mptcpd_kpm_cmd_ops::get_limits
int(* get_limits)(struct mptcpd_pm *pm, mptcpd_pm_get_limits_cb callback, void *data)
Get MPTCP resource limits.
Definition: path_manager.h:363
mptcpd_kpm_cmd_ops::remove_addr
int(* remove_addr)(struct mptcpd_pm *pm, mptcpd_aid_t address_id)
Stop advertising network address to peers.
Definition: path_manager.h:269
mptcpd_limit
MPTCP resource type/limit pair.
Definition: types.h:97
mptcpd_netlink_pm
Definition: netlink_pm.h:28
mptcpd_nm
Data needed to run the network monitor.
Definition: network_monitor.c:60
mptcpd_pm_cmd_ops
MPTCP path management generic netlink command functions.
Definition: path_manager.h:123
mptcpd_pm_cmd_ops::remove_subflow
int(* 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.h:199
mptcpd_pm_cmd_ops::remove_addr
int(* remove_addr)(struct mptcpd_pm *pm, mptcpd_aid_t address_id, mptcpd_token_t token)
Stop advertising network address to peers.
Definition: path_manager.h:155
mptcpd_pm_cmd_ops::add_subflow
int(* 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.h:178
mptcpd_pm_cmd_ops::set_backup
int(* 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.h:219
mptcpd_pm_cmd_ops::add_addr
int(* 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.h:141
mptcpd_pm_ops
Path manager event tracking operations.
Definition: path_manager.h:40
mptcpd_pm
Data needed to run the path manager.
Definition: path_manager.h:43
mptcpd_pm::event_ops
struct l_queue * event_ops
List of pm_ops_info objects.
Definition: path_manager.h:94
mptcpd_pm::timeout
struct l_timeout * timeout
"mptcp" generic netlink family timeout object.
Definition: path_manager.h:74
mptcpd_pm::id
unsigned int id
MPTCP generic netlink multicast notification ID.
Definition: path_manager.h:57
mptcpd_pm::genl
struct l_genl * genl
Core ELL generic netlink object.
Definition: path_manager.h:54
mptcpd_pm::config
struct mptcpd_config const * config
Mptcpd configuration.
Definition: path_manager.h:48
mptcpd_pm::nm
struct mptcpd_nm * nm
Network device monitor.
Definition: path_manager.h:83
mptcpd_pm::family
struct l_genl_family * family
MPTCP generic netlink family.
Definition: path_manager.h:65
mptcpd_pm::idm
struct mptcpd_idm * idm
MPTCP address ID manager.
Definition: path_manager.h:91
mptcpd_pm::netlink_pm
struct mptcpd_netlink_pm const * netlink_pm
Kernel MPTCP generic netlink path manager details.
Definition: path_manager.h:51
pm_ops_info
Path manager event tracking callback information.
Definition: path_manager.h:105
pm_ops_info::ops
struct mptcpd_pm_ops const * ops
Path manager event tracking operations.
Definition: path_manager.h:107
pm_ops_info::user_data
void * user_data
Data passed to the event tracking operations.
Definition: path_manager.h:110
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