Skip to content

File SolidSyslogUdpPayload.h

FileList > Core > Interface > SolidSyslogUdpPayload.h

Go to the source code of this file

UDP payload sizing helpers: the usable payload for a given MTU and the UTF-8-safe trim used to fit a message into a datagram without splitting a codepoint.

  • #include "ExternC.h"
  • #include <stdbool.h>
  • #include <stddef.h>
  • #include <stdint.h>

Public Types

Type Name
enum @5
Largest UDP payload guaranteed to fit an unfragmented IPv6 datagram: IPv6 minimum MTU 1280 − 40-byte IPv6 header − 8-byte UDP header (RFC 8200 §5).

Public Functions

Type Name
size_t SolidSyslogUdpPayload_FromMtu (size_t mtu, bool isIpv6)
Usable UDP payload for an mtu , subtracting the IP header (40 for IPv6, 20 for IPv4) and the 8-byte UDP header.
size_t SolidSyslogUdpPayload_TrimToCodepointBoundary (const uint8_t * buffer, size_t length)

Public Types Documentation

enum @5

Largest UDP payload guaranteed to fit an unfragmented IPv6 datagram: IPv6 minimum MTU 1280 − 40-byte IPv6 header − 8-byte UDP header (RFC 8200 §5).

enum @5 {
    SOLIDSYSLOG_UDP_IPV6_SAFE_PAYLOAD = 1232
};

Used as the last-resort MaxPayload when the OS cannot report a path MTU.


Public Functions Documentation

function SolidSyslogUdpPayload_FromMtu

Usable UDP payload for an mtu , subtracting the IP header (40 for IPv6, 20 for IPv4) and the 8-byte UDP header.

size_t SolidSyslogUdpPayload_FromMtu (
    size_t mtu,
    bool isIpv6
) 


function SolidSyslogUdpPayload_TrimToCodepointBoundary

size_t SolidSyslogUdpPayload_TrimToCodepointBoundary (
    const uint8_t * buffer,
    size_t length
) 


The documentation for this class was generated from the following file Core/Interface/SolidSyslogUdpPayload.h