Loading...
Searching...
No Matches
addr_info.c File Reference

`mptcpd_addr_info` related functions. More...

`#include <mptcpd/addr_info.h>`
`#include <mptcpd/private/addr_info.h>`
Include dependency graph for addr_info.c:

## Functions

struct sockaddr const * | mptcpd_addr_info_get_addr (struct mptcpd_addr_info const *info)
| Get underlying network address related information.
mptcpd_aid_t | mptcpd_addr_info_get_id (struct mptcpd_addr_info const *info)
| Get MPTCP address ID.
mptcpd_flags_t | mptcpd_addr_info_get_flags (struct mptcpd_addr_info const *info)
| Get mptcpd flags associated with a network address.
int | mptcpd_addr_info_get_index (struct mptcpd_addr_info const *info)
| Get network interface index associated with an address.

## Detailed Description

`mptcpd_addr_info` related functions.

Copyright (c) 2021, Intel Corporation

## Function Documentation

## mptcpd_addr_info_get_addr()

struct sockaddr const * mptcpd_addr_info_get_addr | ( | struct mptcpd_addr_info const * | info | ) |

Get underlying network address related information.

Parameters

  [in] | info | Mptcpd address information.

Returns
  `sockaddr` object containing the underlying network address information. Cast to a `const` pointer to a `sockaddr_in` or `sockaddr_in6` depending on the address family in the `sa_family` field. `NULL` is returned on error.

## mptcpd_addr_info_get_flags()

mptcpd_flags_t mptcpd_addr_info_get_flags | ( | struct mptcpd_addr_info const * | info | ) |

Get mptcpd flags associated with a network address.

Parameters

  [in] | info | Mptcpd address information.

Returns
  Mptcpd flags bitmask associated with the network address encapsulated by info. 0 is returned on error.

## mptcpd_addr_info_get_id()

mptcpd_aid_t mptcpd_addr_info_get_id | ( | struct mptcpd_addr_info const * | info | ) |

Get MPTCP address ID.

Parameters

  [in] | info | Mptcpd address information.

Returns
  MPTCP address ID corresponding to network address encapsulated by info. 0 is returned on error.

Todo
  Good value to return on error?

## mptcpd_addr_info_get_index()

int mptcpd_addr_info_get_index | ( | struct mptcpd_addr_info const * | info | ) |

Get network interface index associated with an address.

Parameters

  [in] | info | Mptcpd address information.

Returns
  Network interface index associated with the network address encapsulated by info. -1 is returned on error.