Skip to content

File SolidSyslogUdpPayload.h

FileList > Core > Interface > SolidSyslogUdpPayload.h

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 "SolidSyslogExternC.h"
  • #include <stdbool.h>
  • #include <stddef.h>
  • #include <stdint.h>

Public Types Documentation

enum @6

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

enum @6 {
    SOLIDSYSLOG_UDP_IPV6_SAFE_PAYLOAD = 1232
};

This is the derived figure for that MTU; what a Datagram answers where no path MTU is available is SolidSyslogUdpPayload_UnknownPath.


Public Functions Documentation

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
) 


SolidSyslogUdpPayload_TrimToCodepointBoundary

size_t SolidSyslogUdpPayload_TrimToCodepointBoundary (
    const uint8_t * buffer,
    size_t length
) 

SolidSyslogUdpPayload_UnknownPath

Largest message to send where the path MTU is not known: the size RFC 5426 section 3.2 calls the safest assumption for the family, 480 octets for IPv4 and 1180 for IPv6.

size_t SolidSyslogUdpPayload_UnknownPath (
    bool isIpv6
) 

A Datagram answers this from MaxPayload where its stack cannot report a path MTU.



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