mptcpd
Multipath TCP Daemon
Loading...
Searching...
No Matches
plugin.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
10#ifndef MPTCPD_PLUGIN_H
11#define MPTCPD_PLUGIN_H
12
13#include <stdbool.h>
14
15#include <mptcpd/export.h>
16#include <mptcpd/types.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22struct sockaddr;
23struct mptcpd_pm;
24struct mptcpd_interface;
25
32#define MPTCPD_PLUGIN_SYM _mptcpd_plugin
33
55#define MPTCPD_PLUGIN_DEFINE(name, description, priority, init, exit) \
56 extern struct mptcpd_plugin_desc const MPTCPD_PLUGIN_SYM \
57 __attribute__((visibility("default"))); \
58 struct mptcpd_plugin_desc const MPTCPD_PLUGIN_SYM = { \
59 #name, \
60 description, \
61 0, /* version */ \
62 priority, \
63 init, \
64 exit \
65 };
66
68#define MPTCPD_PLUGIN_PRIORITY_LOW 19
69
71#define MPTCPD_PLUGIN_PRIORITY_DEFAULT 0
72
74#define MPTCPD_PLUGIN_PRIORITY_HIGH -20
75
82{
87 char const *const name;
88
90 char const *const description;
91
93 char const *const version;
94
106 int const priority;
107
109 int (*init)(struct mptcpd_pm *);
110
112 void (*exit)(struct mptcpd_pm *);
113};
114
125{
136
155 struct sockaddr const *laddr,
156 struct sockaddr const *raddr,
157 bool server_side,
158 bool deny_join_id0,
159 struct mptcpd_pm *pm);
160
177 struct sockaddr const *laddr,
178 struct sockaddr const *raddr,
179 bool server_side,
180 bool deny_join_id0,
181 struct mptcpd_pm *pm);
182
191 struct mptcpd_pm *pm);
192
206 mptcpd_aid_t id,
207 struct sockaddr const *addr,
208 struct mptcpd_pm *pm);
209
222 mptcpd_aid_t id,
223 struct mptcpd_pm *pm);
224
238 struct sockaddr const *laddr,
239 struct sockaddr const *raddr,
240 bool backup,
241 struct mptcpd_pm *pm);
242
256 struct sockaddr const *laddr,
257 struct sockaddr const *raddr,
258 bool backup,
259 uint8_t error,
260 struct mptcpd_pm *pm);
261
273 struct sockaddr const *laddr,
274 struct sockaddr const *raddr,
275 bool backup,
276 struct mptcpd_pm *pm);
277
285 void (*listener_created)(struct sockaddr const *laddr,
286 struct mptcpd_pm *pm);
287
295 void (*listener_closed)(struct sockaddr const *laddr,
296 struct mptcpd_pm *pm);
298
299 // --------------------------------------------------------
300
310
323 void (*new_interface)(struct mptcpd_interface const *i,
324 struct mptcpd_pm *pm);
325
331 void (*update_interface)(struct mptcpd_interface const *i,
332 struct mptcpd_pm *pm);
333
339 void (*delete_interface)(struct mptcpd_interface const *i,
340 struct mptcpd_pm *pm);
341
348 void (*new_local_address)(struct mptcpd_interface const *i,
349 struct sockaddr const *sa,
350 struct mptcpd_pm *pm);
351
358 void (*delete_local_address)(struct mptcpd_interface const *i,
359 struct sockaddr const *sa,
360 struct mptcpd_pm *pm);
362};
363
383MPTCPD_API bool mptcpd_plugin_register_ops(
384 char const *name,
385 struct mptcpd_plugin_ops const *ops);
386
387#ifdef __cplusplus
388}
389#endif
390
391#endif // MPTCPD_PLUGIN_H
392
393
394/*
395 Local Variables:
396 c-file-style: "linux"
397 End:
398*/
mptcpd shared library symbol export/import macros.
MPTCPD_API bool mptcpd_plugin_register_ops(char const *name, struct mptcpd_plugin_ops const *ops)
Register path manager operations.
Definition plugin.c:518
Network interface-specific information.
Definition network_monitor.h:31
Plugin-specific characteristics / descriptor.
Definition plugin.h:82
char const *const name
Plugin name.
Definition plugin.h:87
char const *const version
mptcpd version against which the plugin was compiled.
Definition plugin.h:93
int(* init)(struct mptcpd_pm *)
Plugin initialization function.
Definition plugin.h:109
int const priority
Plugin priority.
Definition plugin.h:106
char const *const description
Plugin description.
Definition plugin.h:90
void(* exit)(struct mptcpd_pm *)
Plugin finalization function.
Definition plugin.h:112
Mptcpd plugin interface.
Definition plugin.h:125
void(* new_local_address)(struct mptcpd_interface const *i, struct sockaddr const *sa, struct mptcpd_pm *pm)
A new local network address is available.
Definition plugin.h:348
void(* update_interface)(struct mptcpd_interface const *i, struct mptcpd_pm *pm)
Network interface flags were updated.
Definition plugin.h:331
void(* listener_closed)(struct sockaddr const *laddr, struct mptcpd_pm *pm)
MPTCP listener socket has been closed.
Definition plugin.h:295
void(* subflow_priority)(mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool backup, struct mptcpd_pm *pm)
MPTCP subflow priority changed.
Definition plugin.h:272
void(* connection_closed)(mptcpd_token_t token, struct mptcpd_pm *pm)
MPTCP connection as a whole was closed.
Definition plugin.h:190
void(* delete_interface)(struct mptcpd_interface const *i, struct mptcpd_pm *pm)
A network interface was removed.
Definition plugin.h:339
void(* new_connection)(mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool server_side, bool deny_join_id0, struct mptcpd_pm *pm)
New MPTCP-capable connection has been created.
Definition plugin.h:154
void(* connection_established)(mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool server_side, bool deny_join_id0, struct mptcpd_pm *pm)
New MPTCP-capable connection has been established.
Definition plugin.h:176
void(* new_subflow)(mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool backup, struct mptcpd_pm *pm)
A peer has joined the MPTCP connection.
Definition plugin.h:237
void(* delete_local_address)(struct mptcpd_interface const *i, struct sockaddr const *sa, struct mptcpd_pm *pm)
A local network address was removed.
Definition plugin.h:358
void(* subflow_closed)(mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool backup, uint8_t error, struct mptcpd_pm *pm)
A single MPTCP subflow was closed.
Definition plugin.h:255
void(* address_removed)(mptcpd_token_t token, mptcpd_aid_t id, struct mptcpd_pm *pm)
Address is no longer advertised by a peer.
Definition plugin.h:221
void(* listener_created)(struct sockaddr const *laddr, struct mptcpd_pm *pm)
New MPTCP listener socket has been created.
Definition plugin.h:285
void(* new_address)(mptcpd_token_t token, mptcpd_aid_t id, struct sockaddr const *addr, struct mptcpd_pm *pm)
New address has been advertised by a peer.
Definition plugin.h:205
void(* new_interface)(struct mptcpd_interface const *i, struct mptcpd_pm *pm)
A new network interface is available.
Definition plugin.h:323
Data needed to run the path manager.
Definition path_manager.h:46
mptcpd user space path manager attribute types.
uint32_t mptcpd_token_t
MPTCP connection token type.
Definition types.h:26
uint8_t mptcpd_aid_t
MPTCP address ID type.
Definition types.h:29