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

mptcpd generic netlink command utilities. More...

#include <string.h>
#include <arpa/inet.h>
#include <ell/ell.h>
#include "commands.h"
Include dependency graph for commands.c:

Macros

#define _POSIX_C_SOURCE   200112L
 For XSI-compliant strerror_r().
 

Functions

uint16_t mptcpd_get_port_number (struct sockaddr const *addr)
 Get TCP port number (host byte order).
 
bool mptcpd_check_genl_error (struct l_genl_msg *msg, char const *fname)
 Check for genl operation failure.
 
void mptcpd_family_send_callback (struct l_genl_msg *msg, void *user_data)
 Generic error reporting callback.
 

Detailed Description

mptcpd generic netlink command utilities.

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

Function Documentation

◆ mptcpd_check_genl_error()

bool mptcpd_check_genl_error ( struct l_genl_msg *  msg,
char const *  fname 
)

Check for genl operation failure.

Check for generic netlink operation failure, and log associated error message.

Parameters
[in]msgGeneric netlink message information.
[in]fnameName function from which the error check was initiated.
Returns
true if no error was found, and false otherwise.

◆ mptcpd_family_send_callback()

void mptcpd_family_send_callback ( struct l_genl_msg *  msg,
void *  user_data 
)

Generic error reporting callback.

Parameters
[in]msgGeneric netlink message information.
[in]user_dataFunction name.

◆ mptcpd_get_port_number()

uint16_t mptcpd_get_port_number ( struct sockaddr const *  addr)

Get TCP port number (host byte order).

Parameters
[in]addrNetwork address information.

Get TCP port suitably typed for use in MPTCP generic netlink API calls, or zero if no address was provided.

Returns
TCP port number in host byte order, or zero if no IP address was provided.