mptcpd
Multipath TCP Daemon
Loading...
Searching...
No Matches
Classes | Macros | Functions
plugin.h File Reference

mptcpd user space path manager plugin header file. More...

#include <stdbool.h>
#include <mptcpd/export.h>
#include <mptcpd/types.h>
Include dependency graph for plugin.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mptcpd_plugin_desc
 Plugin-specific characteristics / descriptor. More...
 
struct  mptcpd_plugin_ops
 Mptcpd plugin interface. More...
 

Macros

#define MPTCPD_PLUGIN_SYM   _mptcpd_plugin
 Symbol name of mptcpd plugin characterstics.
 
#define MPTCPD_PLUGIN_DEFINE(name, description, priority, init, exit)
 Define mptcpd plugin characterstics.
 
#define MPTCPD_PLUGIN_PRIORITY_LOW   19
 Low plugin priority.
 
#define MPTCPD_PLUGIN_PRIORITY_DEFAULT   0
 Default plugin priority.
 
#define MPTCPD_PLUGIN_PRIORITY_HIGH   -20
 High plugin priority.
 

Functions

MPTCPD_API bool mptcpd_plugin_register_ops (char const *name, struct mptcpd_plugin_ops const *ops)
 Register path manager operations.
 

Detailed Description

mptcpd user space path manager plugin header file.

Copyright (c) 2017-2020, 2022, Intel Corporation

Macro Definition Documentation

◆ MPTCPD_PLUGIN_DEFINE

#define MPTCPD_PLUGIN_DEFINE (   name,
  description,
  priority,
  init,
  exit 
)
Value:
extern struct mptcpd_plugin_desc const MPTCPD_PLUGIN_SYM \
__attribute__((visibility("default"))); \
#name, \
description, \
0, /* version */ \
priority, \
init, \
exit \
};
#define MPTCPD_PLUGIN_SYM
Symbol name of mptcpd plugin characterstics.
Definition plugin.h:32
Plugin-specific characteristics / descriptor.
Definition plugin.h:82

Define mptcpd plugin characterstics.

Mptcpd plugins should use this macro to define and export characterstics (descriptor) required by mptcpd.

Parameters
[in]namePlugin name (unquoted)
[in]descriptionPlugin description
[in]priorityPlugin priority, where the higher values are lower in priority, and lower values are higher in priority, similar to how process scheduling priorities are defined. Mptcpd defines convenience plugin priorities MPTCP_PLUGIN_PRIORITY_LOW, MPTCP_PLUGIN_PRIORITY_DEFAULT, and MPTCP_PLUGIN_PRIORITY_HIGH.
[in]initFunction called when mptcpd initializes the plugin.
[in]exitFunction called when mptcpd finalizes the plugin.

◆ MPTCPD_PLUGIN_SYM

#define MPTCPD_PLUGIN_SYM   _mptcpd_plugin

Symbol name of mptcpd plugin characterstics.

Note
This is a private preprocessor constant that is not part of the mptcpd plugin API.

Function Documentation

◆ mptcpd_plugin_register_ops()

MPTCPD_API 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.

Parameters
[in]namePlugin name.
[in]opsSet of MPTCP path manager event handling functions provided by the path manager plugin.
Return values
trueRegistration succeeded.
falseRegistration 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.
Todo:
Should we return false if all of the callbacks in ops are NULL?