diff options
author | Thomas Haller <thaller@redhat.com> | 2018-10-31 10:38:01 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-10-31 10:47:34 +0100 |
commit | e0fb702aac34116c2b063a3b88e7fbd6b999c381 (patch) | |
tree | 715b80dbacef9b2be013e5a8566de9397ae674ed /libnm-core/nm-utils.c | |
parent | b77f509e8211ceb0d8d7161d1cf5517447ec1416 (diff) | |
download | NetworkManager-th/uuid.tar.gz |
libnm: add nm_utils_uuid_is_null() helperth/uuid
Diffstat (limited to 'libnm-core/nm-utils.c')
-rw-r--r-- | libnm-core/nm-utils.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index abdf80474a..6504158a53 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -2821,6 +2821,21 @@ _nm_utils_uuid_generate_random (NMUuid *out_uuid) return out_uuid; } +gboolean +nm_utils_uuid_is_null (const NMUuid *uuid) +{ + int i; + + if (!uuid) + return TRUE; + + for (i = 0; i < G_N_ELEMENTS (uuid->uuid); i++) { + if (uuid->uuid[i]) + return FALSE; + } + return TRUE; +} + /** * nm_utils_uuid_generate_buf_: * @buf: input buffer, must contain at least 37 bytes |