#include <sockets.h>
Public Member Functions | |
| sockaddrs (const Anope::string &address="") | |
| void | clear () |
| size_t | size () const |
| int | port () const |
| Anope::string | addr () const |
| bool | operator() () const |
| bool | operator== (const sockaddrs &other) const |
| bool | operator!= (const sockaddrs &other) const |
| void | pton (int type, const Anope::string &address, int pport=0) |
| void | ntop (int type, const void *src) |
Data Fields | |
| sockaddr | sa |
| sockaddr_in | sa4 |
| sockaddr_in6 | sa6 |
A sockaddr union used to combine IPv4 and IPv6 sockaddrs
Definition at line 28 of file sockets.h.
| sockaddrs::sockaddrs | ( | const Anope::string & | address = "" |
) |
Construct the object, sets everything to 0
Definition at line 31 of file sockets.cpp.
References clear(), Anope::string::empty(), Anope::string::find(), Anope::string::npos, and pton().
| Anope::string sockaddrs::addr | ( | ) | const |
Get the address represented by this addr
Definition at line 73 of file sockets.cpp.
References inet_ntop, Anope::LastError(), sa, sa4, and sa6.
Referenced by ProxyConnect::Ban(), TCPSocket::Client::Client(), HTTPClient::GetIP(), MyHTTPClient::MyHTTPClient(), ModuleDNSBL::OnUserConnect(), MyPacket::Pack(), MyHTTPClient::Read(), Anope::Resolve(), IRCDMessageNick::Run(), and MyPacket::UnpackResourceRecord().
| void sockaddrs::clear | ( | ) |
| void sockaddrs::ntop | ( | int | type, | |
| const void * | src | |||
| ) |
The equivalent of inet_ntop
| type | AF_INET or AF_INET6 | |
| address | The in_addr or in_addr6 structure |
| A | socket exception if given an invalid structure |
Definition at line 149 of file sockets.cpp.
References inet_ntop, sa4, and sa6.
Referenced by MyPacket::Pack(), IRCDMessageNick::Run(), and MyPacket::UnpackResourceRecord().
| bool sockaddrs::operator!= | ( | const sockaddrs & | other | ) | const [inline] |
| bool sockaddrs::operator() | ( | ) | const |
| bool sockaddrs::operator== | ( | const sockaddrs & | other | ) | const |
Compares with sockaddr with another. Compares address type, port, and address
Definition at line 99 of file sockets.cpp.
| int sockaddrs::port | ( | ) | const |
Get the port represented by this addr
Definition at line 58 of file sockets.cpp.
Referenced by ProxyConnect::Ban().
| void sockaddrs::pton | ( | int | type, | |
| const Anope::string & | address, | |||
| int | pport = 0 | |||
| ) |
The equivalent of inet_pton
| type | AF_INET or AF_INET6 | |
| address | The address to place in the sockaddr structures | |
| pport | An option port to include in the sockaddr structures |
| A | socket exception if given invalid IPs |
Definition at line 116 of file sockets.cpp.
References Anope::string::c_str(), inet_pton, Anope::LastError(), sa4, and sa6.
Referenced by CommandOSDNS::AddIP(), SocketIO::Bind(), cidr::cidr(), SocketIO::Connect(), SSLSocketIO::Connect(), ListenSocket::ListenSocket(), SOCKS5ProxyConnect::OnConnect(), DNSBLResolver::OnLookupComplete(), ModuleProxyScan::OnUserConnect(), ModuleDNSBL::OnUserConnect(), and sockaddrs().
| size_t sockaddrs::size | ( | ) | const |
Get the size of the sockaddr we represent
Definition at line 43 of file sockets.cpp.
Referenced by SocketIO::Bind(), SocketIO::Connect(), SSLSocketIO::Connect(), pipe(), and UDPSocket::ProcessWrite().
| sockaddr sockaddrs::sa |
Definition at line 30 of file sockets.h.
Referenced by SocketIO::Accept(), SSLSocketIO::Accept(), addr(), SocketIO::Bind(), SocketIO::Connect(), SSLSocketIO::Connect(), cidr::match(), cidr::hash::operator()(), operator()(), cidr::operator<(), operator==(), pipe(), port(), UDPSocket::ProcessRead(), UDPSocket::ProcessWrite(), and size().
| sockaddr_in sockaddrs::sa4 |
Definition at line 31 of file sockets.h.
Referenced by addr(), cidr::match(), ntop(), SOCKS5ProxyConnect::OnConnect(), DNSBLResolver::OnLookupComplete(), ModuleDNSBL::OnUserConnect(), cidr::hash::operator()(), cidr::operator<(), operator==(), MyPacket::Pack(), port(), pton(), and size().
| sockaddr_in6 sockaddrs::sa6 |
Definition at line 32 of file sockets.h.
Referenced by addr(), cidr::match(), ntop(), cidr::hash::operator()(), cidr::operator<(), operator==(), MyPacket::Pack(), port(), pton(), and size().
1.7.1