return json_variant_set_field_non_null(v, "Prefixes", array);
}
+static int dhcp6_client_duid_append_json(Link *link, JsonVariant **v) {
+ const sd_dhcp_duid *duid;
+ const void *data;
+ size_t data_size;
+ int r;
+
+ assert(link);
+ assert(v);
+
+ if (!link->dhcp6_client)
+ return 0;
+
+ r = sd_dhcp6_client_get_duid(link->dhcp6_client, &duid);
+ if (r < 0)
+ return 0;
+
+ r = sd_dhcp_duid_get_raw(&link->dhcp6_client->duid, &data, &data_size);
+ if (r < 0)
+ return 0;
+
+ return json_variant_merge_objectb(v, JSON_BUILD_OBJECT(JSON_BUILD_PAIR_BYTE_ARRAY("DUID", data, data_size)));
+}
+
static int dhcp6_client_append_json(Link *link, JsonVariant **v) {
_cleanup_(json_variant_unrefp) JsonVariant *w = NULL;
int r;
if (r < 0)
return r;
+ r = dhcp6_client_duid_append_json(link, &w);
+ if (r < 0)
+ return r;
+
return json_variant_set_field_non_null(v, "DHCPv6Client", w);
}