[Subversion] / PEAK / src / peak / util / nodeid48.py  

Log of /PEAK/src/peak/util/nodeid48.py

Parent Directory

No default branch
Bookmark a link to HEAD: (view) (download) (as text)


Revision 1656 - (view) (download) (as text) - [select for diffs]
Modified Thu Jan 29 17:36:56 2004 UTC (20 years, 2 months ago) by tsarna
File length: 2318 byte(s)
Diff to previous 1644
Use uuidgen() system call where available

Revision 1644 - (view) (download) (as text) - [select for diffs]
Modified Mon Jan 26 22:12:26 2004 UTC (20 years, 2 months ago) by tsarna
File length: 2166 byte(s)
Diff to previous 1085
Fix generation of random multicast MAC address, a'la FreeBSD's
src/sys/kern/kern_uuid.c rev 1.7:

"""In case no real/physical IEEE 802 address is available, both the expired
"draft-leach-uuids-guids-01" (section "4. Node IDs when no IEEE 802
network card is available") and RFC 2518 (section "6.4.1 Node Field
Generation Without the IEEE 802 Address") recommend (quoted from RFC
2518):

  "The ideal solution is to obtain a 47 bit cryptographic quality random
  number, and use it as the low 47 bits of the node ID, with the _most_
  significant bit of the first octet of the node ID set to 1. This bit
  is the unicast/multicast bit, which will never be set in IEEE 802
  addresses obtained from network cards; hence, there can never be a
  conflict between UUIDs generated by machines with and without network
  cards."

Unfortunately, this incorrectly explains how to implement this and
the FreeBSD UUID generator code inherited this generation bug from
the broken reference code in the standards draft. They should instead
specify the "_least_ significant bit of the first octet of the node ID"
as the multicast bit in a memory and hexadecimal string representation
of a 48-bit IEEE 802 MAC address.

This standards bug arised from a false interpretation, as the multicast
bit is actually the _most_ significant bit in IEEE 802.3 (Ethernet)
_transmission order_ of an IEEE 802 MAC address. The standards authors
forgot that the bitwise order of an _octet_ from a MAC address _memory_
and hexadecimal string representation is still always from left (MSB,
bit 7) to right (LSB, bit 0).

Fortunately, this UUID generation bug could have occurred on systems
without any Ethernet NICs only."""

nodeid48 suffered the same bug, for the same reasons, with the same impact.

Revision 1085 - (view) (download) (as text) - [select for diffs]
Modified Tue May 6 20:47:17 2003 UTC (20 years, 10 months ago) by pje
File length: 2166 byte(s)
Diff to previous 1076
Removed unused imports, found by Martijn Faassen's clever 'importchecker'
script. (http://www.zope.org/Members/faassen/importchecker)

Revision 1076 - (view) (download) (as text) - [select for diffs]
Modified Sat May 3 13:21:20 2003 UTC (20 years, 11 months ago) by pje
File length: 2172 byte(s)
Diff to previous 1012
Normalized whitespace.

Revision 1012 - (view) (download) (as text) - [select for diffs]
Modified Wed Apr 23 16:01:17 2003 UTC (20 years, 11 months ago) by tsarna
File length: 2153 byte(s)
Diff to previous 580
At least some linuxes seem to have "dummy0" with "ethernet" address of
00:00:00:00:00:00, which from_ifconfig happily finds and uses.
Added a hack to skip these.

Revision 580 - (view) (download) (as text) - [select for diffs]
Modified Wed Oct 30 23:06:35 2002 UTC (21 years, 5 months ago) by pje
File length: 1968 byte(s)
Diff to previous 446
Misc. docstring fixes for better summaries in generated API docs.

Revision 446 - (view) (download) (as text) - [select for diffs]
Modified Thu Jul 4 16:15:35 2002 UTC (21 years, 8 months ago) by pje
File length: 1917 byte(s)
Diff to previous 443
Added win32 support; also, changed to only try to get nodeid if it's
needed, to avoid the process spawn, etc. overhead if the nodeid is never
needed.

Revision 443 - (view) (download) (as text) - [select for diffs]
Modified Thu Jul 4 15:20:37 2002 UTC (21 years, 8 months ago) by tsarna
File length: 1677 byte(s)
Diff to previous 441
Update to use peak.util.random

Revision 441 - (view) (download) (as text) - [select for diffs]
Added Wed Jul 3 16:09:42 2002 UTC (21 years, 9 months ago) by tsarna
File length: 2988 byte(s)
Obtain or generate a unique 48 bit identifier for the machine,
suitable for use in UUID generation.

XXX should work on win32 but doesn't take advantage of win32 api.

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

  Diffs between and
  Type of Diff should be a

Sort log by:

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help