Classes | |
class | clan::DNSPacket |
DNS packet. More... | |
class | clan::DNSResolver |
DNS resolver. More... | |
class | clan::DNSResourceRecord |
DNS resource record. More... | |
class | clan::SocketName |
Socket name; container class for an IP address and port. More... | |
class | clan::TCPConnection |
TCP connection socket I/O device. More... | |
class | clan::TCPListen |
TCP listen socket. More... | |
class | clan::TLSConnection |
TLS connection over an I/O device. More... | |
class | clan::UDPSocket |
UDP socket. More... | |
Construction | |
clan::DNSPacket::DNSPacket () | |
clan::DNSPacket::DNSPacket (const DataBuffer &data) | |
Constructs a DNSPacket. More... | |
clan::DNSPacket::DNSPacket (int query_id, int opcode, bool recursion_desired, const std::string &question_name, int question_type, int question_class) | |
clan::DNSPacket::~DNSPacket () | |
Operations | |
void | clan::DNSPacket::set_data (const DataBuffer &data) |
Set data. More... | |
void | clan::DNSPacket::set_query_id (unsigned short query_id) |
Set query id. More... | |
Construction | |
clan::DNSResolver::DNSResolver () | |
clan::DNSResolver::~DNSResolver () | |
Operations | |
std::vector< DNSResourceRecord > | clan::DNSResolver::lookup_resource (const std::string &domain_name, const std::string &resource_type, int timeout) |
DNSPacket | clan::DNSResolver::perform_query (DNSPacket &packet, int timeout, const std::string &dns_server_name) |
DNSPacket | clan::DNSResolver::perform_query (const std::string &domain_name, const std::string &resource_type, int timeout, const std::string &dns_server_name) |
Construction | |
clan::DNSResourceRecord::DNSResourceRecord () | |
clan::DNSResourceRecord::~DNSResourceRecord () | |
Operation | |
void | clan::DNSResourceRecord::set_record (DNSPacket packet, int record_offset) |
Set record. More... | |
static int | clan::DNSResourceRecord::type_to_int (const std::string &qtype) |
Type to int. More... | |
static std::string | clan::DNSResourceRecord::type_from_int (int qtype) |
Type from int. More... | |
static std::string | clan::DNSResourceRecord::type_description (const std::string &qtype) |
Type description. More... | |
static std::string | clan::DNSResourceRecord::type_description (int qtype) |
Type description. More... | |
static int | clan::DNSResourceRecord::class_to_int (const std::string &qclass) |
Class to int. More... | |
static std::string | clan::DNSResourceRecord::class_from_int (int qclass) |
Class from int. More... | |
static std::string | clan::DNSResourceRecord::class_description (const std::string &qclass) |
Class description. More... | |
static std::string | clan::DNSResourceRecord::class_description (int qclass) |
Class description. More... | |
static int | clan::DNSResourceRecord::find_domain_name_end (const DataBuffer &packet, int offset) |
Find domain name end. More... | |
static std::string | clan::DNSResourceRecord::read_domain_name (const DataBuffer &packet, int offset) |
Read domain name. More... | |
Construction | |
clan::SocketName::SocketName () | |
Constructs a new socket name. More... | |
clan::SocketName::SocketName (const std::string &port) | |
Constructs a SocketName. More... | |
clan::SocketName::SocketName (const std::string &address, const std::string &port) | |
Constructs a SocketName. More... | |
Attributes | |
std::string | clan::SocketName::get_address () const |
Returns the address part of the socket name. More... | |
std::string | clan::SocketName::get_port () const |
Returns the port part of the socket name. More... | |
bool | clan::SocketName::operator== (const SocketName &other_instance) const |
Returns true if objects are the same. More... | |
bool | clan::SocketName::operator< (const SocketName &other_instance) const |
Returns true if the other address is less. More... | |
bool | clan::SocketName::operator> (const SocketName &other_instance) const |
Returns true if the other address is greater. More... | |
Operations | |
void | clan::SocketName::set_name (const std::string &hostname, const std::string &port) |
Set the socket name using a hostname and port. More... | |
void | clan::SocketName::set_address (const std::string &address) |
Set the IP address. More... | |
void | clan::SocketName::set_port (const std::string &port) |
Set the IP port. More... | |
std::string | clan::SocketName::lookup_ipv4 () const |
Perform a DNS lookup, if needed, for the IP v4 address. More... | |
std::string | clan::SocketName::lookup_hostname () const |
Perform a DNS lookup, if needed, for the hostname. More... | |
SocketName | clan::SocketName::to_ipv4 () |
Create socket name that uses the IP v4 address as its address. More... | |
SocketName | clan::SocketName::to_hostname () |
Create socket name that uses the hostname as its address. More... | |
void | clan::SocketName::to_sockaddr (int domain, sockaddr *addr, int len) const |
Fill the socket name into a C sockets sockaddr structure. More... | |
void | clan::SocketName::from_sockaddr (int domain, sockaddr *addr, int len) |
Get the socket name from a C sockets sockaddr structure. More... | |
Construction | |
clan::TCPConnection::TCPConnection () | |
clan::TCPConnection::TCPConnection (const SocketName &remote) | |
Constructs a TCPConnection. More... | |
clan::TCPConnection::TCPConnection (const SocketName &remote, const SocketName &local) | |
Constructs a TCPConnection. More... | |
clan::TCPConnection::TCPConnection (int socket, bool close_socket) | |
Constructs a TCPConnection. More... | |
clan::TCPConnection::~TCPConnection () | |
Attributes | |
int | clan::TCPConnection::get_handle () const |
Get Handle. More... | |
SocketName | clan::TCPConnection::get_local_name () const |
Get Local name. More... | |
SocketName | clan::TCPConnection::get_remote_name () const |
Get Remote name. More... | |
Event | clan::TCPConnection::get_read_event () |
Get Read event. More... | |
Event | clan::TCPConnection::get_write_event () |
Get Write event. More... | |
Operations | |
void | clan::TCPConnection::connect (const SocketName &remote) |
Connect. More... | |
void | clan::TCPConnection::connect (const SocketName &remote, const SocketName &local) |
Connect. More... | |
void | clan::TCPConnection::set_handle (int socket, bool close_socket) |
Set handle. More... | |
void | clan::TCPConnection::disconnect_graceful () |
Performs a graceful shutdown, ensuring all data is sent before the connection is closed. More... | |
void | clan::TCPConnection::disconnect_abortive () |
Performs an abortive shutdown, closing the connection immediately. More... | |
void | clan::TCPConnection::set_nodelay (bool enable=true) |
Disables or enables buffering data before it is sent. More... | |
void | clan::TCPConnection::set_keep_alive (bool enable, int timeout=0, int interval=0) |
Enables or disables transmitting keep-alive packets. More... | |
Construction | |
clan::TCPListen::TCPListen (const SocketName &name, int queue_size=5, bool force_bind=true) | |
Constructs a TCPListen. More... | |
clan::TCPListen::~TCPListen () | |
Attributes | |
Event | clan::TCPListen::get_accept_event () const |
Get Accept event. More... | |
int | clan::TCPListen::get_handle () const |
Get Handle. More... | |
Operations | |
TCPConnection | clan::TCPListen::accept () |
Accept. More... | |
Construction | |
clan::UDPSocket::UDPSocket () | |
clan::UDPSocket::UDPSocket (const SocketName &local_name, bool force_bind=true) | |
Constructs a UDPSocket. More... | |
clan::UDPSocket::UDPSocket (int socket, bool close_socket) | |
Constructs a UDPSocket. More... | |
clan::UDPSocket::~UDPSocket () | |
Attributes | |
int | clan::UDPSocket::get_handle () const |
Get Handle. More... | |
SocketName | clan::UDPSocket::get_local_name () const |
Get Local name. More... | |
Event | clan::UDPSocket::get_read_event () |
Get Read event. More... | |
Event | clan::UDPSocket::get_write_event () |
Get Write event. More... | |
Operations | |
void | clan::UDPSocket::bind (const SocketName &local_name, bool force_bind=true) |
Bind. More... | |
void | clan::UDPSocket::set_handle (int socket, bool close_socket) |
Set handle. More... | |
int | clan::UDPSocket::send (const void *data, int len, const SocketName &to) |
Send. More... | |
int | clan::UDPSocket::receive (void *data, int len, SocketName &out_from) |
Receive. More... | |
int | clan::UDPSocket::peek (void *data, int len, SocketName &out_from) |
Peek. More... | |
Construction | |
clan::TLSConnection::TLSConnection () | |
clan::TLSConnection::TLSConnection (TCPConnection &device) | |
Make a TLS connection to a server. More... | |
clan::TLSConnection::~TLSConnection () | |
Operations | |
void | clan::TLSConnection::connect (TCPConnection &device) |
Make a TLS connection to a server. More... | |
void | clan::TLSConnection::disconnect () |
Disconnect the TLS connection. More... | |
clan::DNSPacket::DNSPacket | ( | ) |
clan::DNSPacket::DNSPacket | ( | const DataBuffer & | data | ) |
Constructs a DNSPacket.
data | = Data Buffer |
clan::DNSPacket::DNSPacket | ( | int | query_id, |
int | opcode, | ||
bool | recursion_desired, | ||
const std::string & | question_name, | ||
int | question_type, | ||
int | question_class | ||
) |
clan::DNSResolver::DNSResolver | ( | ) |
clan::DNSResourceRecord::DNSResourceRecord | ( | ) |
clan::SocketName::SocketName | ( | ) |
Constructs a new socket name.
If no address is specified, the socket address will default to INADDR_ANY. If no port is specified, it will default to port 0.
clan::SocketName::SocketName | ( | const std::string & | port | ) |
Constructs a SocketName.
port | = String |
clan::SocketName::SocketName | ( | const std::string & | address, |
const std::string & | port | ||
) |
Constructs a SocketName.
address | = String |
port | = String |
clan::TCPConnection::TCPConnection | ( | ) |
clan::TCPConnection::TCPConnection | ( | const SocketName & | remote | ) |
Constructs a TCPConnection.
remote | = Socket Name |
clan::TCPConnection::TCPConnection | ( | const SocketName & | remote, |
const SocketName & | local | ||
) |
Constructs a TCPConnection.
remote | = Socket Name |
local | = Socket Name |
clan::TCPConnection::TCPConnection | ( | int | socket, |
bool | close_socket | ||
) |
Constructs a TCPConnection.
socket | = value |
close_socket | = bool |
clan::TCPListen::TCPListen | ( | const SocketName & | name, |
int | queue_size = 5 , |
||
bool | force_bind = true |
||
) |
Constructs a TCPListen.
name | = Socket Name |
queue_size | = value |
force_bind | = bool |
clan::TLSConnection::TLSConnection | ( | ) |
clan::TLSConnection::TLSConnection | ( | TCPConnection & | device | ) |
Make a TLS connection to a server.
device | = The device |
clan::UDPSocket::UDPSocket | ( | ) |
clan::UDPSocket::UDPSocket | ( | const SocketName & | local_name, |
bool | force_bind = true |
||
) |
Constructs a UDPSocket.
local_name | = Socket Name |
force_bind | = bool |
clan::UDPSocket::UDPSocket | ( | int | socket, |
bool | close_socket | ||
) |
Constructs a UDPSocket.
socket | = value |
close_socket | = bool |
clan::DNSPacket::~DNSPacket | ( | ) |
clan::DNSResolver::~DNSResolver | ( | ) |
clan::DNSResourceRecord::~DNSResourceRecord | ( | ) |
clan::TCPConnection::~TCPConnection | ( | ) |
clan::TCPListen::~TCPListen | ( | ) |
clan::TLSConnection::~TLSConnection | ( | ) |
clan::UDPSocket::~UDPSocket | ( | ) |
TCPConnection clan::TCPListen::accept | ( | ) |
Accept.
void clan::UDPSocket::bind | ( | const SocketName & | local_name, |
bool | force_bind = true |
||
) |
Bind.
local_name | = Socket Name |
force_bind | = bool |
|
static |
Class description.
qclass | = String |
|
static |
Class description.
qclass | = value |
|
static |
Class from int.
qclass | = value |
|
static |
Class to int.
qclass | = String |
void clan::TLSConnection::connect | ( | TCPConnection & | device | ) |
Make a TLS connection to a server.
device | = The device |
void clan::TCPConnection::connect | ( | const SocketName & | remote | ) |
Connect.
remote | = Socket Name |
void clan::TCPConnection::connect | ( | const SocketName & | remote, |
const SocketName & | local | ||
) |
Connect.
remote | = Socket Name |
local | = Socket Name |
void clan::TLSConnection::disconnect | ( | ) |
Disconnect the TLS connection.
void clan::TCPConnection::disconnect_abortive | ( | ) |
Performs an abortive shutdown, closing the connection immediately.
void clan::TCPConnection::disconnect_graceful | ( | ) |
Performs a graceful shutdown, ensuring all data is sent before the connection is closed.
|
static |
Find domain name end.
packet | = Data Buffer |
offset | = value |
void clan::SocketName::from_sockaddr | ( | int | domain, |
sockaddr * | addr, | ||
int | len | ||
) |
Get the socket name from a C sockets sockaddr structure.
unsigned int clan::DNSResourceRecord::get_a_address | ( | ) | const |
std::string clan::DNSResourceRecord::get_a_address_str | ( | ) | const |
Get A address str.
Event clan::TCPListen::get_accept_event | ( | ) | const |
Get Accept event.
DNSResourceRecord clan::DNSPacket::get_additional | ( | int | index | ) | const |
Get additional.
index | = value |
int clan::DNSPacket::get_additional_count | ( | ) | const |
Get Additional count.
std::string clan::SocketName::get_address | ( | ) | const |
Returns the address part of the socket name.
DNSResourceRecord clan::DNSPacket::get_answer | ( | int | index | ) | const |
Get answer.
index | = value |
int clan::DNSPacket::get_answer_count | ( | ) | const |
Get Answer count.
std::string clan::DNSResourceRecord::get_class | ( | ) | const |
Get Class.
std::string clan::DNSResourceRecord::get_cname_cname | ( | ) | const |
Get Cname cname.
const DataBuffer& clan::DNSPacket::get_data | ( | ) | const |
int clan::TCPListen::get_handle | ( | ) | const |
Get Handle.
int clan::UDPSocket::get_handle | ( | ) | const |
Get Handle.
int clan::TCPConnection::get_handle | ( | ) | const |
Get Handle.
SocketName clan::UDPSocket::get_local_name | ( | ) | const |
Get Local name.
SocketName clan::TCPConnection::get_local_name | ( | ) | const |
Get Local name.
std::string clan::DNSResourceRecord::get_mx_exchange | ( | ) | const |
Get Mx exchange.
int clan::DNSResourceRecord::get_mx_preference | ( | ) | const |
Get Mx preference.
std::string clan::DNSResourceRecord::get_name | ( | ) | const |
Get Name.
DNSResourceRecord clan::DNSPacket::get_nameserver | ( | int | index | ) | const |
Get nameserver.
index | = value |
int clan::DNSPacket::get_nameserver_count | ( | ) | const |
Get Nameserver count.
std::string clan::DNSResourceRecord::get_ns_nsdname | ( | ) | const |
Get Ns nsdname.
int clan::DNSPacket::get_opcode | ( | ) | const |
Get Opcode.
const DNSPacket& clan::DNSResourceRecord::get_packet | ( | ) | const |
std::string clan::SocketName::get_port | ( | ) | const |
Returns the port part of the socket name.
std::string clan::DNSResourceRecord::get_ptr_ptrdname | ( | ) | const |
Get Ptr ptrdname.
unsigned short clan::DNSPacket::get_query_id | ( | ) | const |
int clan::DNSPacket::get_question_class | ( | int | index | ) | const |
Get question class.
index | = value |
int clan::DNSPacket::get_question_count | ( | ) | const |
Get Question count.
std::string clan::DNSPacket::get_question_name | ( | int | index | ) | const |
Get question name.
index | = value |
int clan::DNSPacket::get_question_type | ( | int | index | ) | const |
Get question type.
index | = value |
int clan::DNSResourceRecord::get_rdata_length | ( | ) | const |
Get Rdata length.
int clan::DNSResourceRecord::get_rdata_offset | ( | ) | const |
Get Rdata offset.
Event clan::UDPSocket::get_read_event | ( | ) |
Get Read event.
Event clan::TCPConnection::get_read_event | ( | ) |
Get Read event.
int clan::DNSResourceRecord::get_record_offset | ( | ) | const |
Get Record offset.
SocketName clan::TCPConnection::get_remote_name | ( | ) | const |
Get Remote name.
int clan::DNSPacket::get_response_code | ( | ) | const |
Get Response code.
int clan::DNSResourceRecord::get_soa_expire | ( | ) | const |
Get Soa expire.
unsigned int clan::DNSResourceRecord::get_soa_minimum | ( | ) | const |
std::string clan::DNSResourceRecord::get_soa_mname | ( | ) | const |
Get Soa mname.
int clan::DNSResourceRecord::get_soa_refresh | ( | ) | const |
Get Soa refresh.
int clan::DNSResourceRecord::get_soa_retry | ( | ) | const |
Get Soa retry.
std::string clan::DNSResourceRecord::get_soa_rname | ( | ) | const |
Get Soa rname.
unsigned int clan::DNSResourceRecord::get_soa_serial | ( | ) | const |
int clan::DNSResourceRecord::get_ttl | ( | ) | const |
Get Ttl.
std::string clan::DNSResourceRecord::get_type | ( | ) | const |
Get Type.
unsigned int clan::DNSResourceRecord::get_wks_address | ( | ) | const |
std::string clan::DNSResourceRecord::get_wks_address_str | ( | ) | const |
Get Wks address str.
DataBuffer clan::DNSResourceRecord::get_wks_bit_map | ( | ) | const |
Get Wks bit map.
unsigned char clan::DNSResourceRecord::get_wks_protocol | ( | ) | const |
Event clan::UDPSocket::get_write_event | ( | ) |
Get Write event.
Event clan::TCPConnection::get_write_event | ( | ) |
Get Write event.
bool clan::DNSPacket::is_authoriative_answer | ( | ) | const |
Is Authoriative answer.
bool clan::DNSPacket::is_query | ( | ) | const |
Is Query.
bool clan::DNSPacket::is_recursion_available | ( | ) | const |
Is Recursion available.
bool clan::DNSPacket::is_recursion_desired | ( | ) | const |
Is Recursion desired.
bool clan::DNSPacket::is_response | ( | ) | const |
Is Response.
bool clan::DNSPacket::is_truncated | ( | ) | const |
Is Truncated.
std::string clan::SocketName::lookup_hostname | ( | ) | const |
Perform a DNS lookup, if needed, for the hostname.
std::string clan::SocketName::lookup_ipv4 | ( | ) | const |
Perform a DNS lookup, if needed, for the IP v4 address.
std::vector<DNSResourceRecord> clan::DNSResolver::lookup_resource | ( | const std::string & | domain_name, |
const std::string & | resource_type, | ||
int | timeout | ||
) |
bool clan::SocketName::operator< | ( | const SocketName & | other_instance | ) | const |
Returns true if the other address is less.
This is used for sorting purposes (eg. if you use a std::map<SocketName, Socket>), and sorts the address based on lowest IP number address.
bool clan::SocketName::operator== | ( | const SocketName & | other_instance | ) | const |
Returns true if objects are the same.
bool clan::SocketName::operator> | ( | const SocketName & | other_instance | ) | const |
Returns true if the other address is greater.
This is used for sorting purposes (eg. if you use a std::map<SocketName, Socket>), and sorts the address based on lowest IP number address.
int clan::UDPSocket::peek | ( | void * | data, |
int | len, | ||
SocketName & | out_from | ||
) |
Peek.
data | = void |
len | = value |
out_from | = Socket Name |
DNSPacket clan::DNSResolver::perform_query | ( | DNSPacket & | packet, |
int | timeout, | ||
const std::string & | dns_server_name | ||
) |
DNSPacket clan::DNSResolver::perform_query | ( | const std::string & | domain_name, |
const std::string & | resource_type, | ||
int | timeout, | ||
const std::string & | dns_server_name | ||
) |
|
static |
Read domain name.
packet | = Data Buffer |
offset | = value |
int clan::UDPSocket::receive | ( | void * | data, |
int | len, | ||
SocketName & | out_from | ||
) |
Receive.
data | = void |
len | = value |
out_from | = Socket Name |
int clan::UDPSocket::send | ( | const void * | data, |
int | len, | ||
const SocketName & | to | ||
) |
Send.
data | = void |
len | = value |
to | = Socket Name |
void clan::SocketName::set_address | ( | const std::string & | address | ) |
Set the IP address.
void clan::DNSPacket::set_data | ( | const DataBuffer & | data | ) |
Set data.
data | = Data Buffer |
void clan::UDPSocket::set_handle | ( | int | socket, |
bool | close_socket | ||
) |
Set handle.
socket | = value |
close_socket | = bool |
void clan::TCPConnection::set_handle | ( | int | socket, |
bool | close_socket | ||
) |
Set handle.
socket | = value |
close_socket | = bool |
void clan::TCPConnection::set_keep_alive | ( | bool | enable, |
int | timeout = 0 , |
||
int | interval = 0 |
||
) |
Enables or disables transmitting keep-alive packets.
enable | = True to enable keep-alive, false to disable |
timeout | = Specifies the timeout, in milliseconds, with no activity until the first keep-alive packet is sent. |
interval | = Specifies the interval, in milliseconds, between when successive keep-alive packets are sent if no acknowledgment is received. |
Both timeout and interval must be set to a non-zero value before any of them are used. They cannot be specified individually.
void clan::SocketName::set_name | ( | const std::string & | hostname, |
const std::string & | port | ||
) |
Set the socket name using a hostname and port.
hostname | Can be an IPv4 dotted-quad, hostname or a valid IPv6 address. |
port | Port number. |
void clan::TCPConnection::set_nodelay | ( | bool | enable = true | ) |
Disables or enables buffering data before it is sent.
void clan::SocketName::set_port | ( | const std::string & | port | ) |
Set the IP port.
void clan::DNSPacket::set_query_id | ( | unsigned short | query_id | ) |
Set query id.
query_id | = short |
void clan::DNSResourceRecord::set_record | ( | DNSPacket | packet, |
int | record_offset | ||
) |
Set record.
packet | = DNSPacket |
record_offset | = value |
SocketName clan::SocketName::to_hostname | ( | ) |
Create socket name that uses the hostname as its address.
SocketName clan::SocketName::to_ipv4 | ( | ) |
Create socket name that uses the IP v4 address as its address.
void clan::SocketName::to_sockaddr | ( | int | domain, |
sockaddr * | addr, | ||
int | len | ||
) | const |
Fill the socket name into a C sockets sockaddr structure.
|
static |
Type description.
qtype | = String |
|
static |
Type description.
qtype | = value |
|
static |
Type from int.
qtype | = value |
|
static |
Type to int.
qtype | = String |