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

  • 0 on success, -1 on 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