9 auto is_private(std::string_view addr
) -> bool;
10 auto is_address(std::string_view addr
) -> bool;
11 auto is_address_literal(std::string_view addr
) -> bool;
12 auto to_address_literal(std::string_view addr
) -> std::string
;
13 auto reverse(std::string_view addr
) -> std::string
;
14 auto fcrdns(std::string_view addr
) -> std::vector
<std::string
>;
16 constexpr char lit_pfx
[] = "[";
17 constexpr auto lit_pfx_sz
{sizeof(lit_pfx
) - 1};
19 constexpr char lit_sfx
[] = "]";
20 constexpr auto lit_sfx_sz
{sizeof(lit_sfx
) - 1};
22 constexpr auto lit_extra_sz
{lit_pfx_sz
+ lit_sfx_sz
};
24 constexpr auto loopback_literal
{"[127.0.0.1]"};
26 constexpr auto as_address(std::string_view address_literal
) -> std::string_view
28 // CHECK(is_address_literal(address_literal));
29 return std::string_view(begin(address_literal
) + lit_pfx_sz
,
30 size(address_literal
) - lit_extra_sz
);