#include <ip.hpp>
Definition at line 11 of file ip.hpp.
◆ address() [1/2]
fc::ip::address::address |
( |
uint32_t | _ip = 0 | ) |
|
◆ address() [2/2]
Definition at line 13 of file ip.cpp.
14 {
15 try
16 {
17 _ip = boost::asio::ip::address_v4::from_string(
s.c_str()).to_ulong();
18 }
20 }
#define FC_RETHROW_EXCEPTIONS(LOG_LEVEL, FORMAT,...)
Catchs all exception's, std::exceptions, and ... and rethrows them after appending the provided log m...
◆ is_multicast_address()
bool fc::ip::address::is_multicast_address |
( |
| ) |
const |
224.0.0.0 to 239.255.255.255
Definition at line 125 of file ip.cpp.
126 {
127 static address min_ip(
"224.0.0.0");
128 static address max_ip(
"239.255.255.255");
129 return _ip >= min_ip._ip && _ip <= max_ip._ip;
130 }
◆ is_private_address()
bool fc::ip::address::is_private_address |
( |
| ) |
const |
- Returns
- true if the ip is in the following ranges:
10.0.0.0 to 10.255.255.255 172.16.0.0 to 172.31.255.255 192.168.0.0 to 192.168.255.255 169.254.0.0 to 169.254.255.255
Definition at line 105 of file ip.cpp.
106 {
107 static address min10_ip(
"10.0.0.0");
108 static address max10_ip(
"10.255.255.255");
109 static address min172_ip(
"172.16.0.0");
110 static address max172_ip(
"172.31.255.255");
111 static address min192_ip(
"192.168.0.0");
112 static address max192_ip(
"192.168.255.255");
113 static address min169_ip(
"169.254.0.0");
114 static address max169_ip(
"169.254.255.255");
115 if( _ip >= min10_ip._ip && _ip <= max10_ip._ip ) return true;
116 if( _ip >= min172_ip._ip && _ip <= max172_ip._ip ) return true;
117 if( _ip >= min192_ip._ip && _ip <= max192_ip._ip ) return true;
118 if( _ip >= min169_ip._ip && _ip <= max169_ip._ip ) return true;
119 return false;
120 }
◆ is_public_address()
bool fc::ip::address::is_public_address |
( |
| ) |
const |
!private & !multicast
Definition at line 133 of file ip.cpp.
134 {
136 }
bool is_private_address() const
bool is_multicast_address() const
◆ operator fc::string()
Definition at line 39 of file ip.cpp.
40 {
41 try
42 {
43 return boost::asio::ip::address_v4(_ip).to_string().c_str();
44 }
46 }
◆ operator uint32_t()
fc::ip::address::operator uint32_t |
( |
| ) |
const |
◆ operator=()
Definition at line 29 of file ip.cpp.
30 {
31 try
32 {
33 _ip = boost::asio::ip::address_v4::from_string(
s.c_str()).to_ulong();
34 }
36 return *this;
37 }
◆ operator!=
Definition at line 25 of file ip.cpp.
25 {
27 }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
◆ operator==
The documentation for this class was generated from the following files:
- libraries/fc/include/fc/network/ip.hpp
- libraries/fc/src/network/ip.cpp