FreeBSD kernel kern code
kern_uuid.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/endian.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/sbuf.h>
#include <sys/socket.h>
#include <sys/sysproto.h>
#include <sys/systm.h>
#include <sys/jail.h>
#include <sys/uuid.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/vnet.h>
Include dependency graph for kern_uuid.c:

Go to the source code of this file.

Data Structures

struct  uuid_private
 
struct  uuidgen_args
 

Functions

 __FBSDID ("$BSDSUniX$")
 
 CTASSERT (sizeof(struct uuid)==16)
 
 CTASSERT (sizeof(struct uuid_private)==16)
 
 MTX_SYSINIT (uuid_lock,&uuid_mutex,"UUID generator mutex lock", MTX_DEF)
 
static void uuid_node (uint16_t *node)
 
static uint64_t uuid_time (void)
 
struct uuid * kern_uuidgen (struct uuid *store, size_t count)
 
int sys_uuidgen (struct thread *td, struct uuidgen_args *uap)
 
int snprintf_uuid (char *buf, size_t sz, struct uuid *uuid)
 
int printf_uuid (struct uuid *uuid)
 
int sbuf_printf_uuid (struct sbuf *sb, struct uuid *uuid)
 
void le_uuid_enc (void *buf, struct uuid const *uuid)
 
void le_uuid_dec (void const *buf, struct uuid *uuid)
 
void be_uuid_enc (void *buf, struct uuid const *uuid)
 
void be_uuid_dec (void const *buf, struct uuid *uuid)
 
int parse_uuid (const char *str, struct uuid *uuid)
 

Variables

static struct uuid_private uuid_last
 
static struct mtx uuid_mutex
 

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
void be_uuid_dec ( void const *  buf,
struct uuid *  uuid 
)

Definition at line 310 of file kern_uuid.c.

References buf.

void be_uuid_enc ( void *  buf,
struct uuid const *  uuid 
)

Definition at line 294 of file kern_uuid.c.

References buf.

CTASSERT ( sizeof(struct uuid)  = =16)
CTASSERT ( sizeof(struct uuid_private = =16)
struct uuid* kern_uuidgen ( struct uuid *  store,
size_t  count 
)

Definition at line 143 of file kern_uuid.c.

References count, uuid_private::ll, uuid_private::node, uuid_private::seq, uuid_private::time, uuid_last, uuid_mutex, uuid_node(), uuid_time(), and uuid_private::x.

Referenced by sys_uuidgen().

Here is the call graph for this function:

Here is the caller graph for this function:

void le_uuid_dec ( void const *  buf,
struct uuid *  uuid 
)

Definition at line 278 of file kern_uuid.c.

References buf.

void le_uuid_enc ( void *  buf,
struct uuid const *  uuid 
)

Definition at line 262 of file kern_uuid.c.

References buf.

MTX_SYSINIT ( uuid_lock  ,
uuid_mutex,
"UUID generator mutex lock"  ,
MTX_DEF   
)
int parse_uuid ( const char *  str,
struct uuid *  uuid 
)

Definition at line 326 of file kern_uuid.c.

References sscanf().

Here is the call graph for this function:

int printf_uuid ( struct uuid *  uuid)

Definition at line 227 of file kern_uuid.c.

References buf, printf(), and snprintf_uuid().

Here is the call graph for this function:

int sbuf_printf_uuid ( struct sbuf *  sb,
struct uuid *  uuid 
)

Definition at line 236 of file kern_uuid.c.

References buf, sbuf_printf(), and snprintf_uuid().

Here is the call graph for this function:

int snprintf_uuid ( char *  buf,
size_t  sz,
struct uuid *  uuid 
)

Definition at line 214 of file kern_uuid.c.

References uuid_private::node, uuid_private::seq, snprintf(), uuid_private::time, and uuid_private::x.

Referenced by printf_uuid(), and sbuf_printf_uuid().

Here is the call graph for this function:

Here is the caller graph for this function:

int sys_uuidgen ( struct thread *  td,
struct uuidgen_args uap 
)

Definition at line 190 of file kern_uuid.c.

References count, uuidgen_args::count, free(), kern_uuidgen(), malloc(), and uuidgen_args::store.

Here is the call graph for this function:

static void uuid_node ( uint16_t *  node)
static

Definition at line 90 of file kern_uuid.c.

Referenced by kern_uuidgen().

Here is the caller graph for this function:

static uint64_t uuid_time ( void  )
static

Definition at line 131 of file kern_uuid.c.

References bintime().

Referenced by kern_uuidgen().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

struct uuid_private uuid_last
static

Definition at line 74 of file kern_uuid.c.

Referenced by kern_uuidgen().

struct mtx uuid_mutex
static

Definition at line 76 of file kern_uuid.c.

Referenced by kern_uuidgen().