head 1.10; access; symbols; locks; strict; comment @ * @; 1.10 date 2004.05.27.21.48.41; author ms; state Exp; branches; next 1.9; 1.9 date 2003.11.20.11.31.20; author ms; state Exp; branches; next 1.8; 1.8 date 2003.02.20.16.46.15; author ms; state Exp; branches; next 1.7; 1.7 date 2003.02.04.19.39.44; author ms; state Exp; branches; next 1.6; 1.6 date 2003.02.03.21.15.16; author ms; state Exp; branches; next 1.5; 1.5 date 2003.01.24.19.44.40; author ms; state Exp; branches; next 1.4; 1.4 date 2003.01.22.20.44.40; author ms; state Exp; branches; next 1.3; 1.3 date 2003.01.22.18.59.46; author ms; state Exp; branches; next 1.2; 1.2 date 2003.01.22.11.37.22; author ms; state Exp; branches; next 1.1; 1.1 date 2003.01.21.14.41.15; author ms; state Exp; branches; next ; desc @@ 1.10 log @Modernize copyright text in source and graphic headers. @ text @// // OSSP asgui - Accounting system graphical user interface // Copyright (c) 2002-2004 The OSSP Project (http://www.ossp.org/) // Copyright (c) 2002-2004 Ralf S. Engelschall // Copyright (c) 2002-2004 Michael Schloh von Bennewitz // Copyright (c) 2002-2004 Cable & Wireless Telecommunications Services GmbH // // This file is part of OSSP asgui, an accounting system graphical user // interface which can be found at http://www.ossp.org/pkg/tool/asgui/. // // Permission to use, copy, modify, and distribute this software for // any purpose with or without fee is hereby granted, provided that // the above copyright notice and this permission notice appear in all // copies. // // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF // USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. // // as_uuid.h: ISO C++ interface // #ifndef UUIDGEN_H #define UUIDGEN_H #include #include "as_gui.h" namespace AS { // // A DCE standard UUID, can generate (multiple) // IDs and format them for a printed output // class Uuid { private: std::string m_Fmtstr; // Human readable format U32 time_low; // U16 time_mid; // Fields according to U16 time_hi_and_version; // the IETF specification U16 clock_seq; // draft-mealling-uuid-urn-00 U8 node[6]; // public: void genId(void); // Generate an UUID void setString(void); // Sets the formatted representation std::string getString(void); // Return a formatted representation private: void setId(const unsigned char *); // Helper method to set data members int setMac(unsigned char *); // Helper method to set MAC node ID }; } // namespace AS #endif // UUIDGEN_H @ 1.9 log @Handle the time consuming bureaucracy of changing a company name. @ text @d3 4 a6 4 // Copyright (c) 2002-2003 The OSSP Project (http://www.ossp.org/) // Copyright (c) 2002-2003 Ralf S. Engelschall // Copyright (c) 2002-2003 Michael Schloh von Bennewitz // Copyright (c) 2002-2003 Cable & Wireless Telecommunications Services GmbH @ 1.8 log @Minor cleanup. @ text @a3 1 // Copyright (c) 2002-2003 Cable & Wireless Deutschland (http://www.cw.com/de/) d6 1 @ 1.7 log @Replaced __u format datatypes in Uuid class with U from master header. @ text @d39 1 a40 1 @ 1.6 log @Add small but helpful comment. @ text @d37 1 a37 3 #ifdef HAVE_CONFIG_H #include "ac_config.h" #endif a40 70 #ifdef HAVE_CONFIG_H #if (SIZEOF_CHAR == 1) typedef unsigned char __u8; #else ?==Error: Undefined 8 bit type #endif // __u8 #if (SIZEOF_SHORT == 2) typedef unsigned short __u16; #elif (SIZEOF_INT == 2) typedef unsigned int __u16; #elif (SIZEOF_LONG == 2) typedef unsigned long __u16; #else ?==Error: Undefined 16 bit type #endif // __u16 #if (SIZEOF_SHORT == 4) typedef unsigned short __u32; #elif (SIZEOF_INT == 4) typedef unsigned int __u32; #elif (SIZEOF_LONG == 4) typedef unsigned long __u32; #else ?==Error: Undefined 32 bit type #endif // __u32 #if (SIZEOF_SHORT == 8) typedef unsigned short __u64; #elif (SIZEOF_INT == 8) typedef unsigned int __u64; #elif (SIZEOF_LONG == 8) typedef unsigned long __u64; #elif (SIZEOF_LONG_LONG == 8) typedef unsigned long long __u64; #else ?==Error: Undefined 64 bit type #endif // __u64 #else // HAVE_CONFIG_H (not defined) typedef unsigned char __u8; #if (4 == 8) typedef unsigned int __u64; #elif (4 == 8) typedef unsigned long __u64; #elif (8 == 8) typedef unsigned long long __u64; #else ?==Error: Undefined 64 bit type #endif #if (4 == 2) typedef unsigned int __u16; #elif (2 == 2) typedef unsigned short __u16; #else ?==Error: Undefined 16 bit type #endif #if (4 == 4) typedef unsigned int __u32; #elif (4 == 4) typedef unsigned long __u32; #elif (2 == 4) typedef unsigned short __u32; #else ?== Error: Undefined 32 bit type #endif #endif // HAVE_CONFIG_H d50 5 a54 5 __u32 time_low; // __u16 time_mid; // Fields according to __u16 time_hi_and_version; // the IETF specification __u16 clock_seq; // draft-mealling-uuid-urn-00 __u8 node[6]; // @ 1.5 log @Rename files, and do cleanups. @ text @d137 1 a137 1 } @ 1.4 log @Prepare for the battle of retreiving a MAC address from the OS. @ text @d29 1 a29 1 // as_uuidgen.h: ISO C++ interface @ 1.3 log @Complete the UUID class for use in differentiating database entries. @ text @d135 1 @ 1.2 log @Bring to buildable status. @ text @d35 1 a35 1 #include "as_gui.h" d41 2 d114 4 a117 10 typedef unsigned char uuid_t[16]; struct uuid { __u32 time_low; __u16 time_mid; __u16 time_hi_and_version; __u16 clock_seq; __u8 node[6]; }; d120 8 d129 3 a131 7 void genTime(uuid_t); void genRand(uuid_t); void genId(uuid_t); void packId(const uuid *, uuid_t); void unpackId(const uuid_t, uuid *); void unparseId(const uuid_t, char *); d134 1 a134 4 int getRandfd(void); void getRandbytes(void *, int); int getNodeid(unsigned char *); int getClock(__u32 *, __u32 *, __u16 *); d136 1 @ 1.1 log @First cut at a UUID class. @ text @d47 1 d57 1 d67 1 d79 2 a80 2 #endif // SIZEOF_INT #else // HAVE_CONFIG_H d112 10 d125 8 a132 10 static int get_random_fd(void); static void get_random_bytes(void *, int); static int get_node_id(unsigned char *); static int get_clock(__u32 *, __u32 *, __u16 *); void uuid_generate_time(uuid_t); void uuid_generate_random(uuid_t); void uuid_generate(uuid_t); void uuid_pack(const struct uuid *, uuid_t); void uuid_unpack(const uuid_t, struct uuid *); void uuid_unparse(const uuid_t, char *); d134 4 @