Utility functions for Dwm::Dns. More...
#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <cstdint>#include <string>

Go to the source code of this file.
Functions | |
| bool | operator== (const in6_addr &addr1, const in6_addr &addr2) |
| bool | operator< (const in6_addr &addr1, const in6_addr &addr2) |
| bool | operator== (const in_addr &addr1, const in_addr &addr2) |
| bool | operator< (const in_addr &addr1, const in_addr &addr2) |
| uint8_t * | Dwm::Dns::EncodeCharacterString (const std::string &s, uint8_t *pkt, uint8_t *ptr, uint16_t pktlen) |
Encodes the given string into buffer pkt of length pktlen as a DNS 'character string' starting at ptr. More... | |
| const uint8_t * | Dwm::Dns::DecodeCharacterString (std::string &s, const uint8_t *pkt, const uint8_t *ptr, uint16_t pktlen) |
Decodes a DNS 'character string' from buffer pkt of length pktlen into s, starting at ptr. More... | |
| bool | Dwm::Dns::ToArpa (const std::string &ipAddr, std::string &arpa) |
Converts the given IP address ipAddr into arpa in ARPA domain form. More... | |
| void | Dwm::Dns::ToArpa (const in_addr &inAddr, std::string &arpa) |
Converts the given IPv4 address inAddr into arpa in ARPA domain form. More... | |
| void | Dwm::Dns::ToArpa (const in6_addr &in6Addr, std::string &arpa) |
Converts the given IPv6 address in6Addr into arpa in ARPA domain form. More... | |
| bool | Dwm::Dns::FromArpa (const std::string &arpa, std::string &ipAddr) |
Converts the given ARPA domain arpa into ipAddr. More... | |
Utility functions for Dwm::Dns.
| const uint8_t* Dwm::Dns::DecodeCharacterString | ( | std::string & | s, |
| const uint8_t * | pkt, | ||
| const uint8_t * | ptr, | ||
| uint16_t | pktlen | ||
| ) |
Decodes a DNS 'character string' from buffer pkt of length pktlen into s, starting at ptr.
Returns the address immediately following the encoded character string in pkt on success. Throws std::out_of_range if pkt was too short to contain the encoded character string.
| uint8_t* Dwm::Dns::EncodeCharacterString | ( | const std::string & | s, |
| uint8_t * | pkt, | ||
| uint8_t * | ptr, | ||
| uint16_t | pktlen | ||
| ) |
Encodes the given string into buffer pkt of length pktlen as a DNS 'character string' starting at ptr.
Returns the address immediately following the encoded character string in pkt on success. Throws std::out_of_range if the encoded character string will not fit in pkt.
| bool Dwm::Dns::FromArpa | ( | const std::string & | arpa, |
| std::string & | ipAddr | ||
| ) |
Converts the given ARPA domain arpa into ipAddr.
Returns true on success, false on failure.
| bool Dwm::Dns::ToArpa | ( | const std::string & | ipAddr, |
| std::string & | arpa | ||
| ) |
Converts the given IP address ipAddr into arpa in ARPA domain form.
ARPA form is used for PTR lookups. Returns true on success, false on failure.
| void Dwm::Dns::ToArpa | ( | const in_addr & | inAddr, |
| std::string & | arpa | ||
| ) |
Converts the given IPv4 address inAddr into arpa in ARPA domain form.
ARPA form is used for PTR lookups.
| void Dwm::Dns::ToArpa | ( | const in6_addr & | in6Addr, |
| std::string & | arpa | ||
| ) |
Converts the given IPv6 address in6Addr into arpa in ARPA domain form.
ARPA form is used for PTR lookups.