23static inline void ipv4(
Buffer &buf,
const std::uint32_t addr)
27 Decimal::write(buf, addr & 0xff);
29 Decimal::write(buf, (addr >> 8) & 0xff);
31 Decimal::write(buf, (addr >> 16) & 0xff);
33 Decimal::write(buf, addr >> 24);
41 const std::uint16_t *a =
static_cast<const std::uint16_t *
>(addr);
44 size_t zero_start = 0;
45 size_t zero_extent = 0;
49 for (
size_t i = 0; i < 8; ++i)
55 const size_t extent = i - start;
56 if (extent > zero_extent)
77 const size_t extent = 8 - start;
78 if (extent > zero_extent)
89 if (zero_extent == 5 && a[5] == 0xffff)
92 ipv4(buf, *
reinterpret_cast<const std::uint32_t *
>(a + 6));
98 ipv4(buf, *
reinterpret_cast<const std::uint32_t *
>(a + 6));
112 State state = INITIAL;
113 for (
size_t i = 0; i < 8; ++i)
115 const std::uint16_t hextet = ntohs(a[i]);
116 if (i == zero_start && zero_extent >= 2)
void push_back(const T &value)
Append a T object to the end of the array, resizing the array if necessary.
void buf_append_string(Buffer &buf, const std::string &str)