|
mptcpd
Multipath TCP Daemon
|
mptcpd struct sockaddr related utility functions.
More...
#include <stdbool.h>#include <endian.h>#include <byteswap.h>#include <netinet/in.h>#include <mptcpd/export.h>

Go to the source code of this file.
Functions | |
| MPTCPD_API bool | mptcpd_sockaddr_storage_init (in_addr_t const *addr4, struct in6_addr const *addr6, in_port_t port, struct sockaddr_storage *addr) |
Initialize sockaddr_storage instance. | |
| MPTCPD_API struct sockaddr * | mptcpd_sockaddr_copy (struct sockaddr const *sa) |
Deep copy a sockaddr. | |
mptcpd struct sockaddr related utility functions.
Copyright (c) 2019-2022, Intel Corporation
| MPTCPD_API struct sockaddr * mptcpd_sockaddr_copy | ( | struct sockaddr const * | sa | ) |
Deep copy a sockaddr.
Copy the address family-specific contents of a sockaddr. For an AF_INET address family, a struct sockaddr_in will be dynamically allocated and copied from sa. Similarly, struct sockaddr_in6 will be allocated and copied from sa for the AF_INET6 address family case.
sa_family member is AF_INET or AF_INET6, and NULL otherwise. Deallocate with l_free(). | MPTCPD_API bool mptcpd_sockaddr_storage_init | ( | in_addr_t const * | addr4, |
| struct in6_addr const * | addr6, | ||
| in_port_t | port, | ||
| struct sockaddr_storage * | addr | ||
| ) |
Initialize sockaddr_storage instance.
Initialize a sockaddr_storage instance with the provided IPv4 or IPv6 address. Only one is required and used. The port may be zero in cases where it is optional.
| [in] | addr4 | IPv4 internet address (network byte order). |
| [in] | addr6 | IPv6 internet address. |
| [in] | port | TCP port (network byte order). |
| [in,out] | addr | mptcpd network address information. |
true on success. false otherwise.