Exemplo n.º 1
0
static void
test_uuid_main(int argc, char *argv[])
{
    struct uuid uuid;

    if (argc == 1) {
        uuid_generate(&uuid);
    } else if (argc == 2) {
        if (!uuid_from_string(&uuid, argv[1])) {
            ovs_fatal(0, "\"%s\" is not a valid UUID", argv[1]);
        }
    } else {
        ovs_fatal(0, "usage: %s [UUID]", argv[0]);
    }

    printf(UUID_FMT"\n", UUID_ARGS(&uuid));
}
Exemplo n.º 2
0
/* Allocates a key for NAT conntrack zone allocation for a provided
 * 'key' record and a 'type'.
 *
 * It is the caller's responsibility to free the allocated memory. */
char *
alloc_nat_zone_key(const struct uuid *key, const char *type)
{
    return xasprintf(UUID_FMT"_%s", UUID_ARGS(key), type);
}