DPDK 25.03.0-rc0
Macros | Typedefs | Functions
rte_uuid.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <string.h>

Go to the source code of this file.

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

Definition in file rte_uuid.h.

Macro Definition Documentation

◆ RTE_UUID_INIT

#define RTE_UUID_INIT (   a,
  b,
  c,
  d,
 
)
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.

Definition at line 29 of file rte_uuid.h.

◆ RTE_UUID_STRLEN

#define RTE_UUID_STRLEN   (36 + 1)

UUID string length

Definition at line 41 of file rte_uuid.h.

Typedef Documentation

◆ rte_uuid_t

typedef unsigned char rte_uuid_t[16]

Struct describing a Universal Unique Identifier

Definition at line 24 of file rte_uuid.h.

Function Documentation

◆ rte_uuid_is_null()

bool rte_uuid_is_null ( const rte_uuid_t  uu)

Test if UUID is all zeros.

Parameters
uuThe uuid to check.
Returns
true if uuid is NULL value, false otherwise

◆ rte_uuid_copy()

static void rte_uuid_copy ( rte_uuid_t  dst,
const rte_uuid_t  src 
)
inlinestatic

Copy uuid.

Parameters
dstDestination uuid
srcSource uuid

Definition at line 61 of file rte_uuid.h.

◆ rte_uuid_compare()

int rte_uuid_compare ( const rte_uuid_t  a,
const rte_uuid_t  b 
)

Compare two UUID's

Parameters
aA UUID to compare
bA 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.

◆ rte_uuid_parse()

int rte_uuid_parse ( const char *  in,
rte_uuid_t  uu 
)

Extract UUID from string

Parameters
inPointer to string of characters to convert
uuDestination UUID
Returns
Returns 0 on success, and -1 if string is not a valid UUID.

◆ rte_uuid_unparse()

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

Convert UUID to string

Parameters
uuUUID to format
outResulting string buffer
lenSizeof the available string buffer