NG_DEFLATE(4)
π ng_deflate β the Deflate PPP compression netgraph node type, bestie π
okay so like. welcome to the ng_deflate(4) manual page, part of the Kernel Interfaces Manual (that's the 4 section, iykyk). it's giving very "networking girlie who reads RFCs for fun" energy and honestly? we love that for us. π¦
β¨ SYNOPSIS β¨
#include <sys/types.h>
#include <netgraph/ng_deflate.h>
no cap, that's the whole vibe. two includes and you're in. π
πΈ DESCRIPTION πΈ
so the deflate node type implements the Deflate sub-protocols of the Compression Control Protocol (CCP). that's the compression girl. she compresses. periodt. π₯
the node has exactly two hooks: comp for compression and decomp for decompression. and the way that only one of them can be connected at the same time, because whichever one you plug in is literally specifying the node's operation mode? iconic behavior honestly. π«Ά
typically those hooks get connected to the ng_ppp(4) node type hook of the same name β so comp goes to comp, decomp goes to decomp, matching outfits, bestie coordination. π
β οΈ okay important: the correspondingng_ppp(4)node hook must be switched toNG_PPP_DECOMPRESS_FULLmode to permit sending uncompressed frames. don't skip that step, it's not optional, no cap.
π HOOKS π
this node type supports the following hooks, and there are literally two, so no excuses:
compβ connection tong_ppp(4)comphook. incoming frames are compressed (if possible) and sent back out the same hook. like a lil glow-up pipeline. β¨decompβ connection tong_ppp(4)decomphook. incoming frames are decompressed (if they are compressed), and sent back out the same hook. reverse glow-up. π
only one hook can be connected at the same time, and that's what specifies the node's operation mode. one at a time, bestie, she's monogamous. π
π CONTROL MESSAGES π
this node type supports the generic control messages, plus the following, and ngl this is the main character section:
NGM_DEFLATE_CONFIG(config) β this command resets and configures the node for a session (i.e., for compression or decompression). it takes astruct ng_deflate_configas an argument:
struct ng_deflate_config {
u_char enable; /* node enabled */
u_char windowBits; /* log2(Window size) */
};
the enabled field enables traffic flow through the node. the windowBits specify compression windows size as negotiated by the Compression Control Protocol (CCP) in PPP. yes, it's log2 of the window size, do not come for me. π
NGM_DEFLATE_RESETREQ(resetreq) β this message contains no arguments, and is bi-directional. so if an error is detected during decompression, this message is sent by the node to the originator of theNGM_DEFLATE_CONFIGmessage that initiated the session. the receiver should respond by sending a PPP CCP Reset-Request to the peer. π¨
this message may also be received by this node type when a CCP Reset-Request or Reset-Ack is received by the local PPP entity. the node will respond by flushing its compression state so the sides can resynchronize. a whole relationship-repair arc, honestly. π«Ά
NGM_DEFLATE_GET_STATS(getstats) β this control message obtains statistics for a given hook. the statistics are returned instruct ng_deflate_stats:
struct ng_deflate_stats {
uint64_t FramesPlain;
uint64_t FramesComp;
uint64_t FramesUncomp;
uint64_t InOctets;
uint64_t OutOctets;
uint64_t Errors;
};
NGM_DEFLATE_CLR_STATS(clrstats) β this control message clears statistics for a given hook. bye bye numbers. π§ΉNGM_DEFLATE_GETCLR_STATS(getclrstats) β this control message obtains and clears statistics for a given hook. read it and yeet it. the multitasking queen. π
π SHUTDOWN π
this node shuts down upon receipt of a NGM_SHUTDOWN control message, or when hook have been disconnected. (yes, that's the original wording, we're keeping it fr fr β the hook gets disconnected and the node simply β¨ departs β¨.) π¦
π SEE ALSO π
netgraph(4),ng_ppp(4),ngctl(8)- J. Woods, PPP Deflate Protocol, RFC 1979.
- W. Simpson, The Point-to-Point Protocol (PPP), RFC 1661.
π AUTHORS π
Alexander Motin <mav@alkar.net> β legend behavior, we stan. π
π BUGS π
due to nature of netgraph PPP implementation there are possible race conditions between data packet and ResetAck CCP packet in case of packet loss. as result, packet loss can produce bigger performance degradation than supposed by protocol. π
β οΈ not me telling you this is a real documented caveat and not a vibe: packet loss here can hurt more than the protocol says it should. dramatic but true.
and that's the page, bestie!! π«Ά this was ng_deflate(4) from the Debian crew, dated December 23, 2006 β yeah, she's an elder icon and she still eats. π
β¨ π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2006, Alexander Motin <mav@alkar.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms