00001 /* 00002 ** Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. 00003 ** Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & 00004 ** Digital Equipment Corporation, Maynard, Mass. 00005 ** Copyright (c) 1998 Microsoft. 00006 ** To anyone who acknowledges that this file is provided "AS IS" 00007 ** without any express or implied warranty: permission to use, copy, 00008 ** modify, and distribute this file for any purpose is hereby 00009 ** granted without fee, provided that the above copyright notices and 00010 ** this notice appears in all source code copies, and that none of 00011 ** the names of Open Software Foundation, Inc., Hewlett-Packard 00012 ** Company, or Digital Equipment Corporation be used in advertising 00013 ** or publicity pertaining to distribution of the software without 00014 ** specific, written prior permission. Neither Open Software 00015 ** Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital Equipment 00016 ** Corporation makes any representations about the suitability of 00017 ** this software for any purpose. 00018 */ 00019 00020 #include <sys/types.h> 00021 #ifndef WIN32 00022 #include <sys/time.h> 00023 #endif 00024 //#include <sys/sysinfo.h> 00025 #include "ithread.h" 00026 00027 /* change to point to where MD5 .h's live */ 00028 /* get MD5 sample implementation from RFC 1321 */ 00029 #include "global.h" 00030 #include "upnp_md5.h" 00031 00032 /* set the following to the number of 100ns ticks of the actual 00033 resolution of 00034 your system's clock */ 00035 #define UUIDS_PER_TICK 1024 00036 00037 /* Set the following to a call to acquire a system wide global lock 00038 */ 00039 extern ithread_mutex_t gUUIDMutex; 00040 00041 #define UUIDLock() ithread_mutex_lock(&gUUIDMutex) 00042 #define UUIDUnlock() ithread_mutex_unlock(&gUUIDMutex) 00043 00044 typedef unsigned long unsigned32; 00045 typedef unsigned short unsigned16; 00046 typedef unsigned char unsigned8; 00047 typedef unsigned char byte; 00048 00049 /* Set this to what your compiler uses for 64 bit data type */ 00050 #ifndef WIN32 00051 #define unsigned64_t unsigned long long 00052 #else 00053 #define unsigned64_t __int64 00054 #endif 00055 #define I64(C) C##LL 00056 00057 typedef unsigned64_t uuid_time_t; 00058 typedef struct { 00059 char nodeID[6]; 00060 } uuid_node_t; 00061 00062 void get_ieee_node_identifier(uuid_node_t *node); 00063 void get_system_time(uuid_time_t *uuid_time); 00064 void get_random_info(unsigned char seed[16]);
1.6.1