rte_cksum.h(3)
π rte_cksum.h β a library functions manual, but make it cute π
okay bestie, so this is rte_cksum.h, a header from DPDK, and it's genuinely iconic β it's your protocol-independent checksum toolkit. no cap. if you've ever needed to compute a checksum and didn't wanna care what protocol you're in, this is the girl. π
β¨ NAME β¨
rte_cksum.h β that's it, that's the name. short, slay, to the point. π
πΈ SYNOPSIS πΈ
first, the vibe check β you gotta bring in the headers:
#include <stdint.h>
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_mbuf.h>
π¦ Functions
here are the two functions, both static and both inline, so they're living their best little life in your compilation unit:
static uint16_t rte_raw_cksum (const void *buf, size_t len)
static int rte_raw_cksum_mbuf (const struct rte_mbuf *m, uint32_t off,
uint32_t len, uint16_t *cksum)
π Detailed Description π
Protocol independent checksum utilities.
like. it does not care what protocol you're in. it just sums. obsessed. π
Definition in file rte_cksum.h.
π Function Documentation π
β uint16_t rte_raw_cksum (const void * buf, size_t len) [inline], [static]
it does the thing: process the non-complemented checksum of a buffer. note the non-complemented part, bestie β it hands you the raw sum, not the one's-complement flip. you gotta do that yourself if that's your goal. π
Parameters
bufβ Pointer to the buffer.lenβ Length of the buffer.
Returns
- The non-complemented checksum.
Definition at line 94 of file rte_cksum.h.
π int rte_raw_cksum_mbuf (const struct rte_mbuf * m, uint32_t off, uint32_t len, uint16_t * cksum) [inline], [static]
now this one is the mbuf girlie β it'll compute the raw (non complemented) checksum of a packet. again: raw, non-complemented, no extra seasoning. π₯
Parameters
mβ The pointer to the mbuf.offβ The offset in bytes to start the checksum.lenβ The length in bytes of the data to checksum.cksumβ A pointer to the checksum, filled on success.
Returns
0on success,-1on error (bad length or offset).
β οΈ heads up bestie: bad length or bad offset and she will NOT hesitate β that's a -1, fr fr. check your inputs before you send it. π
Definition at line 117 of file rte_cksum.h.
π«Ά Author π«Ά
Generated automatically by Doxygen for DPDK from the source code.
like, no human wrote this, a robot did, and honestly? it ate. β¨
and that's the whole page, bestie!! this was DPDK, Version 25.11.3, for rte_cksum.h(3) β go forth and checksum responsibly, you got this πππ¦β
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms