7 #ifndef SOCKADDR_UTIL_H
8 #define SOCKADDR_UTIL_H 1
10 #include <sys/types.h>
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));
39 template <
typename SAType>
40 const struct sockaddr*
43 return (static_cast<const struct sockaddr*>(p));
46 template <
typename SAType>
50 return (static_cast<const SAType*>(p));
53 template <
typename SAType>
57 return (static_cast<struct sockaddr*>(p));
60 template <
typename SAType>
64 return (static_cast<SAType*>(p));
72 #endif // SOCKADDR_UTIL_H
#define isc_throw_assert(expr)
Replacement for assert() that throws if the expression is false.
socklen_t getSALength(const struct sockaddr &sa)
Defines the logger used by the top-level component of kea-dhcp-ddns.
const struct sockaddr * convertSockAddr(const SAType *sa)