mptcpd
Multipath TCP Daemon
Loading...
Searching...
No Matches
Classes | Macros | Functions
path_manager.c File Reference

mptcpd path manager framework. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <ell/ell.h>
#include <mptcpd/path_manager.h>
#include <mptcpd/private/path_manager.h>
#include <mptcpd/private/plugin.h>
#include <mptcpd/private/network_monitor.h>
#include <mptcpd/network_monitor.h>
#include <mptcpd/private/id_manager.h>
#include <mptcpd/id_manager.h>
#include <mptcpd/private/sockaddr.h>
#include <mptcpd/private/configuration.h>
#include <mptcpd/private/addr_info.h>
#include <mptcpd/private/listener_manager.h>
#include <mptcpd/private/mptcp_upstream.h>
#include "path_manager.h"
#include "netlink_pm.h"
Include dependency graph for path_manager.c:

Classes

struct  pm_event_attrs
 MPTCP generic netlink attribute values. More...
 

Macros

#define MPTCP_GET_NL_ATTR(data, len, attr)
 Retrieve generic netlink attribute.
 

Functions

struct mptcpd_pmmptcpd_pm_create (struct mptcpd_config const *config)
 Create a path manager.
 
void mptcpd_pm_destroy (struct mptcpd_pm *pm)
 

Detailed Description

mptcpd path manager framework.

Copyright (c) 2017-2022, Intel Corporation

Macro Definition Documentation

◆ MPTCP_GET_NL_ATTR

#define MPTCP_GET_NL_ATTR (   data,
  len,
  attr 
)
Value:
do { \
if (validate_attr_len(len, sizeof(*(attr)))) \
(attr) = data; \
} while(0)

Retrieve generic netlink attribute.

This macro is basically a function with a built-in sanity check that casts void* typed data to a variable of desired type.

Parameters
[in]dataPointer to source attribute data.
[in]lenLength (size) of attribute data.
[out]attrPointer to attribute data destination.

Function Documentation

◆ mptcpd_pm_create()

struct mptcpd_pm * mptcpd_pm_create ( struct mptcpd_config const *  config)

Create a path manager.

Parameters
[in]configMptcpd configuration.
Todo:
As currently implemented, one could create multiple path manager instances? Is that useful?
Returns
Pointer to new path manager on success. NULL on failure.

◆ mptcpd_pm_destroy()

void mptcpd_pm_destroy ( struct mptcpd_pm pm)

Destroy a path manager.

Parameters
[in,out]pmPath manager to be destroyed.
Bug:
Mptcpd plugins should only be unloaded once at process exit, or at least after the last mptcpd_pm object has been destroyed.