- DEBUG ("snmp plugin: hd = { name = %s, address = %s, community = %s, version = %i }",
- hd->name, hd->address, hd->community, hd->version);
-
- ssnprintf (cb_name, sizeof (cb_name), "snmp-%s", hd->name);
-
- memset (&cb_data, 0, sizeof (cb_data));
- cb_data.data = hd;
- cb_data.free_func = csnmp_host_definition_destroy;
-
- CDTIME_T_TO_TIMESPEC (hd->interval, &cb_interval);
-
- status = plugin_register_complex_read (/* group = */ NULL, cb_name,
- csnmp_read_host, /* interval = */ &cb_interval,
- /* user_data = */ &cb_data);
- if (status != 0)
- {
- ERROR ("snmp plugin: Registering complex read function failed.");
- csnmp_host_definition_destroy (hd);
- return (-1);
+ DEBUG("snmp plugin: hd = { name = %s, address = %s, community = %s, version "
+ "= %i }",
+ hd->name, hd->address, hd->community, hd->version);
+
+ snprintf(cb_name, sizeof(cb_name), "snmp-%s", hd->name);
+
+ status = plugin_register_complex_read(
+ /* group = */ NULL, cb_name, csnmp_read_host, hd->interval,
+ &(user_data_t){
+ .data = hd, .free_func = csnmp_host_definition_destroy,
+ });
+ if (status != 0) {
+ ERROR("snmp plugin: Registering complex read function failed.");
+ csnmp_host_definition_destroy(hd);
+ return -1;