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
152 struct sockaddr const *laddr,
153 struct sockaddr const *raddr,
154 bool server_side,
155 struct mptcpd_pm *pm);
156
170 struct sockaddr const *laddr,
171 struct sockaddr const *raddr,
172 bool server_side,
173 struct mptcpd_pm *pm);
174
183 struct mptcpd_pm *pm);
184
198 mptcpd_aid_t id,
199 struct sockaddr const *addr,
200 struct mptcpd_pm *pm);
201
214 mptcpd_aid_t id,
215 struct mptcpd_pm *pm);
216
230 struct sockaddr const *laddr,
231 struct sockaddr const *raddr,
232 bool backup,
233 struct mptcpd_pm *pm);
234
246 struct sockaddr const *laddr,
247 struct sockaddr const *raddr,
248 bool backup,
249 struct mptcpd_pm *pm);
250
262 struct sockaddr const *laddr,
263 struct sockaddr const *raddr,
264 bool backup,
265 struct mptcpd_pm *pm);
266
274 void (*listener_created)(struct sockaddr const *laddr,
275 struct mptcpd_pm *pm);
276
284 void (*listener_closed)(struct sockaddr const *laddr,
285 struct mptcpd_pm *pm);
287
288 // --------------------------------------------------------
289
299
312 void (*new_interface)(struct mptcpd_interface const *i,
313 struct mptcpd_pm *pm);
314
320 void (*update_interface)(struct mptcpd_interface const *i,
321 struct mptcpd_pm *pm);
322
328 void (*delete_interface)(struct mptcpd_interface const *i,
329 struct mptcpd_pm *pm);
330
337 void (*new_local_address)(struct mptcpd_interface const *i,
338 struct sockaddr const *sa,
339 struct mptcpd_pm *pm);
340
347 void (*delete_local_address)(struct mptcpd_interface const *i,
348 struct sockaddr const *sa,
349 struct mptcpd_pm *pm);
351};
352
372MPTCPD_API bool mptcpd_plugin_register_ops(
373 char const *name,
374 struct mptcpd_plugin_ops const *ops);
375
376#ifdef __cplusplus
377}
378#endif
379
380#endif // MPTCPD_PLUGIN_H
381
382
383/*
384 Local Variables:
385 c-file-style: "linux"
386 End:
387*/
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:337
void(* connection_established)(mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool server_side, struct mptcpd_pm *pm)
New MPTCP-capable connection has been established.
Definition plugin.h:169
void(* update_interface)(struct mptcpd_interface const *i, struct mptcpd_pm *pm)
Network interface flags were updated.
Definition plugin.h:320
void(* listener_closed)(struct sockaddr const *laddr, struct mptcpd_pm *pm)
MPTCP listener socket has been closed.
Definition plugin.h:284
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:261
void(* subflow_closed)(mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool backup, struct mptcpd_pm *pm)
A single MPTCP subflow was closed.
Definition plugin.h:245
void(* connection_closed)(mptcpd_token_t token, struct mptcpd_pm *pm)
MPTCP connection as a whole was closed.
Definition plugin.h:182
void(* delete_interface)(struct mptcpd_interface const *i, struct mptcpd_pm *pm)
A network interface was removed.
Definition plugin.h:328
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:229
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:347
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:213
void(* new_connection)(mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool server_side, struct mptcpd_pm *pm)
New MPTCP-capable connection has been created.
Definition plugin.h:151
void(* listener_created)(struct sockaddr const *laddr, struct mptcpd_pm *pm)
New MPTCP listener socket has been created.
Definition plugin.h:274
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:197
void(* new_interface)(struct mptcpd_interface const *i, struct mptcpd_pm *pm)
A new network interface is available.
Definition plugin.h:312
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