FreeBSD kernel kern code
|
#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>
Go to the source code of this file.
Data Structures | |
struct | uuid_private |
struct | uuid_macaddr |
struct | uuidgen_args |
Macros | |
#define | UUID_ETHER_EMPTY 0 |
#define | UUID_ETHER_RANDOM 1 |
#define | UUID_ETHER_UNIQUE 2 |
#define | UUID_NETHER 4 |
#define | VUUIDF_PARSEFLAGS (VUUIDF_EMPTYOK | VUUIDF_CHECKSEMANTICS) |
Functions | |
__FBSDID ("$FreeBSD$") | |
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 | uuid_ether_add (const uint8_t *addr) |
int | uuid_ether_del (const uint8_t *addr) |
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 | validate_uuid (const char *str, size_t size, struct uuid *uuid, int flags) |
int | parse_uuid (const char *str, struct uuid *uuid) |
int | uuidcmp (const struct uuid *uuid1, const struct uuid *uuid2) |
Variables | |
static struct uuid_private | uuid_last |
static struct uuid_macaddr | uuid_ether [UUID_NETHER] |
static struct mtx | uuid_mutex |
#define UUID_ETHER_EMPTY 0 |
Definition at line 78 of file kern_uuid.c.
#define UUID_ETHER_RANDOM 1 |
Definition at line 79 of file kern_uuid.c.
#define UUID_ETHER_UNIQUE 2 |
Definition at line 80 of file kern_uuid.c.
#define UUID_NETHER 4 |
Definition at line 86 of file kern_uuid.c.
#define VUUIDF_PARSEFLAGS (VUUIDF_EMPTYOK | VUUIDF_CHECKSEMANTICS) |
Definition at line 440 of file kern_uuid.c.
__FBSDID | ( | "$FreeBSD$" | ) |
void be_uuid_dec | ( | void const * | buf, |
struct uuid * | uuid | ||
) |
Definition at line 369 of file kern_uuid.c.
References buf.
void be_uuid_enc | ( | void * | buf, |
struct uuid const * | uuid | ||
) |
Definition at line 353 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 132 of file kern_uuid.c.
References count, uuid_private::hi, uuid_private::ll, uuid_private::low, uuid_private::mid, 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().
void le_uuid_dec | ( | void const * | buf, |
struct uuid * | uuid | ||
) |
Definition at line 337 of file kern_uuid.c.
References buf.
void le_uuid_enc | ( | void * | buf, |
struct uuid const * | uuid | ||
) |
Definition at line 321 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 443 of file kern_uuid.c.
References validate_uuid(), and VUUIDF_PARSEFLAGS.
int printf_uuid | ( | struct uuid * | uuid | ) |
Definition at line 286 of file kern_uuid.c.
References buf, printf(), and snprintf_uuid().
int sbuf_printf_uuid | ( | struct sbuf * | sb, |
struct uuid * | uuid | ||
) |
Definition at line 295 of file kern_uuid.c.
References buf, sbuf_cat(), and snprintf_uuid().
int snprintf_uuid | ( | char * | buf, |
size_t | sz, | ||
struct uuid * | uuid | ||
) |
Definition at line 273 of file kern_uuid.c.
References buf, uuid_private::hi, uuid_private::low, uuid_private::mid, uuid_private::node, uuid_private::seq, snprintf(), uuid_private::time, and uuid_private::x.
Referenced by printf_uuid(), and sbuf_printf_uuid().
int sys_uuidgen | ( | struct thread * | td, |
struct uuidgen_args * | uap | ||
) |
Definition at line 179 of file kern_uuid.c.
References count, uuidgen_args::count, free(), kern_uuidgen(), malloc(), and uuidgen_args::store.
int uuid_ether_add | ( | const uint8_t * | addr | ) |
Definition at line 203 of file kern_uuid.c.
References addr, uuid_macaddr::state, uuid_ether, UUID_ETHER_RANDOM, UUID_ETHER_UNIQUE, uuid_mutex, and UUID_NETHER.
int uuid_ether_del | ( | const uint8_t * | addr | ) |
Definition at line 245 of file kern_uuid.c.
References addr, uuid_macaddr::state, uuid_ether, UUID_ETHER_EMPTY, UUID_ETHER_UNIQUE, uuid_mutex, and UUID_NETHER.
|
static |
Definition at line 99 of file kern_uuid.c.
References uuid_macaddr::state, uuid_ether, UUID_ETHER_EMPTY, and UUID_ETHER_RANDOM.
Referenced by kern_uuidgen().
|
static |
Definition at line 120 of file kern_uuid.c.
Referenced by kern_uuidgen().
int uuidcmp | ( | const struct uuid * | uuid1, |
const struct uuid * | uuid2 | ||
) |
Definition at line 450 of file kern_uuid.c.
int validate_uuid | ( | const char * | str, |
size_t | size, | ||
struct uuid * | uuid, | ||
int | flags | ||
) |
Definition at line 385 of file kern_uuid.c.
References flags, and sscanf().
Referenced by parse_uuid(), and prison0_init().
|
static |
Definition at line 87 of file kern_uuid.c.
Referenced by uuid_ether_add(), uuid_ether_del(), and uuid_node().
|
static |
Definition at line 84 of file kern_uuid.c.
Referenced by kern_uuidgen().
|
static |
Definition at line 89 of file kern_uuid.c.
Referenced by kern_uuidgen(), uuid_ether_add(), and uuid_ether_del().