Distributed Publish Subscribe for IoT
uuid.h
Go to the documentation of this file.
1 /*
2  *******************************************************************
3  *
4  * Copyright 2016 Intel Corporation All rights reserved.
5  *
6  *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21  */
22 
23 #ifndef _DPS_UUID_H
24 #define _DPS_UUID_H
25 
26 #include <stdint.h>
27 #include <dps/err.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
36 typedef struct _DPS_UUID {
37  union {
38  uint8_t val[16];
39  uint64_t val64[2];
40  };
41 } DPS_UUID;
42 
47 
51 void DPS_GenerateUUID(DPS_UUID* uuid);
52 
56 const char* DPS_UUIDToString(const DPS_UUID* uuid);
57 
61 int DPS_UUIDCompare(const DPS_UUID* a, const DPS_UUID* b);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif
Type definition for a UUID.
Definition: uuid.h:36
int DPS_UUIDCompare(const DPS_UUID *a, const DPS_UUID *b)
Numerical comparison of two UUIDs.
const char * DPS_UUIDToString(const DPS_UUID *uuid)
Return a string representation of a UUID.
int DPS_Status
Definition: err.h:30
uint64_t val64[2]
Definition: uuid.h:39
uint8_t val[16]
Definition: uuid.h:38
DPS_Status DPS_InitUUID()
One time initialization.
void DPS_GenerateUUID(DPS_UUID *uuid)
Non secure generation of a random UUID.
struct _DPS_UUID DPS_UUID
Type definition for a UUID.