8#define SOCKADDR_UTIL_H 1
11#include <sys/socket.h>
12#include <netinet/in.h>
27 if (sa.sa_family == AF_INET) {
28 return (
sizeof(
struct sockaddr_in));
31 return (
sizeof(
struct sockaddr_in6));
39template <
typename SAType>
43 return (
static_cast<const struct sockaddr*
>(p));
46template <
typename SAType>
50 return (
static_cast<const SAType*
>(p));
53template <
typename SAType>
57 return (
static_cast<struct sockaddr*
>(p));
60template <
typename SAType>
64 return (
static_cast<SAType*
>(p));
#define isc_throw_assert(expr)
Replacement for assert() that throws if the expression is false.
const struct sockaddr * convertSockAddr(const SAType *sa)
socklen_t getSALength(const struct sockaddr &sa)
Defines the logger used by the top-level component of kea-lfc.