Index: ossp-pkg/as/as-gui/as_uuid.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_uuid.cpp,v rcsdiff -q -kk '-r1.7' '-r1.8' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_uuid.cpp,v' 2>/dev/null --- as_uuid.cpp 2003/01/22 18:59:46 1.7 +++ as_uuid.cpp 2003/01/22 20:44:40 1.8 @@ -30,10 +30,26 @@ // #include +#include #include "as_uuid.h" #include "as_rand.h" +// All of these are for detecting +// the MAC address in setMac() +#ifdef HAVE_UNISTD_H +#include +#endif // HAVE_UNISTD_H +#ifdef HAVE_SYS_SOCKIO_H +#include +#endif // HAVE_SYS_SOCKIO_H +#ifdef HAVE_NET_IF_H +#include +#endif // HAVE_NET_IF_H +#ifdef HAVE_NETINET_IN_H +#include +#endif // HAVE_NETINET_IN_H + namespace AS { @@ -48,11 +64,15 @@ // Generate random data and fill in our UUID member fields with it Temprand.genData(szChardata, sizeof(szChardata)); setId(szChardata); - setString(); // Uses field from internal data // Since we don't just want random data, lets take some clock sequences also this->clock_seq = (this->clock_seq & 0x3FFF) | 0x8000; this->time_hi_and_version = (this->time_hi_and_version & 0x0FFF) | 0x4000; + + // In every case that we can, set the node ID to the real MAC address + setMac(this->node); + + setString(); // Set the human readable string } // @@ -88,12 +108,18 @@ } // +// Helper method to set up the MAC address node ID member data +// +int Uuid::setMac(unsigned char *pucNode) +{ + return 0; +} + +// // Returns a formatted representation of a DCE standard UUID // std::string Uuid::getString(void) { -// // Copy to outbound string and benefit from auto dealloc -// auto_ptr szOut(new char[48]); return m_Fmtstr; } Index: ossp-pkg/as/as-gui/as_uuid.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_uuid.h,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_uuid.h,v' 2>/dev/null --- as_uuid.h 2003/01/22 18:59:46 1.3 +++ as_uuid.h 2003/01/22 20:44:40 1.4 @@ -132,6 +132,7 @@ private: void setId(const unsigned char *); // Helper method to set data members + int setMac(unsigned char *); // Helper method to set MAC node ID }; }