17 #ifndef HH_SENF_Socket_Protocols_BSDSocketAddress_ 18 #define HH_SENF_Socket_Protocols_BSDSocketAddress_ 1 22 #include <sys/socket.h> 23 #include <boost/type_traits/alignment_of.hpp> 24 #include <boost/type_traits/type_with_alignment.hpp> 25 #include <boost/operators.hpp> 69 public boost::less_than_comparable<BSDSocketAddress>,
70 public boost::equality_comparable<BSDSocketAddress>
120 boost::type_with_alignment<boost::alignment_of<struct sockaddr_storage>::value>
a_;
121 char _b[boost::alignment_of<struct sockaddr_storage>::value];
134 template <
class Target>
141 template <
class Target>
193 struct sockaddr_storage addr_;
bool operator<(BSDSocketAddress const &other) const
Compare two arbitrary addresses.
boost::type_with_alignment< boost::alignment_of< struct sockaddr_storage >::value > a_
char _b[boost::alignment_of< struct sockaddr_storage >::value]
bool boolean_test() const
Return true, if address is not empty.
BSDSocketAddress & operator=(BSDSocketAddress const &other)
socklen_t const * socklen_p() const
BSDSocketAddress(socklen_t len, short family)
Socket addressing, BSD style.
struct sockaddr const * sockaddr_p() const
bool operator==(BSDSocketAddress const &other) const
Compare two arbitrary addresses.
std::ostream & operator<<(std::ostream &os, BSDSocketAddress const &addr)
Output generic socket address.
short family() const
Return the address family.
Target & sockaddr_cast(BSDSocketAddress &source)
Safe socket address down-cast.
socklen_t socklen() const
Generic BSD sockaddr storage.