57 auto data_size = std::min(buf.
length(), std::max(
sizeof(
ICMPv6),
static_cast<size_t>(nexthop_mtu) -
sizeof(
ICMPv6)));
83 icmp->
mtu = htonl(nexthop_mtu);
const T * c_data() const
Returns a const pointer to the start of the buffer.
T * prepend_alloc(const size_t size)
Allocate space for prepending data to the buffer.
size_t length() const
Returns the length of the buffer.
size_t capacity() const
Returns the capacity (raw size) of the allocated buffer in T objects.
bool empty() const
Returns true if the buffer is empty.
size_t offset() const
Returns the current offset (headroom) into the buffer.
void set_size(const size_t size)
After an external method, operating on the array as a mutable unsigned char buffer,...
static void generate_icmp_ptb(BufferAllocated &buf, std::uint16_t nexthop_mtu)
static void generate_icmp4_ptb(BufferAllocated &buf, std::uint16_t nexthop_mtu)
static void generate_icmp6_ptb(BufferAllocated &buf, std::uint16_t nexthop_mtu)
std::uint16_t checksum(const void *data, const size_t size)
unsigned int version(const std::uint8_t version_len_prio)
std::uint16_t csum_icmp(const ICMPv6 *icmp, const size_t len)
std::uint16_t nexthop_mtu