Base RDAP query class. More...
#include <DwmRDAPQuery.hh>

Public Member Functions | |
| Query () | |
| Constructor. | |
| const std::string & | Uri () const |
| Response | Execute () const |
| Executes the query and returns the response. | |
Static Public Member Functions | |
| static void | FixIpv4Stupidity (Json::Value &jv) |
| <rant> Some of the registries (ARIN, for example) return IPv4 addresses with leading zeros in each octet in their RDAP responses. More... | |
Protected Attributes | |
| std::string | _uristr |
Base RDAP query class.
Not used directly; use one of the classes that inherits from this class.
|
static |
<rant> Some of the registries (ARIN, for example) return IPv4 addresses with leading zeros in each octet in their RDAP responses.
This is an incredibly stupid thing to do since it causes address conversion routines like inet_addr(), inet_aton(), et. al. to interpret these octets as octal (as they should!) and hence yield incorrect results. inet_pton() will fail to parse addresses in this format. So basically, the addresses returned by some of the registry RDAP servers are completely unusable by machines without massaging the addresses. So much for RDAP being machine-friendly. </rant> This function is used to fix the 'startAddress' and 'endAddress' fields in an RDAP JSON response for an ip query. It should likely be used for more fields since I'm sure the stupidity isn't restricted to just these fields.