00001 /***************************** License ********************************** 00002 00003 Copyright (C) 2008 by Communicative Machines 00004 http://www.cmlabs.com All rights reserved. 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either 00009 version 2.1 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public 00017 License along with this library; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 00020 ************************************************************************/ 00021 #include "copyrt.h" 00022 00023 #ifdef _WINDOWS_ 00024 #include <windows.h> 00025 #else 00026 #include <sys/types.h> 00027 #include <sys/time.h> 00028 #ifndef Darwin 00029 #include <sys/sysinfo.h> 00030 #endif 00031 #endif 00032 00033 /* change to point to where MD5 .h's live */ 00034 /* get MD5 sample implementation from RFC 1321 */ 00035 #include "global.h" 00036 #include "md5.h" 00037 00038 /* set the following to the number of 100ns ticks of the actual 00039 * resolution of your system's clock 00040 */ 00041 #define UUIDS_PER_TICK 1024 00042 00043 /* Set the following to a call to acquire a system wide global lock 00044 */ 00045 #define LOCK 00046 #define UNLOCK 00047 00048 typedef unsigned long unsigned32; 00049 typedef unsigned short unsigned16; 00050 typedef unsigned char unsigned8; 00051 typedef unsigned char byte; 00052 00053 /* Set this to what your compiler uses for 64 bit data type */ 00054 #ifdef WININC 00055 #define unsigned64_t unsigned __int64 00056 #define I64(C) C 00057 #else 00058 #define unsigned64_t unsigned long long 00059 #define I64(C) C##LL 00060 #endif 00061 00062 00063 typedef unsigned64_t uuid_time_t; 00064 typedef struct { 00065 char nodeID[6]; 00066 } uuid_node_t; 00067 00068 void get_ieee_node_identifier(uuid_node_t *node); 00069 void get_system_time(uuid_time_t *uuid_time); 00070 void get_random_info(char seed[16]);