Go to the source code of this file.
|
bool | get_local_addresses (Gcs_sock_probe_interface &sock_probe, std::map< std::string, int > &out, bool filter_out_inactive=false) |
| This function gets all network addresses on this host and their subnet masks as a string. More...
|
|
bool | get_local_private_addresses (std::map< std::string, int > &out, bool filter_out_inactive=false) |
| This function gets all private network addresses and their subnet masks as a string. More...
|
|
bool | resolve_all_ip_addr_from_hostname (std::string name, std::vector< std::pair< sa_family_t, std::string > > &ips) |
| This function translates hostnames to all possible IP addresses. More...
|
|
bool | resolve_ip_addr_from_hostname (std::string name, std::vector< std::string > &ip) |
| This function translates hostname to all possible IP addresses. More...
|
|
bool | get_address_for_allowlist (std::string addr, std::string mask, std::pair< std::vector< unsigned char >, std::vector< unsigned char > > &out_pair) |
| Converts an address in string format (X.X.X.X/XX) into network octet format. More...
|
|
◆ get_address_for_allowlist()
bool get_address_for_allowlist |
( |
std::string |
addr, |
|
|
std::string |
mask, |
|
|
std::pair< std::vector< unsigned char >, std::vector< unsigned char > > & |
out_pair |
|
) |
| |
Converts an address in string format (X.X.X.X/XX) into network octet format.
- Parameters
-
[in] | addr | IP address in X.X.X.X format |
[in] | mask | Network mask associated with the address |
[out] | out_pair | IP address and netmask, in binary format (network byte order) |
- Returns
- false on success, true otherwise.
◆ get_local_addresses()
bool get_local_addresses |
( |
Gcs_sock_probe_interface & |
sock_probe, |
|
|
std::map< std::string, int > & |
out, |
|
|
bool |
filter_out_inactive = false |
|
) |
| |
This function gets all network addresses on this host and their subnet masks as a string.
- Parameters
-
[out] | sock_probe | Socket probe interface |
[out] | out | maps IP addresses to subnetmasks |
| filter_out_inactive | If set to true, only active interfaces will be added to out |
- Returns
- false on success, true otherwise.
◆ get_local_private_addresses()
bool get_local_private_addresses |
( |
std::map< std::string, int > & |
out, |
|
|
bool |
filter_out_inactive |
|
) |
| |
This function gets all private network addresses and their subnet masks as a string.
IPv4 only. (SOCK_STREAM only)
- Parameters
-
[out] | out | maps IP addresses to subnetmasks |
| filter_out_inactive | If set to true, only active interfaces will be added to out |
- Returns
- false on success, true otherwise.
In the Internet addressing architecture, a private network is a network that uses private IP address space. Both, the IPv4 and the IPv6 specifications define private addressing ranges. These addresses are commonly used for local area networks (LANs) in residential, office, and enterprise environments. Private IP address spaces were originally defined in an effort to delay IPv4 address exhaustion.
◆ resolve_all_ip_addr_from_hostname()
bool resolve_all_ip_addr_from_hostname |
( |
std::string |
name, |
|
|
std::vector< std::pair< sa_family_t, std::string > > & |
ips |
|
) |
| |
This function translates hostnames to all possible IP addresses.
- Parameters
-
[in] | name | The hostname to translate. |
[out] | ips | The IP addresses after translation. |
- Returns
- false on success, true otherwise.
◆ resolve_ip_addr_from_hostname()
bool resolve_ip_addr_from_hostname |
( |
std::string |
name, |
|
|
std::vector< std::string > & |
ip |
|
) |
| |
This function translates hostname to all possible IP addresses.
- Parameters
-
[in] | name | The hostname to translate. |
[out] | ip | The IP addresses after translation. |
- Returns
- false on success, true otherwise.