Functions | |
| std::string | resolve_hostname (const std::string &hostname) |
| Resolve hostname to IP address. | |
| std::string | resolve_hostname_v6 (const std::string &hostname) |
| Resolve hostname to IPv6 address. | |
| bool | is_valid_ipv4 (const std::string &ip_str) |
| Check if a string is a valid IPv4 address. | |
| bool | is_valid_ipv6 (const std::string &ip_str) |
| Check if a string is a valid IPv6 address. | |
| bool | is_hostname (const std::string &str) |
| Check if a string is a hostname (not an IP address) | |
| std::string | to_ip_address (const std::string &host) |
| Convert hostname or IP to IP address (alias for resolve_hostname) | |
| std::vector< std::string > | resolve_all_addresses (const std::string &hostname) |
| Get all IP addresses for a hostname. | |
| std::vector< std::string > | resolve_all_addresses_v6 (const std::string &hostname) |
| Get all IPv6 addresses for a hostname. | |
| std::vector< std::string > | resolve_all_addresses_dual (const std::string &hostname) |
| Get all IP addresses (both IPv4 and IPv6) for a hostname. | |
| std::vector< std::string > | get_local_interface_addresses () |
| Get all local network interface addresses (IPv4 and IPv6) | |
| std::vector< std::string > | get_local_interface_addresses_v4 () |
| Get all local IPv4 network interface addresses. | |
| std::vector< std::string > | get_local_interface_addresses_v6 () |
| Get all local IPv6 network interface addresses. | |
| bool | is_local_interface_address (const std::string &ip_address) |
| Check if an IP address is a local interface address. | |
| std::vector< std::string > librats::network_utils::get_local_interface_addresses | ( | ) |
Get all local network interface addresses (IPv4 and IPv6)
Example usage: auto local_ips = network_utils::get_local_interface_addresses(); for (const auto& ip : local_ips) { std::cout << "Local IP: " << ip << std::endl; }
| std::vector< std::string > librats::network_utils::get_local_interface_addresses_v4 | ( | ) |
Get all local IPv4 network interface addresses.
Example usage: auto local_ipv4s = network_utils::get_local_interface_addresses_v4(); for (const auto& ip : local_ipv4s) { std::cout << "Local IPv4: " << ip << std::endl; }
| std::vector< std::string > librats::network_utils::get_local_interface_addresses_v6 | ( | ) |
Get all local IPv6 network interface addresses.
Example usage: auto local_ipv6s = network_utils::get_local_interface_addresses_v6(); for (const auto& ip : local_ipv6s) { std::cout << "Local IPv6: " << ip << std::endl; }
| bool librats::network_utils::is_hostname | ( | const std::string & | str | ) |
Check if a string is a hostname (not an IP address)
| str | The string to check |
Example usage: bool is_host = network_utils::is_hostname("google.com"); // true bool is_ip = network_utils::is_hostname("192.168.1.1"); // false bool is_ipv6 = network_utils::is_hostname("::1"); // false
| bool librats::network_utils::is_local_interface_address | ( | const std::string & | ip_address | ) |
Check if an IP address is a local interface address.
| ip_address | The IP address to check |
Example usage: bool is_local = network_utils::is_local_interface_address("192.168.1.100");
| bool librats::network_utils::is_valid_ipv4 | ( | const std::string & | ip_str | ) |
Check if a string is a valid IPv4 address.
| ip_str | The string to validate |
Example usage: bool valid = network_utils::is_valid_ipv4("192.168.1.1"); // true bool invalid = network_utils::is_valid_ipv4("invalid.ip"); // false
| bool librats::network_utils::is_valid_ipv6 | ( | const std::string & | ip_str | ) |
Check if a string is a valid IPv6 address.
| ip_str | The string to validate |
Example usage: bool valid = network_utils::is_valid_ipv6("::1"); // true bool valid2 = network_utils::is_valid_ipv6("2001:db8::1"); // true bool invalid = network_utils::is_valid_ipv6("invalid.ip"); // false
| std::vector< std::string > librats::network_utils::resolve_all_addresses | ( | const std::string & | hostname | ) |
Get all IP addresses for a hostname.
| hostname | The hostname to resolve |
Example usage: auto ips = network_utils::resolve_all_addresses("google.com"); for (const auto& ip : ips) { std::cout << "IP: " << ip << std::endl; }
| std::vector< std::string > librats::network_utils::resolve_all_addresses_dual | ( | const std::string & | hostname | ) |
Get all IP addresses (both IPv4 and IPv6) for a hostname.
| hostname | The hostname to resolve |
Example usage: auto ips = network_utils::resolve_all_addresses_dual("google.com"); for (const auto& ip : ips) { std::cout << "IP: " << ip << std::endl; }
| std::vector< std::string > librats::network_utils::resolve_all_addresses_v6 | ( | const std::string & | hostname | ) |
Get all IPv6 addresses for a hostname.
| hostname | The hostname to resolve |
Example usage: auto ipv6s = network_utils::resolve_all_addresses_v6("google.com"); for (const auto& ipv6 : ipv6s) { std::cout << "IPv6: " << ipv6 << std::endl; }
| std::string librats::network_utils::resolve_hostname | ( | const std::string & | hostname | ) |
Resolve hostname to IP address.
| hostname | The hostname to resolve (can be hostname or IP address) |
Example usage: std::string ip = network_utils::resolve_hostname("google.com"); std::string ip2 = network_utils::resolve_hostname("192.168.1.1"); // returns same IP
| std::string librats::network_utils::resolve_hostname_v6 | ( | const std::string & | hostname | ) |
Resolve hostname to IPv6 address.
| hostname | The hostname to resolve (can be hostname or IPv6 address) |
Example usage: std::string ipv6 = network_utils::resolve_hostname_v6("google.com"); std::string ipv6_2 = network_utils::resolve_hostname_v6("::1"); // returns same IPv6
| std::string librats::network_utils::to_ip_address | ( | const std::string & | host | ) |
Convert hostname or IP to IP address (alias for resolve_hostname)
| host | The hostname or IP address to convert |
Example usage: std::string ip = network_utils::to_ip_address("example.com");