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

Map of MPTCP local address ID to listener. More...

#include <assert.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <ell/ell.h>
#include <mptcpd/private/murmur_hash.h>
#include <mptcpd/private/listener_manager.h>
#include <mptcpd/listener_manager.h>
#include "hash_sockaddr.h"
Include dependency graph for listener_manager.c:

Classes

struct  mptcpd_lm
 Internal mptcpd listern manager data. More...
 
struct  lm_value
 mptcpd listener map entry value. More...
 
struct  key_in
 Bundle IPv4 address and port as a hash key. More...
 
struct  key_in6
 Bundle IPv6 address and port as a hash key. More...
 

Macros

#define IPPROTO_MPTCP   IPPROTO_TCP + 256
 

Functions

struct mptcpd_lmmptcpd_lm_create (void)
 Create a MPTCP listener manager.
 
void mptcpd_lm_destroy (struct mptcpd_lm *lm)
 Destroy MPTCP listener manager.
 
int mptcpd_lm_listen (struct mptcpd_lm *lm, struct sockaddr *sa)
 Listen on the given MPTCP local address.
 
int mptcpd_lm_close (struct mptcpd_lm *lm, struct sockaddr const *sa)
 Stop listening on a MPTCP local address.
 

Detailed Description

Map of MPTCP local address ID to listener.

Copyright (c) 2022, Intel Corporation

Function Documentation

◆ mptcpd_lm_close()

int mptcpd_lm_close ( struct mptcpd_lm lm,
struct sockaddr const *  sa 
)

Stop listening on a MPTCP local address.

Parameters
[in]lmThe mptcpd address listener manager object.
[in]saThe MPTCP local address with a non-zero port, such as the one assigned by mptcpd_lm_listen(), i.e. the non-zero port provided by the user or the ephemeral port chosen by the kernel.
Returns
0 if operation was successful. -1 or errno otherwise.

◆ mptcpd_lm_create()

struct mptcpd_lm * mptcpd_lm_create ( void  )

Create a MPTCP listener manager.

Returns
Pointer to a MPTCP listener manager on success. NULL on failure.

◆ mptcpd_lm_destroy()

void mptcpd_lm_destroy ( struct mptcpd_lm lm)

Destroy MPTCP listener manager.

Parameters
[in,out]lmThe mptcpd address listener manager object.

◆ mptcpd_lm_listen()

int mptcpd_lm_listen ( struct mptcpd_lm lm,
struct sockaddr *  sa 
)

Listen on the given MPTCP local address.

Create a MPTCP listening socket for the given local address. This is needed to accept subflows, e.g. during a MP_JOIN operation.

Parameters
[in]lmThe mptcpd address listener manager object.
[in,out]saThe MPTCP local address. If the port is zero an ephemeral port will be chosen, and assigned to the appropriate underlying address family-specific port member, e.g. sin_port or sin6_port. The port will be in network byte order.
Returns
0 if operation was successful. -1 or errno otherwise.