opr: Add UUID handling functions
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 17 Jul 2012 15:50:59 +0000 (16:50 +0100)
committerDerrick Brashear <shadow@dementix.org>
Tue, 14 Aug 2012 19:53:08 +0000 (12:53 -0700)
commit6f6bfb31acb0cfbe166d4df9f06a12bbdec0f496
tree7043ca4df05851b41fd122b6eba2be27d9a0c475
parentb251b4057252163f3fad640cb5574c8dea9babc3
opr: Add UUID handling functions

Add a set of functions to the opr library to handle creating and
manipulating UUIDs.

The opr_uuid_t type is held as a 16 octet character string, which
comprises the UUID encoded into network byte order. This is the
primary form for manipulating UUIDs with this library, as it avoids
any nbo/hbo problems.

For applications which require raw access to the UUID components,
the opr_uuid_unpacked structure is provided, and
opr_uuid_pack/opr_uuid_unpack can be used to convert to and from
this format.

Finally, functions to print the UUID as a string, and parse a UUID
from a string, are provided. When printing, we use the standard UUID
format of 000000-0000-0000-0000-00000000. However, the afsUUID library
used to print UUIDs as 000000-0000-0000-00-00-00000000, so we also
accept this format.

Change-Id: I78ef79b7ab8ae15fb955c6495118722875c94f8d
Reviewed-on: http://gerrit.openafs.org/7977
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Makefile.in
acinclude.m4
src/opr/Makefile.in
src/opr/NTMakefile
src/opr/uuid.c [new file with mode: 0644]
src/opr/uuid.h [new file with mode: 0644]
tests/TESTS
tests/opr/Makefile.in
tests/opr/uuid-t.c [new file with mode: 0644]