Loading...
Searching...
No Matches
plugin.h File Reference

mptcpd private plugin interface. More...

`#include <stdbool.h>`
`#include <mptcpd/export.h>`
`#include <mptcpd/types.h>`
`#include <ell/queue.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.

## Functions

MPTCP Path Manager Generic Netlink Event Handlers
MPTCPD_API bool | mptcpd_plugin_load (char const *dir, char const *default_name, struct l_queue const *plugins_to_load, struct mptcpd_pm *pm)
| Load mptcpd plugins.
MPTCPD_API void | mptcpd_plugin_unload (struct mptcpd_pm *pm)
| Unload mptcpd plugins.
MPTCPD_API void | mptcpd_plugin_new_connection (char const *name, mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool server_side, struct mptcpd_pm *pm)
| Notify plugin of new MPTCP connection pending completion.
MPTCPD_API void | mptcpd_plugin_connection_established (mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool server_side, struct mptcpd_pm *pm)
| Notify plugin of MPTCP connection completion.
MPTCPD_API void | mptcpd_plugin_connection_closed (mptcpd_token_t token, struct mptcpd_pm *pm)
| Notify plugin of MPTCP connection closure.
MPTCPD_API void | mptcpd_plugin_new_address (mptcpd_token_t token, mptcpd_aid_t id, struct sockaddr const *addr, struct mptcpd_pm *pm)
| Notify plugin of new address advertised by a peer.
MPTCPD_API void | mptcpd_plugin_address_removed (mptcpd_token_t token, mptcpd_aid_t id, struct mptcpd_pm *pm)
| Notify plugin of address no longer advertised by a peer.
MPTCPD_API void | mptcpd_plugin_new_subflow (mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool backup, struct mptcpd_pm *pm)
| Notify plugin that a peer has joined the MPTCP connection.
MPTCPD_API void | mptcpd_plugin_subflow_closed (mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool backup, struct mptcpd_pm *pm)
| Notify plugin of MPTCP subflow closure.
MPTCPD_API void | mptcpd_plugin_subflow_priority (mptcpd_token_t token, struct sockaddr const *laddr, struct sockaddr const *raddr, bool backup, struct mptcpd_pm *pm)
| Notify plugin of MPTCP subflow priority change.
MPTCPD_API void | mptcpd_plugin_listener_created (char const *name, struct sockaddr const *laddr, struct mptcpd_pm *pm)
| Notify plugin of MPTCP listener creation.
MPTCPD_API void | mptcpd_plugin_listener_closed (char const *name, struct sockaddr const *laddr, struct mptcpd_pm *pm)
| Notify plugin of MPTCP listener closure.
Network Monitor Event Handlers

A set of operations that dispatch mptcpd network monitor events to all registered plugins.

See also
  mptcpd_nm_ops

MPTCPD_API void | mptcpd_plugin_new_interface (struct mptcpd_interface const *i, void *pm)
| Notify plugin of new network interface.
MPTCPD_API void | mptcpd_plugin_update_interface (struct mptcpd_interface const *i, void *pm)
| Notify plugin of updated network interface.
MPTCPD_API void | mptcpd_plugin_delete_interface (struct mptcpd_interface const *i, void *pm)
| Notify plugin of removed network interface.
MPTCPD_API void | mptcpd_plugin_new_local_address (struct mptcpd_interface const *i, struct sockaddr const *sa, void *pm)
| Notify plugin of new network address.
MPTCPD_API void | mptcpd_plugin_delete_local_address (struct mptcpd_interface const *i, struct sockaddr const *sa, void *pm)
| Notify plugin of removed network address.

## Detailed Description

mptcpd private plugin interface.

Copyright (c) 2017-2022, Intel Corporation

## Function Documentation

## mptcpd_plugin_address_removed()

MPTCPD_API void mptcpd_plugin_address_removed | ( | mptcpd_token_t | token,
|  | mptcpd_aid_t | id,
|  | struct mptcpd_pm * | pm
| ) |  |

Notify plugin of address no longer advertised by a peer.

Parameters

  [in] | token | MPTCP connection token.
  [in] | id | Remote address identifier.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_connection_closed()

MPTCPD_API void mptcpd_plugin_connection_closed | ( | mptcpd_token_t | token,
|  | struct mptcpd_pm * | pm
| ) |  |

Notify plugin of MPTCP connection closure.

Parameters

  [in] | token | MPTCP connection token.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_connection_established()

MPTCPD_API void mptcpd_plugin_connection_established | ( | mptcpd_token_t | token,
|  | struct sockaddr const * | laddr,
|  | struct sockaddr const * | raddr,
|  | bool | server_side,
|  | struct mptcpd_pm * | pm
| ) |  |

Notify plugin of MPTCP connection completion.

Parameters

  [in] | token | MPTCP connection token.
  [in] | laddr | Local address information.
  [in] | raddr | Remote address information.
  [in] | server_side | Server side connection flag.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_delete_interface()

MPTCPD_API void mptcpd_plugin_delete_interface | ( | struct mptcpd_interface const * | i,
|  | void * | pm
| ) |  |

Notify plugin of removed network interface.

Parameters

  [in] | i | Network interface information.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_delete_local_address()

MPTCPD_API void mptcpd_plugin_delete_local_address | ( | struct mptcpd_interface const * | i,
|  | struct sockaddr const * | sa,
|  | void * | pm
| ) |  |

Notify plugin of removed network address.

Parameters

  [in] | i | Network interface information.
  [in] | sa | Network address information.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_listener_closed()

MPTCPD_API void mptcpd_plugin_listener_closed | ( | char const * | name,
|  | struct sockaddr const * | laddr,
|  | struct mptcpd_pm * | pm
| ) |  |

Notify plugin of MPTCP listener closure.

Parameters

  [in] | laddr | Local address information.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_listener_created()

MPTCPD_API void mptcpd_plugin_listener_created | ( | char const * | name,
|  | struct sockaddr const * | laddr,
|  | struct mptcpd_pm * | pm
| ) |  |

Notify plugin of MPTCP listener creation.

Parameters

  [in] | laddr | Local address information.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_load()

MPTCPD_API bool mptcpd_plugin_load | ( | char const * | dir,
|  | char const * | default_name,
|  | struct l_queue const * | plugins_to_load,
|  | struct mptcpd_pm * | pm
| ) |  |

Load mptcpd plugins.

Parameters

  [in] | dir | Directory from which plugins will be loaded.
  [in] | default_name | Name of plugin to be considered the default.
  [in] | plugins_to_load | List of plugins to be loaded.
  [in] | pm | Opaque pointer to mptcpd path manager object.

Returns
  `true` on successful load, `false` otherwise.

Create map of connection token to path manager plugin.

Note
  We use the default ELL direct hash function that converts from a pointer to an `unsigned` `int`.

Todo:
  Determine if this is a performance bottleneck on 64 bit platforms since it is possible that connection IDs may end up in the same hash bucket due to the truncation from 64 bits to 32 bits in ELL's direct hash function, assuming `unsigned` `int` is a 32 bit type.

## mptcpd_plugin_new_address()

MPTCPD_API void mptcpd_plugin_new_address | ( | mptcpd_token_t | token,
|  | mptcpd_aid_t | id,
|  | struct sockaddr const * | addr,
|  | struct mptcpd_pm * | pm
| ) |  |

Notify plugin of new address advertised by a peer.

Parameters

  [in] | token | MPTCP connection token.
  [in] | id | Remote address identifier.
  [in] | addr | Remote address information.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_new_connection()

MPTCPD_API void mptcpd_plugin_new_connection | ( | char const * | name,
|  | mptcpd_token_t | token,
|  | struct sockaddr const * | laddr,
|  | struct sockaddr const * | raddr,
|  | bool | server_side,
|  | struct mptcpd_pm * | pm
| ) |  |

Notify plugin of new MPTCP connection pending completion.

Parameters

  [in] | name | Plugin name.
  [in] | token | MPTCP connection token.
  [in] | laddr | Local address information.
  [in] | raddr | Remote address information.
  [in] | server_side | Server side connection flag.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_new_interface()

MPTCPD_API void mptcpd_plugin_new_interface | ( | struct mptcpd_interface const * | i,
|  | void * | pm
| ) |  |

Notify plugin of new network interface.

Parameters

  [in] | i | Network interface information.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_new_local_address()

MPTCPD_API void mptcpd_plugin_new_local_address | ( | struct mptcpd_interface const * | i,
|  | struct sockaddr const * | sa,
|  | void * | pm
| ) |  |

Notify plugin of new network address.

Parameters

  [in] | i | Network interface information.
  [in] | sa | Network address information.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_new_subflow()

MPTCPD_API void mptcpd_plugin_new_subflow | ( | mptcpd_token_t | token,
|  | struct sockaddr const * | laddr,
|  | struct sockaddr const * | raddr,
|  | bool | backup,
|  | struct mptcpd_pm * | pm
| ) |  |

Notify plugin that a peer has joined the MPTCP connection.

Parameters

  [in] | token | MPTCP connection token.
  [in] | laddr | Local address information.
  [in] | raddr | Remote address information.
  [in] | backup | Backup priority flag.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_subflow_closed()

MPTCPD_API void mptcpd_plugin_subflow_closed | ( | mptcpd_token_t | token,
|  | struct sockaddr const * | laddr,
|  | struct sockaddr const * | raddr,
|  | bool | backup,
|  | struct mptcpd_pm * | pm
| ) |  |

Notify plugin of MPTCP subflow closure.

Parameters

  [in] | token | MPTCP connection token.
  [in] | laddr | Local address information.
  [in] | raddr | Remote address information.
  [in] | backup | Backup priority flag.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_subflow_priority()

MPTCPD_API void mptcpd_plugin_subflow_priority | ( | mptcpd_token_t | token,
|  | struct sockaddr const * | laddr,
|  | struct sockaddr const * | raddr,
|  | bool | backup,
|  | struct mptcpd_pm * | pm
| ) |  |

Notify plugin of MPTCP subflow priority change.

Parameters

  [in] | token | MPTCP connection token.
  [in] | laddr | Local address information.
  [in] | raddr | Remote address information.
  [in] | backup | Backup priority flag.
  [in] | pm | Opaque pointer to mptcpd path manager object.

## mptcpd_plugin_unload()

MPTCPD_API void mptcpd_plugin_unload | ( | struct mptcpd_pm * | pm | ) |

Unload mptcpd plugins.

Parameters

  [in] | pm | Opaque pointer to mptcpd path manager object.

Note
  This isn't thread-safe. We'll need a lock if we ever support destroying multiple path managers from different threads. However, right now there doesn't appear to be a need to support that.

## mptcpd_plugin_update_interface()

MPTCPD_API void mptcpd_plugin_update_interface | ( | struct mptcpd_interface const * | i,
|  | void * | pm
| ) |  |

Notify plugin of updated network interface.

Parameters

  [in] | i | Network interface information.
  [in] | pm | Opaque pointer to mptcpd path manager object.