Signed-off-by: Michael Brown <mcb30@ipxe.org>
#include <ctype.h>
#include <errno.h>
#include <getopt.h>
+#include <ipxe/uuid.h>
#include <ipxe/netdevice.h>
#include <ipxe/menu.h>
#include <ipxe/settings.h>
return 0;
}
+/**
+ * Parse UUID
+ *
+ * @v text Text
+ * @ret value UUID value
+ * @ret rc Return status code
+ */
+int parse_uuid ( char *text, union uuid *value ) {
+ int rc;
+
+ /* Sanity check */
+ assert ( text != NULL );
+
+ /* Parse UUID */
+ if ( ( rc = uuid_aton ( text, value ) ) != 0 ) {
+ printf ( "\"%s\": invalid UUID\n", text );
+ return rc;
+ }
+
+ return 0;
+}
+
/**
* Parse network device name
*
#include <stdint.h>
#include <stddef.h>
+#include <ipxe/uuid.h>
#include <ipxe/settings.h>
struct net_device;
extern int parse_string ( char *text, char **value );
extern int parse_integer ( char *text, unsigned int *value );
extern int parse_timeout ( char *text, unsigned long *value );
+extern int parse_uuid ( char *text, union uuid *value );
extern int parse_netdev ( char *text, struct net_device **netdev );
extern int
parse_netdev_configurator ( char *text,