su
1.13.18
Toggle main menu visibility
Loading...
Searching...
No Matches
su_uniqueid.h
Go to the documentation of this file.
1
/*
2
* This file is part of the Sofia-SIP package
3
*
4
* Copyright (C) 2005 Nokia Corporation.
5
*
6
* Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
7
*
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public License
10
* as published by the Free Software Foundation; either version 2.1 of
11
* the License, or (at your option) any later version.
12
*
13
* This library is distributed in the hope that it will be useful, but
14
* WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21
* 02110-1301 USA
22
*
23
*/
24
25
#ifndef SU_UNIQUEID_H
27
#define SU_UNIQUEID_H
28
29
40
41
#ifndef SU_TYPES_H
42
#include <
sofia-sip/su_types.h
>
43
#endif
44
45
SOFIA_BEGIN_DECLS
46
48
typedef
union
GloballyUniqueIdentifier
{
49
unsigned
char
id
[16];
50
struct
{
51
uint32_t
time_low;
52
uint16_t
time_mid;
53
uint16_t
time_high_and_version;
54
uint8_t
clock_seq_hi_and_reserved;
55
uint8_t
clock_seq_low;
56
uint8_t
node[6];
57
} s;
58
}
su_guid_t
;
59
61
SOFIAPUBFUN
size_t
su_node_identifier
(
void
*address,
size_t
addrlen);
62
72
SOFIAPUBFUN
void
su_guid_generate
(
su_guid_t
*guid);
73
90
SOFIAPUBFUN
isize_t
su_guid_sprintf
(
char
* buf,
size_t
len,
su_guid_t
const
*guid);
91
92
enum
{
94
su_guid_strlen
= 8 + 5 + 5 + 5 + 13
95
};
96
108
SOFIAPUBFUN
int
su_randint
(
int
lb,
int
ub);
109
117
SOFIAPUBFUN
void
*
su_randmem
(
void
*mem,
size_t
siz);
118
120
SOFIAPUBFUN
uint32_t
su_random
(
void
);
121
122
SOFIA_END_DECLS
123
124
#endif
SOFIAPUBFUN
#define SOFIAPUBFUN
SOFIAPUBFUN declares an exported function.
Definition
su_config.h:66
su_types.h
Basic integer types for su library.
uint32_t
SU_U32_T uint32_t
32-bit unsigned integer
Definition
su_types.h:87
uint16_t
SU_U16_T uint16_t
16-bit unsigned integer
Definition
su_types.h:91
uint8_t
SU_U8_T uint8_t
8-bit unsigned integer
Definition
su_types.h:95
su_guid_t
union GloballyUniqueIdentifier su_guid_t
Globally unique identifier type.
su_guid_sprintf
isize_t su_guid_sprintf(char *buf, size_t len, su_guid_t const *guid)
Print guid.
Definition
su_uniqueid.c:346
su_guid_strlen
@ su_guid_strlen
Length of guid in hex format.
Definition
su_uniqueid.h:94
su_random
uint32_t su_random(void)
Generate a random 32-bit integer.
Definition
su_uniqueid.c:427
su_randint
int su_randint(int lb, int ub)
Random integer in range [lb, ub] (inclusive).
Definition
su_uniqueid.c:405
su_randmem
void * su_randmem(void *mem, size_t siz)
Fill memory with random values.
Definition
su_uniqueid.c:376
su_node_identifier
size_t su_node_identifier(void *address, size_t addrlen)
Return node identifier.
Definition
su_uniqueid.c:268
su_guid_generate
void su_guid_generate(su_guid_t *guid)
Generate a GUID.
Definition
su_uniqueid.c:279
GloballyUniqueIdentifier
Globally unique identifier type.
Definition
su_uniqueid.h:48
Sofia-SIP 1.13.18 - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.