]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[uuid] Add uuid_aton() to parse a UUID from a string
authorMichael Brown <mcb30@ipxe.org>
Thu, 29 Feb 2024 13:58:50 +0000 (13:58 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 29 Feb 2024 14:43:55 +0000 (14:43 +0000)
commitda7b2662890dfb284786f37237a6c92809eee217
treeb162da60cf331f5db4f1389ebdef1556542858f2
parent182ee909313fc60875d3f1741cd4a0bb7dfd15e1
[uuid] Add uuid_aton() to parse a UUID from a string

Add uuid_aton() to parse a UUID value from a string (analogous to
inet_aton(), inet6_aton(), sock_aton(), etc), treating it as a
32-digit hex string with optional hyphen separators.  The placement of
the separators is not checked: each byte within the hex string may be
separated by a hyphen, or not separated at all.

Add dedicated self-tests for UUID parsing and formatting (already
partially covered by the ":uuid" and ":guid" settings self-tests).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/base16.c
src/core/uuid.c
src/include/ipxe/base16.h
src/include/ipxe/errfile.h
src/include/ipxe/uuid.h
src/tests/tests.c
src/tests/uuid_test.c [new file with mode: 0644]