iPXE
Functions
uuid.c File Reference

Universally unique IDs. More...

#include <stdint.h>
#include <stdio.h>
#include <byteswap.h>
#include <ipxe/uuid.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
const char * uuid_ntoa (const union uuid *uuid)
 Convert UUID to printable string.

Detailed Description

Universally unique IDs.

Definition in file uuid.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
const char* uuid_ntoa ( const union uuid uuid)

Convert UUID to printable string.

Parameters:
uuidUUID
Return values:
stringUUID in canonical form

Definition at line 43 of file uuid.c.

References uuid::a, uuid::b, be16_to_cpu, be32_to_cpu, uuid::c, uuid::canonical, uuid::d, uuid::e, and sprintf.

Referenced by efi_guid_ntoa(), format_uuid_setting(), iscsi_fetch_settings(), peerdisc_create(), vmbus_probe_channels(), and vmbus_reset_channels().

                                                  {
        static char buf[37]; /* "00000000-0000-0000-0000-000000000000" */

        sprintf ( buf, "%08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x",
                  be32_to_cpu ( uuid->canonical.a ),
                  be16_to_cpu ( uuid->canonical.b ),
                  be16_to_cpu ( uuid->canonical.c ),
                  be16_to_cpu ( uuid->canonical.d ),
                  uuid->canonical.e[0], uuid->canonical.e[1],
                  uuid->canonical.e[2], uuid->canonical.e[3],
                  uuid->canonical.e[4], uuid->canonical.e[5] );
        return buf;
}