VIPA 0.1.0
Header-only C++23 SIMD-assisted IPv4/IPv6 text parser.
Loading...
Searching...
No Matches
llmx::vipa::detail Namespace Reference

Classes

struct  IPv4Scan
 Character-position masks collected while scanning IPv4 text. More...
struct  IPv6Scan
 Character-position masks collected while scanning IPv6 text. More...

Functions

constexpr bool is_hex_digit (char c) noexcept
 Return true when c is an ASCII hexadecimal digit.
constexpr auto hex_value (char c) noexcept -> uint8_t
 Convert an ASCII hexadecimal digit to its numeric value.
auto scan_ipv4_scalar (std::string_view text, IPv4Scan &scan) noexcept -> bool
 Scan IPv4 text for dot positions with portable scalar code.
auto scan_ipv4 (std::string_view text, IPv4Scan &scan) noexcept -> bool
 Scan IPv4 text with the best enabled implementation.
auto parse_ipv4_from_scan (std::string_view text, IPv4Scan scan) noexcept -> std::optional< IPv4Address >
 Parse IPv4 bytes after dot positions have been collected.
constexpr auto low_mask64 (std::size_t len) noexcept -> uint64_t
 Return a low-bit mask with len bits set.
constexpr auto low_mask32 (std::size_t len) noexcept -> uint32_t
 Return a 32-bit low-bit mask with len bits set.
constexpr auto range_mask64 (std::size_t begin, std::size_t end) noexcept -> uint64_t
 Return a mask covering [begin, end) bit positions.
auto scan_ipv6_scalar (std::string_view text, IPv6Scan &scan) noexcept -> bool
 Scan IPv6 text with portable scalar character classification.
auto scan_ipv6 (std::string_view text, IPv6Scan &scan) noexcept -> bool
 Scan IPv6 text with the best enabled implementation.
bool parse_ipv6_piece (std::string_view piece, uint16_t &value) noexcept
 Parse one 1-4 digit IPv6 hexadecimal group.
auto find_next_colon (IPv6Scan scan, std::size_t begin, std::size_t end) noexcept -> std::size_t
 Find the next colon bit in [begin, end).
auto append_ipv4_tail (std::array< uint16_t, 8 > &groups, uint8_t &count, std::string_view tail) noexcept -> bool
 Append an embedded IPv4 tail as two IPv6 16-bit groups.
auto parse_ipv6_side (std::string_view text, std::size_t begin, std::size_t end, IPv6Scan scan, std::array< uint16_t, 8 > &groups, uint8_t &count) noexcept -> bool
 Parse one side of an IPv6 address around optional :: compression.

Function Documentation

◆ append_ipv4_tail()

auto llmx::vipa::detail::append_ipv4_tail ( std::array< uint16_t, 8 > & groups,
uint8_t & count,
std::string_view tail ) -> bool
inlinenoexcept

Append an embedded IPv4 tail as two IPv6 16-bit groups.

◆ find_next_colon()

auto llmx::vipa::detail::find_next_colon ( IPv6Scan scan,
std::size_t begin,
std::size_t end ) -> std::size_t
inlinenoexcept

Find the next colon bit in [begin, end).

◆ hex_value()

auto llmx::vipa::detail::hex_value ( char c) -> uint8_t
constexprnoexcept

Convert an ASCII hexadecimal digit to its numeric value.

◆ is_hex_digit()

bool llmx::vipa::detail::is_hex_digit ( char c)
constexprnoexcept

Return true when c is an ASCII hexadecimal digit.

◆ low_mask32()

auto llmx::vipa::detail::low_mask32 ( std::size_t len) -> uint32_t
inlineconstexprnoexcept

Return a 32-bit low-bit mask with len bits set.

◆ low_mask64()

auto llmx::vipa::detail::low_mask64 ( std::size_t len) -> uint64_t
inlineconstexprnoexcept

Return a low-bit mask with len bits set.

◆ parse_ipv4_from_scan()

auto llmx::vipa::detail::parse_ipv4_from_scan ( std::string_view text,
IPv4Scan scan ) -> std::optional< IPv4Address >
inlinenoexcept

Parse IPv4 bytes after dot positions have been collected.

Rejects empty octets, octets longer than three digits, leading-zero octets, non-digit characters, and values above 255.

◆ parse_ipv6_piece()

bool llmx::vipa::detail::parse_ipv6_piece ( std::string_view piece,
uint16_t & value )
inlinenoexcept

Parse one 1-4 digit IPv6 hexadecimal group.

◆ parse_ipv6_side()

auto llmx::vipa::detail::parse_ipv6_side ( std::string_view text,
std::size_t begin,
std::size_t end,
IPv6Scan scan,
std::array< uint16_t, 8 > & groups,
uint8_t & count ) -> bool
inlinenoexcept

Parse one side of an IPv6 address around optional :: compression.

The side may end with an IPv4 dotted-decimal tail, which occupies two IPv6 groups.

◆ range_mask64()

auto llmx::vipa::detail::range_mask64 ( std::size_t begin,
std::size_t end ) -> uint64_t
inlineconstexprnoexcept

Return a mask covering [begin, end) bit positions.

◆ scan_ipv4()

auto llmx::vipa::detail::scan_ipv4 ( std::string_view text,
IPv4Scan & scan ) -> bool
inlinenoexcept

Scan IPv4 text with the best enabled implementation.

◆ scan_ipv4_scalar()

auto llmx::vipa::detail::scan_ipv4_scalar ( std::string_view text,
IPv4Scan & scan ) -> bool
inlinenoexcept

Scan IPv4 text for dot positions with portable scalar code.

◆ scan_ipv6()

auto llmx::vipa::detail::scan_ipv6 ( std::string_view text,
IPv6Scan & scan ) -> bool
inlinenoexcept

Scan IPv6 text with the best enabled implementation.

◆ scan_ipv6_scalar()

auto llmx::vipa::detail::scan_ipv6_scalar ( std::string_view text,
IPv6Scan & scan ) -> bool
inlinenoexcept

Scan IPv6 text with portable scalar character classification.