rte_uuid.h(3)

🌸 rte_uuid.h(3) β€” Library Functions Manual 🌸

okay bestie, sit down, hydrate, and let me tell you about UUIDs πŸ’– this is rte_uuid.h, a DPDK header, and it's literally just UUID stuff. no drama, no cap.


✨ NAME ✨

rte_uuid.h β€” the header that gives you UUID related functions πŸ’… that's it, that's the whole name, she's lowkey mysterious


πŸ¦‹ SYNOPSIS πŸ¦‹

first things first, you gotta pull in the friends:

#include <stdbool.h>
#include <stddef.h>
#include <string.h>

πŸŽ€ Macros

#define RTE_UUID_INIT(a,  b,  c,  d,  e)
#define RTE_UUID_STRLEN   (36 + 1)

πŸŽ€ Typedefs

typedef unsigned char rte_uuid_t[16]

πŸŽ€ Functions

bool rte_uuid_is_null (const rte_uuid_t uu)
static void rte_uuid_copy (rte_uuid_t dst, const rte_uuid_t src)
int rte_uuid_compare (const rte_uuid_t a, const rte_uuid_t b)
int rte_uuid_parse (const char *in, rte_uuid_t uu)
void rte_uuid_unparse (const rte_uuid_t uu, char *out, size_t len)

πŸ’œ Detailed Description πŸ’œ

UUID related functions originally from libuuid ✨ (yes she has lore, she came from somewhere else, main character origin story fr fr)

Definition in file rte_uuid.h.


🌈 Macro Definition Documentation 🌈

#define RTE_UUID_INIT( a, b, c, d, e)

Value:

{       \
    ((a) >> 24) & 0xff, ((a) >> 16) & 0xff, \
    ((a) >> 8) & 0xff, (a) & 0xff,      \
    ((b) >> 8) & 0xff, (b) & 0xff,      \
    ((c) >> 8) & 0xff, (c) & 0xff,      \
    ((d) >> 8) & 0xff, (d) & 0xff,      \
    ((e) >> 40) & 0xff, ((e) >> 32) & 0xff, \
    ((e) >> 24) & 0xff, ((e) >> 16) & 0xff, \
    ((e) >> 8) & 0xff, (e) & 0xff       \
}

Helper for defining UUID values for id tables 🫢 (it's giving "I precompute your bytes so you don't have to")

Definition at line 29 of file rte_uuid.h.

#define RTE_UUID_STRLEN (36 + 1)

UUID string length πŸ“ (36 chars for the uuid, +1 for the null terminator, she's thorough)

Definition at line 41 of file rte_uuid.h.


🧚 Typedef Documentation 🧚

typedef unsigned char rte_uuid_t[16]

Struct describing a Universal Unique Identifier πŸ‘‘

Definition at line 24 of file rte_uuid.h.


πŸ‘‘ Function Documentation πŸ‘‘

bool rte_uuid_is_null (const rte_uuid_t uu)

Test if UUID is all zeros πŸ•³οΈ vibe check: is it empty in here?

Parameters

  • uu β€” The uuid to check.

Returns

true if uuid is NULL value, false otherwise ✨


void rte_uuid_copy (rte_uuid_t dst, const rte_uuid_t src) [inline], [static]

Copy uuid πŸ“‹ (she's literally just a little copy-paste, but make it bytes)

Parameters

  • dst β€” Destination uuid
  • src β€” Source uuid

Definition at line 61 of file rte_uuid.h.


int rte_uuid_compare (const rte_uuid_t a, const rte_uuid_t b)

Compare two UUID's βš–οΈ (who's bigger, bestie, let's find out)

Parameters

  • a β€” A UUID to compare
  • b β€” A UUID to compare

Returns

returns an integer less than, equal to, or greater than zero if UUID a is is less than, equal, or greater than UUID b.

not me pointing out that "is is" twice in the original β€” that typo is staying, I don't make the rules, I just keep every detail πŸ’€

int rte_uuid_parse (const char * in, rte_uuid_t uu)

Extract UUID from string πŸ” (turning your cute little text into cold hard bytes)

Parameters

  • in β€” Pointer to string of characters to convert
  • uu β€” Destination UUID

Returns

Returns 0 on success, and -1 if string is not a valid UUID. 😭 (no in-between, it's a yes or a no, periodt)


void rte_uuid_unparse (const rte_uuid_t uu, char * out, size_t len)

Convert UUID to string ✍️ (the glow-up from bytes back to text)

Parameters

  • uu β€” UUID to format
  • out β€” Resulting string buffer
  • len β€” Sizeof the available string buffer
heads up bestie: len is how much room your out buffer actually has β€” she's not gonna magically grow it for you, so size it right 🌸

πŸ“ Author πŸ“

Generated automatically by Doxygen for DPDK from the source code. πŸ€– (not a human, just a very diligent little robot, we stan her)


and that's the whole page, bestie!! no more sections, we ate and left no crumbs πŸ’…

this gorgeous thing is brought to you by the DPDK girlies, Version 25.11.3, and it's filed under rte_uuid.h(3) πŸŽ€ catch you in the next manpage, muah πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from