Loading...
Searching...
No Matches
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] | msg | Generic netlink message information.
  [in] | fname | Name 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] | msg | Generic netlink message information.
  [in] | user_data | Function name.

## mptcpd_get_port_number()

uint16_t mptcpd_get_port_number | ( | struct sockaddr const * | addr | ) |

Get TCP port number (host byte order).

Parameters

  [in] | addr | Network 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.