Clang-format a few files to make CI happy
authorMatthias Runge <mrunge@redhat.com>
Fri, 19 Jul 2019 14:15:56 +0000 (16:15 +0200)
committerMatthias Runge <mrunge@redhat.com>
Fri, 19 Jul 2019 15:01:26 +0000 (17:01 +0200)
97 files changed:
src/aggregation.c
src/amqp1.c
src/apache.c
src/battery.c
src/bind.c
src/chrony.c
src/collectdctl.c
src/collectdmon.c
src/contextswitch.c
src/cpu.c
src/cpusleep.c
src/cpython.h
src/curl.c
src/curl_json.c
src/curl_xml.c
src/daemon/cmd.c
src/daemon/collectd.c
src/daemon/configfile.c
src/daemon/plugin.c
src/daemon/utils_cache.c
src/disk.c
src/dns.c
src/email.c
src/exec.c
src/gpu_nvidia.c
src/intel_rdt_test.c
src/interface.c
src/ipc.c
src/ipvs.c
src/java.c
src/libcollectdclient/client.c
src/libcollectdclient/network_parse.c
src/libcollectdclient/network_parse_test.c
src/liboconfig/aux_types.h
src/lua.c
src/madwifi.c
src/madwifi.h
src/match_empty_counter.c
src/mcelog.c
src/memcached.c
src/memory.c
src/modbus.c
src/mysql.c
src/netapp.c
src/netlink.c
src/network.c
src/nfs.c
src/nut.c
src/openldap.c
src/ovs_stats.c
src/pcie_errors.c
src/processes.c
src/protocols.c
src/python.c
src/redis.c
src/routeros.c
src/rrdcached.c
src/rrdtool.c
src/sensors.c
src/serial.c
src/snmp.c
src/statsd.c
src/swap.c
src/tail_csv.c
src/tape.c
src/tcpconns.c
src/teamspeak2.c
src/threshold.c
src/turbostat.c
src/uptime.c
src/users.c
src/utils/cmds/cmds_test.c
src/utils/common/common.c
src/utils/dns/dns.c
src/utils/dpdk/dpdk.c
src/utils/format_json/format_json.c
src/utils/format_json/format_json_test.c
src/utils/format_stackdriver/format_stackdriver_test.c
src/utils/latency/latency.c
src/utils/latency/latency_config.c
src/utils/latency/latency_test.c
src/utils/mount/mount.c
src/utils/mount/mount.h
src/utils/oauth/oauth_test.c
src/utils/proc_pids/proc_pids.c
src/utils/rrdcreate/rrdcreate.c
src/utils/taskstats/taskstats.c
src/utils_tail_match.h
src/varnish.c
src/virt.c
src/vmem.c
src/vserver.c
src/write_graphite.c
src/write_http.c
src/write_kafka.c
src/write_mongodb.c
src/write_prometheus.c

index 7a214ca..2c8ef88 100644 (file)
@@ -398,10 +398,9 @@ static int agg_instance_read(agg_instance_t *inst, cdtime_t t) /* {{{ */
     READ_FUNC(average, (inst->sum / ((gauge_t)inst->num)));
     READ_FUNC(min, inst->min);
     READ_FUNC(max, inst->max);
     READ_FUNC(average, (inst->sum / ((gauge_t)inst->num)));
     READ_FUNC(min, inst->min);
     READ_FUNC(max, inst->max);
-    READ_FUNC(stddev,
-              sqrt((((gauge_t)inst->num) * inst->squares_sum) -
-                   (inst->sum * inst->sum)) /
-                  ((gauge_t)inst->num));
+    READ_FUNC(stddev, sqrt((((gauge_t)inst->num) * inst->squares_sum) -
+                           (inst->sum * inst->sum)) /
+                          ((gauge_t)inst->num));
   }
 
   /* Reset internal state. */
   }
 
   /* Reset internal state. */
index 601f0ae..67c96b7 100644 (file)
@@ -639,14 +639,16 @@ static int amqp1_config_instance(oconfig_item_t *ci) /* {{{ */
       status = plugin_register_notification(
           tpname, amqp1_notify,
           &(user_data_t){
       status = plugin_register_notification(
           tpname, amqp1_notify,
           &(user_data_t){
-              .data = instance, .free_func = amqp1_config_instance_free,
+              .data = instance,
+              .free_func = amqp1_config_instance_free,
           });
     } else {
           });
     } else {
-      status = plugin_register_write(
-          tpname, amqp1_write,
-          &(user_data_t){
-              .data = instance, .free_func = amqp1_config_instance_free,
-          });
+      status =
+          plugin_register_write(tpname, amqp1_write,
+                                &(user_data_t){
+                                    .data = instance,
+                                    .free_func = amqp1_config_instance_free,
+                                });
     }
 
     if (status != 0) {
     }
 
     if (status != 0) {
index d64e547..4014bba 100644 (file)
@@ -224,7 +224,8 @@ static int config_add(oconfig_item_t *ci) {
       /* callback  = */ apache_read_host,
       /* interval  = */ 0,
       &(user_data_t){
       /* callback  = */ apache_read_host,
       /* interval  = */ 0,
       &(user_data_t){
-          .data = st, .free_func = apache_free,
+          .data = st,
+          .free_func = apache_free,
       });
 } /* int config_add */
 
       });
 } /* int config_add */
 
index 8e6c4b2..20ec261 100644 (file)
@@ -336,7 +336,7 @@ static int battery_read(void) /* {{{ */
 
   return 0;
 } /* }}} int battery_read */
 
   return 0;
 } /* }}} int battery_read */
-/* #endif HAVE_IOKIT_IOKITLIB_H || HAVE_IOKIT_PS_IOPOWERSOURCES_H */
+  /* #endif HAVE_IOKIT_IOKITLIB_H || HAVE_IOKIT_PS_IOPOWERSOURCES_H */
 
 #elif KERNEL_LINUX
 /* Reads a file which contains only a number (and optionally a trailing
 
 #elif KERNEL_LINUX
 /* Reads a file which contains only a number (and optionally a trailing
index 29f65d4..a246f1a 100644 (file)
@@ -1538,8 +1538,9 @@ static int bind_init(void) /* {{{ */
   curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
 #ifdef HAVE_CURLOPT_TIMEOUT_MS
   curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS,
   curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
 #ifdef HAVE_CURLOPT_TIMEOUT_MS
   curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS,
-                   (timeout >= 0) ? (long)timeout : (long)CDTIME_T_TO_MS(
-                                                        plugin_get_interval()));
+                   (timeout >= 0)
+                       ? (long)timeout
+                       : (long)CDTIME_T_TO_MS(plugin_get_interval()));
 #endif
 
   return 0;
 #endif
 
   return 0;
index 65e3c4c..079a335 100644 (file)
@@ -111,7 +111,9 @@ typedef enum {
 #define ATTRIB_PACKED
 #endif
 
 #define ATTRIB_PACKED
 #endif
 
-typedef struct ATTRIB_PACKED { int32_t value; } tFloat;
+typedef struct ATTRIB_PACKED {
+  int32_t value;
+} tFloat;
 
 typedef struct ATTRIB_PACKED {
   uint32_t tv_sec_high;
 
 typedef struct ATTRIB_PACKED {
   uint32_t tv_sec_high;
@@ -148,7 +150,9 @@ typedef struct ATTRIB_PACKED {
                            Amplification) */
 } tChrony_Req_Tracking;
 
                            Amplification) */
 } tChrony_Req_Tracking;
 
-typedef struct ATTRIB_PACKED { uint32_t f_n_sources; } tChrony_Req_N_Sources;
+typedef struct ATTRIB_PACKED {
+  uint32_t f_n_sources;
+} tChrony_Req_N_Sources;
 
 typedef struct ATTRIB_PACKED {
   int32_t f_index;
 
 typedef struct ATTRIB_PACKED {
   int32_t f_index;
@@ -183,7 +187,9 @@ typedef struct ATTRIB_PACKED {
 } tChrony_Request;
 
 /* Chrony daemon response packets */
 } tChrony_Request;
 
 /* Chrony daemon response packets */
-typedef struct ATTRIB_PACKED { uint32_t f_n_sources; } tChrony_Resp_N_Sources;
+typedef struct ATTRIB_PACKED {
+  uint32_t f_n_sources;
+} tChrony_Resp_N_Sources;
 
 typedef struct ATTRIB_PACKED {
   union {
 
 typedef struct ATTRIB_PACKED {
   union {
index 1ced583..df83b50 100644 (file)
@@ -293,8 +293,9 @@ static int flush(lcc_connection_t *c, int argc, char **argv) {
                 value);
         BAIL_OUT(-1);
       } else if ((endptr != NULL) && (*endptr != '\0')) {
                 value);
         BAIL_OUT(-1);
       } else if ((endptr != NULL) && (*endptr != '\0')) {
-        fprintf(stderr, "WARNING: Ignoring trailing garbage after timeout: "
-                        "%s.\n",
+        fprintf(stderr,
+                "WARNING: Ignoring trailing garbage after timeout: "
+                "%s.\n",
                 endptr);
       }
     } else if (strcasecmp(key, "plugin") == 0) {
                 endptr);
       }
     } else if (strcasecmp(key, "plugin") == 0) {
@@ -341,8 +342,9 @@ static int flush(lcc_connection_t *c, int argc, char **argv) {
           char id[1024];
 
           lcc_identifier_to_string(c, id, sizeof(id), identifiers + j);
           char id[1024];
 
           lcc_identifier_to_string(c, id, sizeof(id), identifiers + j);
-          fprintf(stderr, "ERROR: Failed to flush plugin `%s', "
-                          "identifier `%s': %s.\n",
+          fprintf(stderr,
+                  "ERROR: Failed to flush plugin `%s', "
+                  "identifier `%s': %s.\n",
                   (plugins[i] == NULL) ? "(all)" : plugins[i], id,
                   lcc_strerror(c));
         }
                   (plugins[i] == NULL) ? "(all)" : plugins[i], id,
                   lcc_strerror(c));
         }
@@ -386,8 +388,9 @@ static int listval(lcc_connection_t *c, int argc, char **argv) {
 
     status = lcc_identifier_to_string(c, id, sizeof(id), ret_ident + i);
     if (status != 0) {
 
     status = lcc_identifier_to_string(c, id, sizeof(id), ret_ident + i);
     if (status != 0) {
-      fprintf(stderr, "ERROR: listval: Failed to convert returned "
-                      "identifier to a string: %s\n",
+      fprintf(stderr,
+              "ERROR: listval: Failed to convert returned "
+              "identifier to a string: %s\n",
               lcc_strerror(c));
       continue;
     }
               lcc_strerror(c));
       continue;
     }
@@ -445,8 +448,9 @@ static int putval(lcc_connection_t *c, int argc, char **argv) {
                   value);
           return -1;
         } else if ((endptr != NULL) && (*endptr != '\0')) {
                   value);
           return -1;
         } else if ((endptr != NULL) && (*endptr != '\0')) {
-          fprintf(stderr, "WARNING: Ignoring trailing garbage after "
-                          "interval: %s.\n",
+          fprintf(stderr,
+                  "WARNING: Ignoring trailing garbage after "
+                  "interval: %s.\n",
                   endptr);
         }
       } else {
                   endptr);
         }
       } else {
index 0e2b021..6affd3c 100644 (file)
@@ -255,8 +255,9 @@ static void check_respawn(void) {
   if (counter >= 10) {
     unsigned int time_left = 300;
 
   if (counter >= 10) {
     unsigned int time_left = 300;
 
-    syslog(LOG_ERR, "Error: collectd is respawning too fast - "
-                    "disabled for %i seconds",
+    syslog(LOG_ERR,
+           "Error: collectd is respawning too fast - "
+           "disabled for %i seconds",
            time_left);
 
     while (((time_left = sleep(time_left)) > 0) && loop == 0)
            time_left);
 
     while (((time_left = sleep(time_left)) > 0) && loop == 0)
@@ -323,7 +324,8 @@ int main(int argc, char **argv) {
   }
 
   struct sigaction sa = {
   }
 
   struct sigaction sa = {
-      .sa_handler = sig_int_term_handler, .sa_flags = 0,
+      .sa_handler = sig_int_term_handler,
+      .sa_flags = 0,
   };
   sigemptyset(&sa.sa_mask);
 
   };
   sigemptyset(&sa.sa_mask);
 
index acf3a74..cf3d3da 100644 (file)
@@ -73,7 +73,7 @@ static int cs_read(void) {
   }
 
   cs_submit(value);
   }
 
   cs_submit(value);
-/* #endif HAVE_SYSCTLBYNAME */
+  /* #endif HAVE_SYSCTLBYNAME */
 
 #elif KERNEL_LINUX
   FILE *fh;
 
 #elif KERNEL_LINUX
   FILE *fh;
@@ -116,7 +116,7 @@ static int cs_read(void) {
 
   if (status == -2)
     ERROR("contextswitch plugin: Unable to find context switch value.");
 
   if (status == -2)
     ERROR("contextswitch plugin: Unable to find context switch value.");
-/* #endif  KERNEL_LINUX */
+    /* #endif  KERNEL_LINUX */
 
 #elif HAVE_PERFSTAT
   int status = 0;
 
 #elif HAVE_PERFSTAT
   int status = 0;
index e7f3c18..09d60fe 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -251,7 +251,7 @@ static int init(void) {
 
   INFO("cpu plugin: Found %i processor%s.", (int)cpu_list_len,
        cpu_list_len == 1 ? "" : "s");
 
   INFO("cpu plugin: Found %i processor%s.", (int)cpu_list_len,
        cpu_list_len == 1 ? "" : "s");
-/* #endif PROCESSOR_CPU_LOAD_INFO */
+  /* #endif PROCESSOR_CPU_LOAD_INFO */
 
 #elif defined(HAVE_LIBKSTAT)
   kstat_t *ksp_chain;
 
 #elif defined(HAVE_LIBKSTAT)
   kstat_t *ksp_chain;
@@ -267,7 +267,7 @@ static int init(void) {
        ksp_chain = ksp_chain->ks_next)
     if (strncmp(ksp_chain->ks_module, "cpu_stat", 8) == 0)
       ksp[numcpu++] = ksp_chain;
        ksp_chain = ksp_chain->ks_next)
     if (strncmp(ksp_chain->ks_module, "cpu_stat", 8) == 0)
       ksp[numcpu++] = ksp_chain;
-/* #endif HAVE_LIBKSTAT */
+      /* #endif HAVE_LIBKSTAT */
 
 #elif CAN_USE_SYSCTL
   size_t numcpu_size;
 
 #elif CAN_USE_SYSCTL
   size_t numcpu_size;
@@ -282,7 +282,7 @@ static int init(void) {
     WARNING("cpu plugin: sysctl: %s", STRERRNO);
     return -1;
   }
     WARNING("cpu plugin: sysctl: %s", STRERRNO);
     return -1;
   }
-/* #endif CAN_USE_SYSCTL */
+    /* #endif CAN_USE_SYSCTL */
 
 #elif defined(HAVE_SYSCTLBYNAME)
   size_t numcpu_size;
 
 #elif defined(HAVE_SYSCTLBYNAME)
   size_t numcpu_size;
@@ -307,7 +307,7 @@ static int init(void) {
            "%i)",
            numcpu);
 #endif
            "%i)",
            numcpu);
 #endif
-/* #endif HAVE_SYSCTLBYNAME */
+    /* #endif HAVE_SYSCTLBYNAME */
 
 #elif defined(HAVE_LIBSTATGRAB)
 /* nothing to initialize */
 
 #elif defined(HAVE_LIBSTATGRAB)
 /* nothing to initialize */
@@ -630,7 +630,7 @@ static int cpu_read(void) {
     cpu_stage(cpu, COLLECTD_CPU_STATE_IDLE,
               (derive_t)cpu_info.cpu_ticks[CPU_STATE_IDLE], now);
   }
     cpu_stage(cpu, COLLECTD_CPU_STATE_IDLE,
               (derive_t)cpu_info.cpu_ticks[CPU_STATE_IDLE], now);
   }
-/* }}} #endif PROCESSOR_CPU_LOAD_INFO */
+    /* }}} #endif PROCESSOR_CPU_LOAD_INFO */
 
 #elif defined(KERNEL_LINUX) /* {{{ */
   int cpu;
 
 #elif defined(KERNEL_LINUX) /* {{{ */
   int cpu;
@@ -708,7 +708,7 @@ static int cpu_read(void) {
     cpu_stage(cpu, COLLECTD_CPU_STATE_NICE, (derive_t)nice_value, now);
   }
   fclose(fh);
     cpu_stage(cpu, COLLECTD_CPU_STATE_NICE, (derive_t)nice_value, now);
   }
   fclose(fh);
-/* }}} #endif defined(KERNEL_LINUX) */
+  /* }}} #endif defined(KERNEL_LINUX) */
 
 #elif defined(HAVE_LIBKSTAT) /* {{{ */
   static cpu_stat_t cs;
 
 #elif defined(HAVE_LIBKSTAT) /* {{{ */
   static cpu_stat_t cs;
@@ -729,7 +729,7 @@ static int cpu_read(void) {
     cpu_stage(ksp[cpu]->ks_instance, COLLECTD_CPU_STATE_WAIT,
               (derive_t)cs.cpu_sysinfo.cpu[CPU_WAIT], now);
   }
     cpu_stage(ksp[cpu]->ks_instance, COLLECTD_CPU_STATE_WAIT,
               (derive_t)cs.cpu_sysinfo.cpu[CPU_WAIT], now);
   }
-/* }}} #endif defined(HAVE_LIBKSTAT) */
+    /* }}} #endif defined(HAVE_LIBKSTAT) */
 
 #elif CAN_USE_SYSCTL /* {{{ */
   uint64_t cpuinfo[numcpu][CPUSTATES];
 
 #elif CAN_USE_SYSCTL /* {{{ */
   uint64_t cpuinfo[numcpu][CPUSTATES];
@@ -786,10 +786,10 @@ static int cpu_read(void) {
     cpu_stage(i, COLLECTD_CPU_STATE_INTERRUPT, (derive_t)cpuinfo[i][CP_INTR],
               now);
   }
     cpu_stage(i, COLLECTD_CPU_STATE_INTERRUPT, (derive_t)cpuinfo[i][CP_INTR],
               now);
   }
-/* }}} #endif CAN_USE_SYSCTL */
+    /* }}} #endif CAN_USE_SYSCTL */
 
 #elif defined(HAVE_SYSCTLBYNAME) && defined(HAVE_SYSCTL_KERN_CP_TIMES) /* {{{  \
 
 #elif defined(HAVE_SYSCTLBYNAME) && defined(HAVE_SYSCTL_KERN_CP_TIMES) /* {{{  \
-                                                                          */
+                                                                        */
   long cpuinfo[maxcpu][CPUSTATES];
   size_t cpuinfo_size;
 
   long cpuinfo[maxcpu][CPUSTATES];
   size_t cpuinfo_size;
 
@@ -809,7 +809,7 @@ static int cpu_read(void) {
     cpu_stage(i, COLLECTD_CPU_STATE_INTERRUPT, (derive_t)cpuinfo[i][CP_INTR],
               now);
   }
     cpu_stage(i, COLLECTD_CPU_STATE_INTERRUPT, (derive_t)cpuinfo[i][CP_INTR],
               now);
   }
-/* }}} #endif HAVE_SYSCTL_KERN_CP_TIMES */
+    /* }}} #endif HAVE_SYSCTL_KERN_CP_TIMES */
 
 #elif defined(HAVE_SYSCTLBYNAME) /* {{{ */
   long cpuinfo[CPUSTATES];
 
 #elif defined(HAVE_SYSCTLBYNAME) /* {{{ */
   long cpuinfo[CPUSTATES];
@@ -827,7 +827,7 @@ static int cpu_read(void) {
   cpu_stage(0, COLLECTD_CPU_STATE_SYSTEM, (derive_t)cpuinfo[CP_SYS], now);
   cpu_stage(0, COLLECTD_CPU_STATE_IDLE, (derive_t)cpuinfo[CP_IDLE], now);
   cpu_stage(0, COLLECTD_CPU_STATE_INTERRUPT, (derive_t)cpuinfo[CP_INTR], now);
   cpu_stage(0, COLLECTD_CPU_STATE_SYSTEM, (derive_t)cpuinfo[CP_SYS], now);
   cpu_stage(0, COLLECTD_CPU_STATE_IDLE, (derive_t)cpuinfo[CP_IDLE], now);
   cpu_stage(0, COLLECTD_CPU_STATE_INTERRUPT, (derive_t)cpuinfo[CP_INTR], now);
-/* }}} #endif HAVE_SYSCTLBYNAME */
+  /* }}} #endif HAVE_SYSCTLBYNAME */
 
 #elif defined(HAVE_LIBSTATGRAB) /* {{{ */
   sg_cpu_stats *cs;
 
 #elif defined(HAVE_LIBSTATGRAB) /* {{{ */
   sg_cpu_stats *cs;
@@ -844,7 +844,7 @@ static int cpu_read(void) {
   cpu_state(0, COLLECTD_CPU_STATE_SYSTEM, (derive_t)cs->kernel);
   cpu_state(0, COLLECTD_CPU_STATE_USER, (derive_t)cs->user);
   cpu_state(0, COLLECTD_CPU_STATE_WAIT, (derive_t)cs->iowait);
   cpu_state(0, COLLECTD_CPU_STATE_SYSTEM, (derive_t)cs->kernel);
   cpu_state(0, COLLECTD_CPU_STATE_USER, (derive_t)cs->user);
   cpu_state(0, COLLECTD_CPU_STATE_WAIT, (derive_t)cs->iowait);
-/* }}} #endif HAVE_LIBSTATGRAB */
+  /* }}} #endif HAVE_LIBSTATGRAB */
 
 #elif defined(HAVE_PERFSTAT) /* {{{ */
   perfstat_id_t id;
 
 #elif defined(HAVE_PERFSTAT) /* {{{ */
   perfstat_id_t id;
index b5cbe66..ee26b0b 100644 (file)
@@ -28,7 +28,7 @@
  * CPU sleep is reported in milliseconds of sleep per second of wall
  * time. For that, the time difference between BOOT and MONOTONIC clocks
  * is reported using derive type.
  * CPU sleep is reported in milliseconds of sleep per second of wall
  * time. For that, the time difference between BOOT and MONOTONIC clocks
  * is reported using derive type.
-**/
+ **/
 
 #include "collectd.h"
 
 
 #include "collectd.h"
 
index 38951c0..11e64fa 100644 (file)
@@ -181,7 +181,7 @@ extern PyTypeObject ValuesType;
 
 typedef struct {
   PluginData data;
 
 typedef struct {
   PluginData data;
-  PyObject *meta;   /* dict */
+  PyObject *meta; /* dict */
   int severity;
   char message[NOTIF_MAX_MSG_LEN];
 } Notification;
   int severity;
   char message[NOTIF_MAX_MSG_LEN];
 } Notification;
index e3e3c17..7eb4805 100644 (file)
@@ -541,7 +541,8 @@ static int cc_config_add_page(oconfig_item_t *ci) /* {{{ */
   plugin_register_complex_read(/* group = */ NULL, cb_name, cc_read_page,
                                interval,
                                &(user_data_t){
   plugin_register_complex_read(/* group = */ NULL, cb_name, cc_read_page,
                                interval,
                                &(user_data_t){
-                                   .data = page, .free_func = cc_web_page_free,
+                                   .data = page,
+                                   .free_func = cc_web_page_free,
                                });
   sfree(cb_name);
 
                                });
   sfree(cb_name);
 
index 9d01e6e..edfaf00 100644 (file)
@@ -763,7 +763,8 @@ static int cj_config_add_url(oconfig_item_t *ci) /* {{{ */
 
     plugin_register_complex_read(/* group = */ NULL, cb_name, cj_read, interval,
                                  &(user_data_t){
 
     plugin_register_complex_read(/* group = */ NULL, cb_name, cj_read, interval,
                                  &(user_data_t){
-                                     .data = db, .free_func = cj_free,
+                                     .data = db,
+                                     .free_func = cj_free,
                                  });
     sfree(cb_name);
   } else {
                                  });
     sfree(cb_name);
   } else {
index ce6bd46..4524ac3 100644 (file)
@@ -697,8 +697,8 @@ static int cx_config_add_namespace(cx_t *db, /* {{{ */
     return EINVAL;
   }
 
     return EINVAL;
   }
 
-  cx_namespace_t *ns = realloc(
-      db->namespaces, sizeof(*db->namespaces) * (db->namespaces_num + 1));
+  cx_namespace_t *ns = realloc(db->namespaces, sizeof(*db->namespaces) *
+                                                   (db->namespaces_num + 1));
   if (ns == NULL) {
     ERROR("curl_xml plugin: realloc failed.");
     return ENOMEM;
   if (ns == NULL) {
     ERROR("curl_xml plugin: realloc failed.");
     return ENOMEM;
@@ -925,7 +925,8 @@ static int cx_config_add_url(oconfig_item_t *ci) /* {{{ */
   plugin_register_complex_read(/* group = */ "curl_xml", cb_name, cx_read,
                                /* interval = */ interval,
                                &(user_data_t){
   plugin_register_complex_read(/* group = */ "curl_xml", cb_name, cx_read,
                                /* interval = */ interval,
                                &(user_data_t){
-                                   .data = db, .free_func = cx_free,
+                                   .data = db,
+                                   .free_func = cx_free,
                                });
   sfree(cb_name);
   return 0;
                                });
   sfree(cb_name);
   return 0;
index 49f9272..09aee6a 100644 (file)
@@ -182,7 +182,7 @@ int main(int argc, char **argv) {
 #ifdef KERNEL_LINUX
       && notify_upstart() == 0 && notify_systemd() == 0
 #endif
 #ifdef KERNEL_LINUX
       && notify_upstart() == 0 && notify_systemd() == 0
 #endif
-      ) {
+  ) {
     pid_t pid;
     if ((pid = fork()) == -1) {
       /* error */
     pid_t pid;
     if ((pid = fork()) == -1) {
       /* error */
index ae2d327..78d410c 100644 (file)
@@ -307,11 +307,12 @@ static int do_shutdown(void) {
 static void read_cmdline(int argc, char **argv, struct cmdline_config *config) {
   /* read options */
   while (1) {
 static void read_cmdline(int argc, char **argv, struct cmdline_config *config) {
   /* read options */
   while (1) {
-    int c = getopt(argc, argv, "BhtTC:"
+    int c = getopt(argc, argv,
+                   "BhtTC:"
 #if COLLECT_DAEMON
 #if COLLECT_DAEMON
-                               "fP:"
+                   "fP:"
 #endif
 #endif
-                   );
+    );
 
     if (c == -1)
       break;
 
     if (c == -1)
       break;
@@ -391,7 +392,9 @@ void stop_collectd(void) { loop++; }
 
 struct cmdline_config init_config(int argc, char **argv) {
   struct cmdline_config config = {
 
 struct cmdline_config init_config(int argc, char **argv) {
   struct cmdline_config config = {
-      .daemonize = true, .create_basedir = true, .configfile = CONFIGFILE,
+      .daemonize = true,
+      .create_basedir = true,
+      .configfile = CONFIGFILE,
   };
 
   read_cmdline(argc, argv, &config);
   };
 
   read_cmdline(argc, argv, &config);
index e760fda..1a3c4f4 100644 (file)
@@ -267,7 +267,8 @@ static int dispatch_loadplugin(oconfig_item_t *ci) {
 
   /* default to the global interval set before loading this plugin */
   plugin_ctx_t ctx = {
 
   /* default to the global interval set before loading this plugin */
   plugin_ctx_t ctx = {
-      .interval = cf_get_default_interval(), .name = strdup(name),
+      .interval = cf_get_default_interval(),
+      .name = strdup(name),
   };
   if (ctx.name == NULL)
     return ENOMEM;
   };
   if (ctx.name == NULL)
     return ENOMEM;
@@ -479,9 +480,9 @@ static int cf_ci_replace_child(oconfig_item_t *dst, oconfig_item_t *src,
     return 0;
   }
 
     return 0;
   }
 
-  temp = realloc(dst->children,
-                 sizeof(oconfig_item_t) *
-                     (dst->children_num + src->children_num - 1));
+  temp =
+      realloc(dst->children, sizeof(oconfig_item_t) *
+                                 (dst->children_num + src->children_num - 1));
   if (temp == NULL) {
     ERROR("configfile: realloc failed.");
     return -1;
   if (temp == NULL) {
     ERROR("configfile: realloc failed.");
     return -1;
@@ -520,9 +521,8 @@ static int cf_ci_append_children(oconfig_item_t *dst, oconfig_item_t *src) {
   if ((src == NULL) || (src->children_num == 0))
     return 0;
 
   if ((src == NULL) || (src->children_num == 0))
     return 0;
 
-  temp =
-      realloc(dst->children,
-              sizeof(oconfig_item_t) * (dst->children_num + src->children_num));
+  temp = realloc(dst->children, sizeof(oconfig_item_t) *
+                                    (dst->children_num + src->children_num));
   if (temp == NULL) {
     ERROR("configfile: realloc failed.");
     return -1;
   if (temp == NULL) {
     ERROR("configfile: realloc failed.");
     return -1;
index b4e5ae7..c18b2c4 100644 (file)
@@ -366,7 +366,8 @@ static int create_register_callback(llist_t **list, /* {{{ */
   cf->cf_callback = callback;
   if (ud == NULL) {
     cf->cf_udata = (user_data_t){
   cf->cf_callback = callback;
   if (ud == NULL) {
     cf->cf_udata = (user_data_t){
-        .data = NULL, .free_func = NULL,
+        .data = NULL,
+        .free_func = NULL,
     };
   } else {
     cf->cf_udata = *ud;
     };
   } else {
     cf->cf_udata = *ud;
@@ -1294,8 +1295,10 @@ EXPORT int plugin_register_flush(const char *name, plugin_flush_cb callback,
         /* name      = */ flush_name,
         /* callback  = */ plugin_flush_timeout_callback,
         /* interval  = */ ctx.flush_interval,
         /* name      = */ flush_name,
         /* callback  = */ plugin_flush_timeout_callback,
         /* interval  = */ ctx.flush_interval,
-        /* user data = */ &(user_data_t){
-            .data = cb, .free_func = plugin_flush_timeout_callback_free,
+        /* user data = */
+        &(user_data_t){
+            .data = cb,
+            .free_func = plugin_flush_timeout_callback_free,
         });
 
     sfree(flush_name);
         });
 
     sfree(flush_name);
index c53e5d1..df358d2 100644 (file)
@@ -275,7 +275,8 @@ int uc_check_timeout(void) {
    * plugin calls the cache interface. */
   for (size_t i = 0; i < expired_num; i++) {
     value_list_t vl = {
    * plugin calls the cache interface. */
   for (size_t i = 0; i < expired_num; i++) {
     value_list_t vl = {
-        .time = expired[i].time, .interval = expired[i].interval,
+        .time = expired[i].time,
+        .interval = expired[i].interval,
     };
 
     if (parse_identifier_vl(expired[i].key, &vl) != 0) {
     };
 
     if (parse_identifier_vl(expired[i].key, &vl) != 0) {
index ac9b79d..c02b6ab 100644 (file)
@@ -206,7 +206,7 @@ static int disk_init(void) {
     io_master_port = MACH_PORT_NULL;
     return -1;
   }
     io_master_port = MACH_PORT_NULL;
     return -1;
   }
-/* #endif HAVE_IOKIT_IOKITLIB_H */
+    /* #endif HAVE_IOKIT_IOKITLIB_H */
 
 #elif KERNEL_LINUX
 #if HAVE_LIBUDEV_H
 
 #elif KERNEL_LINUX
 #if HAVE_LIBUDEV_H
@@ -218,7 +218,7 @@ static int disk_init(void) {
     }
   }
 #endif /* HAVE_LIBUDEV_H */
     }
   }
 #endif /* HAVE_LIBUDEV_H */
-/* #endif KERNEL_LINUX */
+    /* #endif KERNEL_LINUX */
 
 #elif KERNEL_FREEBSD
   int rv;
 
 #elif KERNEL_FREEBSD
   int rv;
@@ -233,7 +233,7 @@ static int disk_init(void) {
     ERROR("geom_stats_open() failed, returned %d", rv);
     return -1;
   }
     ERROR("geom_stats_open() failed, returned %d", rv);
     return -1;
   }
-/* #endif KERNEL_FREEBSD */
+    /* #endif KERNEL_FREEBSD */
 
 #elif HAVE_LIBKSTAT
   kstat_t *ksp_chain;
 
 #elif HAVE_LIBKSTAT
   kstat_t *ksp_chain;
@@ -272,7 +272,8 @@ static void disk_submit(const char *plugin_instance, const char *type,
                         derive_t read, derive_t write) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
                         derive_t read, derive_t write) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
-      {.derive = read}, {.derive = write},
+      {.derive = read},
+      {.derive = write},
   };
 
   vl.values = values;
   };
 
   vl.values = values;
@@ -289,7 +290,8 @@ static void submit_io_time(char const *plugin_instance, derive_t io_time,
                            derive_t weighted_time) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
                            derive_t weighted_time) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
-      {.derive = io_time}, {.derive = weighted_time},
+      {.derive = io_time},
+      {.derive = weighted_time},
   };
 
   vl.values = values;
   };
 
   vl.values = values;
@@ -530,7 +532,7 @@ static int disk_read(void) {
       disk_submit(disk_name, "disk_time", read_tme / 1000, write_tme / 1000);
   }
   IOObjectRelease(disk_list);
       disk_submit(disk_name, "disk_time", read_tme / 1000, write_tme / 1000);
   }
   IOObjectRelease(disk_list);
-/* #endif HAVE_IOKIT_IOKITLIB_H */
+  /* #endif HAVE_IOKIT_IOKITLIB_H */
 
 #elif KERNEL_FREEBSD
   int retry, dirty;
 
 #elif KERNEL_FREEBSD
   int retry, dirty;
@@ -894,7 +896,7 @@ static int disk_read(void) {
     free(missing_ds);
   }
   fclose(fh);
     free(missing_ds);
   }
   fclose(fh);
-/* #endif defined(KERNEL_LINUX) */
+  /* #endif defined(KERNEL_LINUX) */
 
 #elif HAVE_LIBKSTAT
 #if HAVE_KSTAT_IO_T_WRITES && HAVE_KSTAT_IO_T_NWRITES && HAVE_KSTAT_IO_T_WTIME
 
 #elif HAVE_LIBKSTAT
 #if HAVE_KSTAT_IO_T_WRITES && HAVE_KSTAT_IO_T_NWRITES && HAVE_KSTAT_IO_T_WTIME
@@ -942,7 +944,7 @@ static int disk_read(void) {
       disk_submit(ksp[i]->ks_name, "disk_ops", kio.KIO_ROPS, kio.KIO_WOPS);
     }
   }
       disk_submit(ksp[i]->ks_name, "disk_ops", kio.KIO_ROPS, kio.KIO_WOPS);
     }
   }
-/* #endif defined(HAVE_LIBKSTAT) */
+    /* #endif defined(HAVE_LIBKSTAT) */
 
 #elif defined(HAVE_LIBSTATGRAB)
   sg_disk_io_stats *ds;
 
 #elif defined(HAVE_LIBSTATGRAB)
   sg_disk_io_stats *ds;
@@ -969,7 +971,7 @@ static int disk_read(void) {
     disk_submit(name, "disk_octets", ds->read_bytes, ds->write_bytes);
     ds++;
   }
     disk_submit(name, "disk_octets", ds->read_bytes, ds->write_bytes);
     ds++;
   }
-/* #endif defined(HAVE_LIBSTATGRAB) */
+    /* #endif defined(HAVE_LIBSTATGRAB) */
 
 #elif defined(HAVE_PERFSTAT)
   derive_t read_sectors;
 
 #elif defined(HAVE_PERFSTAT)
   derive_t read_sectors;
index 7fa297b..dad0be2 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -324,7 +324,8 @@ static void submit_derive(const char *type, const char *type_instance,
 
 static void submit_octets(derive_t queries, derive_t responses) {
   value_t values[] = {
 
 static void submit_octets(derive_t queries, derive_t responses) {
   value_t values[] = {
-      {.derive = queries}, {.derive = responses},
+      {.derive = queries},
+      {.derive = responses},
   };
   value_list_t vl = VALUE_LIST_INIT;
 
   };
   value_list_t vl = VALUE_LIST_INIT;
 
index deb6600..5360205 100644 (file)
@@ -174,16 +174,18 @@ static int email_config(const char *key, const char *value) {
     long int tmp = strtol(value, NULL, 0);
 
     if (tmp < 1) {
     long int tmp = strtol(value, NULL, 0);
 
     if (tmp < 1) {
-      fprintf(stderr, "email plugin: `MaxConns' was set to invalid "
-                      "value %li, will use default %i.\n",
+      fprintf(stderr,
+              "email plugin: `MaxConns' was set to invalid "
+              "value %li, will use default %i.\n",
               tmp, MAX_CONNS);
       ERROR("email plugin: `MaxConns' was set to invalid "
             "value %li, will use default %i.\n",
             tmp, MAX_CONNS);
       max_conns = MAX_CONNS;
     } else if (tmp > MAX_CONNS_LIMIT) {
               tmp, MAX_CONNS);
       ERROR("email plugin: `MaxConns' was set to invalid "
             "value %li, will use default %i.\n",
             tmp, MAX_CONNS);
       max_conns = MAX_CONNS;
     } else if (tmp > MAX_CONNS_LIMIT) {
-      fprintf(stderr, "email plugin: `MaxConns' was set to invalid "
-                      "value %li, will use hardcoded limit %i.\n",
+      fprintf(stderr,
+              "email plugin: `MaxConns' was set to invalid "
+              "value %li, will use hardcoded limit %i.\n",
               tmp, MAX_CONNS_LIMIT);
       ERROR("email plugin: `MaxConns' was set to invalid "
             "value %li, will use hardcoded limit %i.\n",
               tmp, MAX_CONNS_LIMIT);
       ERROR("email plugin: `MaxConns' was set to invalid "
             "value %li, will use hardcoded limit %i.\n",
index 7e16167..9574f2c 100644 (file)
@@ -754,8 +754,9 @@ static void *exec_notification_one(void *arg) /* {{{ */
   else if (n->severity == NOTIF_OKAY)
     severity = "OKAY";
 
   else if (n->severity == NOTIF_OKAY)
     severity = "OKAY";
 
-  fprintf(fh, "Severity: %s\n"
-              "Time: %.3f\n",
+  fprintf(fh,
+          "Severity: %s\n"
+          "Time: %.3f\n",
           severity, CDTIME_T_TO_DOUBLE(n->time));
 
   /* Print the optional fields */
           severity, CDTIME_T_TO_DOUBLE(n->time));
 
   /* Print the optional fields */
index d76e503..f176795 100644 (file)
@@ -54,7 +54,8 @@ static char *nv_errline = "";
 #define KEY_IGNORESELECTED "IgnoreSelected"
 
 static const char *config_keys[] = {
 #define KEY_IGNORESELECTED "IgnoreSelected"
 
 static const char *config_keys[] = {
-    KEY_GPUINDEX, KEY_IGNORESELECTED,
+    KEY_GPUINDEX,
+    KEY_IGNORESELECTED,
 };
 static const unsigned int n_config_keys = STATIC_ARRAY_SIZE(config_keys);
 
 };
 static const unsigned int n_config_keys = STATIC_ARRAY_SIZE(config_keys);
 
index af5672b..fee8384 100644 (file)
@@ -122,7 +122,8 @@ DEF_TEST(rdt_config_ngroups__one_process) {
       {.value.string = "proc1", .type = OCONFIG_TYPE_STRING},
   };
   oconfig_item_t config_item = {
       {.value.string = "proc1", .type = OCONFIG_TYPE_STRING},
   };
   oconfig_item_t config_item = {
-      .values = values, .values_num = STATIC_ARRAY_SIZE(values),
+      .values = values,
+      .values_num = STATIC_ARRAY_SIZE(values),
   };
 
   /* check */
   };
 
   /* check */
@@ -147,7 +148,8 @@ DEF_TEST(rdt_config_ngroups__two_groups) {
       {.value.string = "proc21,proc22,proc23", .type = OCONFIG_TYPE_STRING},
   };
   oconfig_item_t config_item = {
       {.value.string = "proc21,proc22,proc23", .type = OCONFIG_TYPE_STRING},
   };
   oconfig_item_t config_item = {
-      .values = values, .values_num = STATIC_ARRAY_SIZE(values),
+      .values = values,
+      .values_num = STATIC_ARRAY_SIZE(values),
   };
 
   /* check */
   };
 
   /* check */
@@ -178,7 +180,8 @@ DEF_TEST(rdt_config_ngroups__too_long_proc_name) {
       {.value.string = "_seventeen_chars_", .type = OCONFIG_TYPE_STRING},
   };
   oconfig_item_t config_item = {
       {.value.string = "_seventeen_chars_", .type = OCONFIG_TYPE_STRING},
   };
   oconfig_item_t config_item = {
-      .values = values, .values_num = STATIC_ARRAY_SIZE(values),
+      .values = values,
+      .values_num = STATIC_ARRAY_SIZE(values),
   };
 
   /* check */
   };
 
   /* check */
@@ -200,7 +203,8 @@ DEF_TEST(rdt_config_ngroups__duplicate_proc_name_between_groups) {
       {.value.string = "proc21,proc,proc23", .type = OCONFIG_TYPE_STRING},
   };
   oconfig_item_t config_item = {
       {.value.string = "proc21,proc,proc23", .type = OCONFIG_TYPE_STRING},
   };
   oconfig_item_t config_item = {
-      .values = values, .values_num = STATIC_ARRAY_SIZE(values),
+      .values = values,
+      .values_num = STATIC_ARRAY_SIZE(values),
   };
 
   /* check */
   };
 
   /* check */
@@ -221,7 +225,8 @@ DEF_TEST(rdt_config_ngroups__duplicate_proc_name_in_group) {
       {.value.string = "proc11,proc,proc,proc14", .type = OCONFIG_TYPE_STRING},
   };
   oconfig_item_t config_item = {
       {.value.string = "proc11,proc,proc,proc14", .type = OCONFIG_TYPE_STRING},
   };
   oconfig_item_t config_item = {
-      .values = values, .values_num = STATIC_ARRAY_SIZE(values),
+      .values = values,
+      .values_num = STATIC_ARRAY_SIZE(values),
   };
 
   /* check */
   };
 
   /* check */
@@ -244,7 +249,8 @@ DEF_TEST(rdt_config_ngroups__empty_group) {
 
   };
   oconfig_item_t config_item = {
 
   };
   oconfig_item_t config_item = {
-      .values = values, .values_num = STATIC_ARRAY_SIZE(values),
+      .values = values,
+      .values_num = STATIC_ARRAY_SIZE(values),
   };
 
   /* check */
   };
 
   /* check */
@@ -265,7 +271,8 @@ DEF_TEST(rdt_config_ngroups__empty_proc_name) {
       {.value.string = "proc11,,proc13", .type = OCONFIG_TYPE_STRING},
   };
   oconfig_item_t config_item = {
       {.value.string = "proc11,,proc13", .type = OCONFIG_TYPE_STRING},
   };
   oconfig_item_t config_item = {
-      .values = values, .values_num = STATIC_ARRAY_SIZE(values),
+      .values = values,
+      .values_num = STATIC_ARRAY_SIZE(values),
   };
 
   /* check */
   };
 
   /* check */
index 5367ced..b0d9eeb 100644 (file)
@@ -82,7 +82,9 @@ static int pnif;
  * (Module-)Global variables
  */
 static const char *config_keys[] = {
  * (Module-)Global variables
  */
 static const char *config_keys[] = {
-    "Interface", "IgnoreSelected", "ReportInactive",
+    "Interface",
+    "IgnoreSelected",
+    "ReportInactive",
 };
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
 };
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
@@ -160,7 +162,8 @@ static void if_submit(const char *dev, const char *type, derive_t rx,
                       derive_t tx) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
                       derive_t tx) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
-      {.derive = rx}, {.derive = tx},
+      {.derive = rx},
+      {.derive = tx},
   };
 
   if (ignorelist_match(ignorelist, dev) != 0)
   };
 
   if (ignorelist_match(ignorelist, dev) != 0)
@@ -188,7 +191,7 @@ static int interface_read(void) {
 #define IFA_TX_PACKT ifi_opackets
 #define IFA_RX_ERROR ifi_ierrors
 #define IFA_TX_ERROR ifi_oerrors
 #define IFA_TX_PACKT ifi_opackets
 #define IFA_RX_ERROR ifi_ierrors
 #define IFA_TX_ERROR ifi_oerrors
-/* #endif HAVE_STRUCT_IF_DATA */
+  /* #endif HAVE_STRUCT_IF_DATA */
 
 #elif HAVE_STRUCT_NET_DEVICE_STATS
 #define IFA_DATA net_device_stats
 
 #elif HAVE_STRUCT_NET_DEVICE_STATS
 #define IFA_DATA net_device_stats
@@ -226,7 +229,7 @@ static int interface_read(void) {
   }
 
   freeifaddrs(if_list);
   }
 
   freeifaddrs(if_list);
-/* #endif HAVE_GETIFADDRS */
+  /* #endif HAVE_GETIFADDRS */
 
 #elif KERNEL_LINUX
   FILE *fh;
 
 #elif KERNEL_LINUX
   FILE *fh;
@@ -282,7 +285,7 @@ static int interface_read(void) {
   }
 
   fclose(fh);
   }
 
   fclose(fh);
-/* #endif KERNEL_LINUX */
+  /* #endif KERNEL_LINUX */
 
 #elif HAVE_LIBKSTAT
   derive_t rx;
 
 #elif HAVE_LIBKSTAT
   derive_t rx;
@@ -332,7 +335,7 @@ static int interface_read(void) {
     if ((rx != -1LL) || (tx != -1LL))
       if_submit(iname, "if_errors", rx, tx);
   }
     if ((rx != -1LL) || (tx != -1LL))
       if_submit(iname, "if_errors", rx, tx);
   }
-/* #endif HAVE_LIBKSTAT */
+    /* #endif HAVE_LIBKSTAT */
 
 #elif defined(HAVE_LIBSTATGRAB)
   sg_network_io_stats *ios;
 
 #elif defined(HAVE_LIBSTATGRAB)
   sg_network_io_stats *ios;
@@ -345,7 +348,7 @@ static int interface_read(void) {
       continue;
     if_submit(ios[i].interface_name, "if_octets", ios[i].rx, ios[i].tx);
   }
       continue;
     if_submit(ios[i].interface_name, "if_octets", ios[i].rx, ios[i].tx);
   }
-/* #endif HAVE_LIBSTATGRAB */
+    /* #endif HAVE_LIBSTATGRAB */
 
 #elif defined(HAVE_PERFSTAT)
   perfstat_id_t id;
 
 #elif defined(HAVE_PERFSTAT)
   perfstat_id_t id;
index ab4b214..93eddaf 100644 (file)
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -173,8 +173,8 @@ static int ipc_init(void) /* {{{ */
   pagesize_g = sysconf(_SC_PAGESIZE);
   return 0;
 }
   pagesize_g = sysconf(_SC_PAGESIZE);
   return 0;
 }
-/* }}} */
-/* #endif KERNEL_LINUX */
+  /* }}} */
+  /* #endif KERNEL_LINUX */
 
 #elif KERNEL_AIX
 static caddr_t ipc_get_info(cid_t cid, int cmd, int version, int stsize,
 
 #elif KERNEL_AIX
 static caddr_t ipc_get_info(cid_t cid, int cmd, int version, int stsize,
index 0259df8..0dcc8b3 100644 (file)
@@ -207,7 +207,8 @@ static void cipvs_submit_connections(const char *pi, const char *ti,
 static void cipvs_submit_if(const char *pi, const char *t, const char *ti,
                             derive_t rx, derive_t tx) {
   value_t values[] = {
 static void cipvs_submit_if(const char *pi, const char *t, const char *ti,
                             derive_t rx, derive_t tx) {
   value_t values[] = {
-      {.derive = rx}, {.derive = tx},
+      {.derive = rx},
+      {.derive = tx},
   };
   value_list_t vl = VALUE_LIST_INIT;
 
   };
   value_list_t vl = VALUE_LIST_INIT;
 
index cf301c6..41f4909 100644 (file)
@@ -1306,7 +1306,8 @@ static jint JNICALL cjni_api_register_read(JNIEnv *jvm_env, /* {{{ */
       /* group = */ NULL, cbi->name, cjni_read,
       /* interval = */ 0,
       &(user_data_t){
       /* group = */ NULL, cbi->name, cjni_read,
       /* interval = */ 0,
       &(user_data_t){
-          .data = cbi, .free_func = cjni_callback_info_destroy,
+          .data = cbi,
+          .free_func = cjni_callback_info_destroy,
       });
 
   (*jvm_env)->DeleteLocalRef(jvm_env, o_read);
       });
 
   (*jvm_env)->DeleteLocalRef(jvm_env, o_read);
@@ -1325,11 +1326,11 @@ static jint JNICALL cjni_api_register_write(JNIEnv *jvm_env, /* {{{ */
 
   DEBUG("java plugin: Registering new write callback: %s", cbi->name);
 
 
   DEBUG("java plugin: Registering new write callback: %s", cbi->name);
 
-  plugin_register_write(
-      cbi->name, cjni_write,
-      &(user_data_t){
-          .data = cbi, .free_func = cjni_callback_info_destroy,
-      });
+  plugin_register_write(cbi->name, cjni_write,
+                        &(user_data_t){
+                            .data = cbi,
+                            .free_func = cjni_callback_info_destroy,
+                        });
 
   (*jvm_env)->DeleteLocalRef(jvm_env, o_write);
 
 
   (*jvm_env)->DeleteLocalRef(jvm_env, o_write);
 
@@ -1347,11 +1348,11 @@ static jint JNICALL cjni_api_register_flush(JNIEnv *jvm_env, /* {{{ */
 
   DEBUG("java plugin: Registering new flush callback: %s", cbi->name);
 
 
   DEBUG("java plugin: Registering new flush callback: %s", cbi->name);
 
-  plugin_register_flush(
-      cbi->name, cjni_flush,
-      &(user_data_t){
-          .data = cbi, .free_func = cjni_callback_info_destroy,
-      });
+  plugin_register_flush(cbi->name, cjni_flush,
+                        &(user_data_t){
+                            .data = cbi,
+                            .free_func = cjni_callback_info_destroy,
+                        });
 
   (*jvm_env)->DeleteLocalRef(jvm_env, o_flush);
 
 
   (*jvm_env)->DeleteLocalRef(jvm_env, o_flush);
 
@@ -1377,7 +1378,8 @@ static jint JNICALL cjni_api_register_log(JNIEnv *jvm_env, /* {{{ */
 
   plugin_register_log(cbi->name, cjni_log,
                       &(user_data_t){
 
   plugin_register_log(cbi->name, cjni_log,
                       &(user_data_t){
-                          .data = cbi, .free_func = cjni_callback_info_destroy,
+                          .data = cbi,
+                          .free_func = cjni_callback_info_destroy,
                       });
 
   (*jvm_env)->DeleteLocalRef(jvm_env, o_log);
                       });
 
   (*jvm_env)->DeleteLocalRef(jvm_env, o_log);
@@ -1397,11 +1399,11 @@ static jint JNICALL cjni_api_register_notification(JNIEnv *jvm_env, /* {{{ */
 
   DEBUG("java plugin: Registering new notification callback: %s", cbi->name);
 
 
   DEBUG("java plugin: Registering new notification callback: %s", cbi->name);
 
-  plugin_register_notification(
-      cbi->name, cjni_notification,
-      &(user_data_t){
-          .data = cbi, .free_func = cjni_callback_info_destroy,
-      });
+  plugin_register_notification(cbi->name, cjni_notification,
+                               &(user_data_t){
+                                   .data = cbi,
+                                   .free_func = cjni_callback_info_destroy,
+                               });
 
   (*jvm_env)->DeleteLocalRef(jvm_env, o_notification);
 
 
   (*jvm_env)->DeleteLocalRef(jvm_env, o_notification);
 
@@ -1543,16 +1545,19 @@ static JNINativeMethod jni_api_functions[] = /* {{{ */
          "(Ljava/lang/String;Lorg/collectd/api/CollectdLogInterface;)I",
          cjni_api_register_log},
 
          "(Ljava/lang/String;Lorg/collectd/api/CollectdLogInterface;)I",
          cjni_api_register_log},
 
-        {"registerNotification", "(Ljava/lang/String;Lorg/collectd/api/"
-                                 "CollectdNotificationInterface;)I",
+        {"registerNotification",
+         "(Ljava/lang/String;Lorg/collectd/api/"
+         "CollectdNotificationInterface;)I",
          cjni_api_register_notification},
 
          cjni_api_register_notification},
 
-        {"registerMatch", "(Ljava/lang/String;Lorg/collectd/api/"
-                          "CollectdMatchFactoryInterface;)I",
+        {"registerMatch",
+         "(Ljava/lang/String;Lorg/collectd/api/"
+         "CollectdMatchFactoryInterface;)I",
          cjni_api_register_match},
 
          cjni_api_register_match},
 
-        {"registerTarget", "(Ljava/lang/String;Lorg/collectd/api/"
-                           "CollectdTargetFactoryInterface;)I",
+        {"registerTarget",
+         "(Ljava/lang/String;Lorg/collectd/api/"
+         "CollectdTargetFactoryInterface;)I",
          cjni_api_register_target},
 
         {"log", "(ILjava/lang/String;)V", cjni_api_log},
          cjni_api_register_target},
 
         {"log", "(ILjava/lang/String;)V", cjni_api_log},
index 69f9764..a8bbe2f 100644 (file)
@@ -147,7 +147,7 @@ static char *sstrerror(int errnum, char *buf, size_t buflen) {
 
 #if !HAVE_STRERROR_R
   snprintf(buf, buflen, "Error #%i; strerror_r is not available.", errnum);
 
 #if !HAVE_STRERROR_R
   snprintf(buf, buflen, "Error #%i; strerror_r is not available.", errnum);
-/* #endif !HAVE_STRERROR_R */
+  /* #endif !HAVE_STRERROR_R */
 
 #elif STRERROR_R_CHAR_P
   {
 
 #elif STRERROR_R_CHAR_P
   {
@@ -157,17 +157,19 @@ static char *sstrerror(int errnum, char *buf, size_t buflen) {
       if ((temp != NULL) && (temp != buf) && (temp[0] != 0))
         strncpy(buf, temp, buflen);
       else
       if ((temp != NULL) && (temp != buf) && (temp[0] != 0))
         strncpy(buf, temp, buflen);
       else
-        strncpy(buf, "strerror_r did not return "
-                     "an error message",
+        strncpy(buf,
+                "strerror_r did not return "
+                "an error message",
                 buflen);
     }
   }
                 buflen);
     }
   }
-/* #endif STRERROR_R_CHAR_P */
+    /* #endif STRERROR_R_CHAR_P */
 
 #else
   if (strerror_r(errnum, buf, buflen) != 0) {
 
 #else
   if (strerror_r(errnum, buf, buflen) != 0) {
-    snprintf(buf, buflen, "Error #%i; "
-                          "Additionally, strerror_r failed.",
+    snprintf(buf, buflen,
+             "Error #%i; "
+             "Additionally, strerror_r failed.",
              errnum);
   }
 #endif /* STRERROR_R_CHAR_P */
              errnum);
   }
 #endif /* STRERROR_R_CHAR_P */
index 4c610bb..73ef024 100644 (file)
@@ -293,7 +293,8 @@ static double ntohd(double val) /* {{{ */
 static int parse_values(void *payload, size_t payload_size,
                         lcc_value_list_t *state) {
   buffer_t *b = &(buffer_t){
 static int parse_values(void *payload, size_t payload_size,
                         lcc_value_list_t *state) {
   buffer_t *b = &(buffer_t){
-      .data = payload, .len = payload_size,
+      .data = payload,
+      .len = payload_size,
   };
 
   uint16_t n;
   };
 
   uint16_t n;
@@ -401,7 +402,8 @@ static int parse_sign_sha256(void *signature, size_t signature_len,
   }
 
   buffer_t *b = &(buffer_t){
   }
 
   buffer_t *b = &(buffer_t){
-      .data = signature, .len = signature_len,
+      .data = signature,
+      .len = signature_len,
   };
 
   uint8_t hash[32];
   };
 
   uint8_t hash[32];
@@ -459,7 +461,8 @@ static int parse_encrypt_aes256(void *data, size_t data_size,
   }
 
   buffer_t *b = &(buffer_t){
   }
 
   buffer_t *b = &(buffer_t){
-      .data = data, .len = data_size,
+      .data = data,
+      .len = data_size,
   };
 
   uint16_t username_len;
   };
 
   uint16_t username_len;
@@ -508,7 +511,8 @@ static int parse_encrypt_aes256(void *data, size_t data_size,
 static int network_parse(void *data, size_t data_size, lcc_security_level_t sl,
                          lcc_network_parse_options_t const *opts) {
   buffer_t *b = &(buffer_t){
 static int network_parse(void *data, size_t data_size, lcc_security_level_t sl,
                          lcc_network_parse_options_t const *opts) {
   buffer_t *b = &(buffer_t){
-      .data = data, .len = data_size,
+      .data = data,
+      .len = data_size,
   };
 
   lcc_value_list_t state = {0};
   };
 
   lcc_value_list_t state = {0};
index a638642..519a2c5 100644 (file)
@@ -245,16 +245,17 @@ static int test_network_parse() {
     uint8_t buffer[LCC_NETWORK_BUFFER_SIZE_DEFAULT];
     size_t buffer_size = sizeof(buffer);
     if (decode_string(raw_packet_data[i], buffer, &buffer_size)) {
     uint8_t buffer[LCC_NETWORK_BUFFER_SIZE_DEFAULT];
     size_t buffer_size = sizeof(buffer);
     if (decode_string(raw_packet_data[i], buffer, &buffer_size)) {
-      fprintf(stderr, "lcc_network_parse(raw_packet_data[%" PRIsz "]):"
-                      " decoding string failed\n",
+      fprintf(stderr,
+              "lcc_network_parse(raw_packet_data[%" PRIsz "]):"
+              " decoding string failed\n",
               i);
       return -1;
     }
 
               i);
       return -1;
     }
 
-    int status =
-        lcc_network_parse(buffer, buffer_size, (lcc_network_parse_options_t){
-                                                   .writer = nop_writer,
-                                               });
+    int status = lcc_network_parse(buffer, buffer_size,
+                                   (lcc_network_parse_options_t){
+                                       .writer = nop_writer,
+                                   });
     if (status != 0) {
       fprintf(stderr,
               "lcc_network_parse(raw_packet_data[%" PRIsz "]) = %d, want 0\n",
     if (status != 0) {
       fprintf(stderr,
               "lcc_network_parse(raw_packet_data[%" PRIsz "]) = %d, want 0\n",
@@ -466,7 +467,8 @@ static int test_decrypt_aes256() {
 
   int status = decrypt_aes256(
       &(buffer_t){
 
   int status = decrypt_aes256(
       &(buffer_t){
-          .data = ciphertext, .len = ciphertext_len,
+          .data = ciphertext,
+          .len = ciphertext_len,
       },
       iv, iv_len, "admin");
   if (status != 0) {
       },
       iv, iv_len, "admin");
   if (status != 0) {
index 25b81ab..68edce8 100644 (file)
@@ -1,17 +1,15 @@
 #ifndef AUX_TYPES_H
 #define AUX_TYPES_H 1
 
 #ifndef AUX_TYPES_H
 #define AUX_TYPES_H 1
 
-struct statement_list_s
-{
-       oconfig_item_t *statement;
-       int             statement_num;
+struct statement_list_s {
+  oconfig_item_t *statement;
+  int statement_num;
 };
 typedef struct statement_list_s statement_list_t;
 
 };
 typedef struct statement_list_s statement_list_t;
 
-struct argument_list_s
-{
-       oconfig_value_t *argument;
-       int              argument_num;
+struct argument_list_s {
+  oconfig_value_t *argument;
+  int argument_num;
 };
 typedef struct argument_list_s argument_list_t;
 
 };
 typedef struct argument_list_s argument_list_t;
 
index 9a43fc7..3f48a55 100644 (file)
--- a/src/lua.c
+++ b/src/lua.c
@@ -322,14 +322,14 @@ static int lua_cb_register_generic(lua_State *L, int type) /* {{{ */
   pthread_mutex_init(&cb->lock, NULL);
 
   if (PLUGIN_READ == type) {
   pthread_mutex_init(&cb->lock, NULL);
 
   if (PLUGIN_READ == type) {
-    int status =
-        plugin_register_complex_read(/* group = */ "lua",
-                                     /* name      = */ function_name,
-                                     /* callback  = */ clua_read,
-                                     /* interval  = */ 0,
-                                     &(user_data_t){
-                                         .data = cb, .free_func = lua_cb_free,
-                                     });
+    int status = plugin_register_complex_read(/* group = */ "lua",
+                                              /* name      = */ function_name,
+                                              /* callback  = */ clua_read,
+                                              /* interval  = */ 0,
+                                              &(user_data_t){
+                                                  .data = cb,
+                                                  .free_func = lua_cb_free,
+                                              });
 
     if (status != 0)
       return luaL_error(L, "%s", "plugin_register_complex_read failed");
 
     if (status != 0)
       return luaL_error(L, "%s", "plugin_register_complex_read failed");
@@ -338,7 +338,8 @@ static int lua_cb_register_generic(lua_State *L, int type) /* {{{ */
     int status = plugin_register_write(/* name = */ function_name,
                                        /* callback  = */ clua_write,
                                        &(user_data_t){
     int status = plugin_register_write(/* name = */ function_name,
                                        /* callback  = */ clua_write,
                                        &(user_data_t){
-                                           .data = cb, .free_func = lua_cb_free,
+                                           .data = cb,
+                                           .free_func = lua_cb_free,
                                        });
 
     if (status != 0)
                                        });
 
     if (status != 0)
index 85454c3..723f992 100644 (file)
@@ -534,7 +534,8 @@ static void submit_derive(const char *dev, const char *type, const char *ti1,
 static void submit_derive2(const char *dev, const char *type, const char *ti1,
                            const char *ti2, derive_t val1, derive_t val2) {
   value_t values[] = {
 static void submit_derive2(const char *dev, const char *type, const char *ti1,
                            const char *ti2, derive_t val1, derive_t val2) {
   value_t values[] = {
-      {.derive = val1}, {.derive = val2},
+      {.derive = val1},
+      {.derive = val2},
   };
 
   submit(dev, type, ti1, ti2, values, STATIC_ARRAY_SIZE(values));
   };
 
   submit(dev, type, ti1, ti2, values, STATIC_ARRAY_SIZE(values));
index d6a5e35..3a7c7f0 100644 (file)
 #ifndef MADWIFI_H
 #define MADWIFI_H
 
 #ifndef MADWIFI_H
 #define MADWIFI_H
 
-#define        IEEE80211_ADDR_LEN              6               /* size of 802.11 address */
-#define        IEEE80211_RATE_VAL              0x7f
-#define        IEEE80211_RATE_SIZE             8               /* 802.11 standard */
-#define        IEEE80211_RATE_MAXSIZE          15              /* max rates we'll handle */
-
+#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
+#define IEEE80211_RATE_VAL 0x7f
+#define IEEE80211_RATE_SIZE 8     /* 802.11 standard */
+#define IEEE80211_RATE_MAXSIZE 15 /* max rates we'll handle */
 
 /*
  * Per/node (station) statistics available when operating as an AP.
  */
 struct ieee80211_nodestats {
 
 /*
  * Per/node (station) statistics available when operating as an AP.
  */
 struct ieee80211_nodestats {
-       u_int32_t ns_rx_data;           /* rx data frames */
-       u_int32_t ns_rx_mgmt;           /* rx management frames */
-       u_int32_t ns_rx_ctrl;           /* rx control frames */
-       u_int32_t ns_rx_ucast;          /* rx unicast frames */
-       u_int32_t ns_rx_mcast;          /* rx multi/broadcast frames */
-       u_int64_t ns_rx_bytes;          /* rx data count (bytes) */
-       u_int64_t ns_rx_beacons;        /* rx beacon frames */
-       u_int32_t ns_rx_proberesp;      /* rx probe response frames */
+  u_int32_t ns_rx_data;      /* rx data frames */
+  u_int32_t ns_rx_mgmt;      /* rx management frames */
+  u_int32_t ns_rx_ctrl;      /* rx control frames */
+  u_int32_t ns_rx_ucast;     /* rx unicast frames */
+  u_int32_t ns_rx_mcast;     /* rx multi/broadcast frames */
+  u_int64_t ns_rx_bytes;     /* rx data count (bytes) */
+  u_int64_t ns_rx_beacons;   /* rx beacon frames */
+  u_int32_t ns_rx_proberesp; /* rx probe response frames */
 
 
-       u_int32_t ns_rx_dup;            /* rx discard because it's a dup */
-       u_int32_t ns_rx_noprivacy;      /* rx w/ wep but privacy off */
-       u_int32_t ns_rx_wepfail;        /* rx wep processing failed */
-       u_int32_t ns_rx_demicfail;      /* rx demic failed */
-       u_int32_t ns_rx_decap;          /* rx decapsulation failed */
-       u_int32_t ns_rx_defrag;         /* rx defragmentation failed */
-       u_int32_t ns_rx_disassoc;       /* rx disassociation */
-       u_int32_t ns_rx_deauth;         /* rx deauthentication */
-       u_int32_t ns_rx_decryptcrc;     /* rx decrypt failed on crc */
-       u_int32_t ns_rx_unauth;         /* rx on unauthorized port */
-       u_int32_t ns_rx_unencrypted;    /* rx unecrypted w/ privacy */
+  u_int32_t ns_rx_dup;         /* rx discard because it's a dup */
+  u_int32_t ns_rx_noprivacy;   /* rx w/ wep but privacy off */
+  u_int32_t ns_rx_wepfail;     /* rx wep processing failed */
+  u_int32_t ns_rx_demicfail;   /* rx demic failed */
+  u_int32_t ns_rx_decap;       /* rx decapsulation failed */
+  u_int32_t ns_rx_defrag;      /* rx defragmentation failed */
+  u_int32_t ns_rx_disassoc;    /* rx disassociation */
+  u_int32_t ns_rx_deauth;      /* rx deauthentication */
+  u_int32_t ns_rx_decryptcrc;  /* rx decrypt failed on crc */
+  u_int32_t ns_rx_unauth;      /* rx on unauthorized port */
+  u_int32_t ns_rx_unencrypted; /* rx unecrypted w/ privacy */
 
 
-       u_int32_t ns_tx_data;           /* tx data frames */
-       u_int32_t ns_tx_mgmt;           /* tx management frames */
-       u_int32_t ns_tx_ucast;          /* tx unicast frames */
-       u_int32_t ns_tx_mcast;          /* tx multi/broadcast frames */
-       u_int64_t ns_tx_bytes;          /* tx data count (bytes) */
-       u_int32_t ns_tx_probereq;       /* tx probe request frames */
-       u_int32_t ns_tx_uapsd;          /* tx on uapsd queue */
+  u_int32_t ns_tx_data;     /* tx data frames */
+  u_int32_t ns_tx_mgmt;     /* tx management frames */
+  u_int32_t ns_tx_ucast;    /* tx unicast frames */
+  u_int32_t ns_tx_mcast;    /* tx multi/broadcast frames */
+  u_int64_t ns_tx_bytes;    /* tx data count (bytes) */
+  u_int32_t ns_tx_probereq; /* tx probe request frames */
+  u_int32_t ns_tx_uapsd;    /* tx on uapsd queue */
 
 
-       u_int32_t ns_tx_novlantag;      /* tx discard due to no tag */
-       u_int32_t ns_tx_vlanmismatch;   /* tx discard due to of bad tag */
+  u_int32_t ns_tx_novlantag;    /* tx discard due to no tag */
+  u_int32_t ns_tx_vlanmismatch; /* tx discard due to of bad tag */
 
 
-       u_int32_t ns_tx_eosplost;       /* uapsd EOSP retried out */
+  u_int32_t ns_tx_eosplost; /* uapsd EOSP retried out */
 
 
-       u_int32_t ns_ps_discard;        /* ps discard due to of age */
+  u_int32_t ns_ps_discard; /* ps discard due to of age */
 
 
-       u_int32_t ns_uapsd_triggers;    /* uapsd triggers */
+  u_int32_t ns_uapsd_triggers; /* uapsd triggers */
 
 
-       /* MIB-related state */
-       u_int32_t ns_tx_assoc;          /* [re]associations */
-       u_int32_t ns_tx_assoc_fail;     /* [re]association failures */
-       u_int32_t ns_tx_auth;           /* [re]authentications */
-       u_int32_t ns_tx_auth_fail;      /* [re]authentication failures*/
-       u_int32_t ns_tx_deauth;         /* deauthentications */
-       u_int32_t ns_tx_deauth_code;    /* last deauth reason */
-       u_int32_t ns_tx_disassoc;       /* disassociations */
-       u_int32_t ns_tx_disassoc_code;  /* last disassociation reason */
-       u_int32_t ns_psq_drops;         /* power save queue drops */
+  /* MIB-related state */
+  u_int32_t ns_tx_assoc;         /* [re]associations */
+  u_int32_t ns_tx_assoc_fail;    /* [re]association failures */
+  u_int32_t ns_tx_auth;          /* [re]authentications */
+  u_int32_t ns_tx_auth_fail;     /* [re]authentication failures*/
+  u_int32_t ns_tx_deauth;        /* deauthentications */
+  u_int32_t ns_tx_deauth_code;   /* last deauth reason */
+  u_int32_t ns_tx_disassoc;      /* disassociations */
+  u_int32_t ns_tx_disassoc_code; /* last disassociation reason */
+  u_int32_t ns_psq_drops;        /* power save queue drops */
 };
 
 /*
  * Summary statistics.
  */
 struct ieee80211_stats {
 };
 
 /*
  * Summary statistics.
  */
 struct ieee80211_stats {
-       u_int32_t is_rx_badversion;     /* rx frame with bad version */
-       u_int32_t is_rx_tooshort;       /* rx frame too short */
-       u_int32_t is_rx_wrongbss;       /* rx from wrong bssid */
-       u_int32_t is_rx_dup;            /* rx discard due to it's a dup */
-       u_int32_t is_rx_wrongdir;       /* rx w/ wrong direction */
-       u_int32_t is_rx_mcastecho;      /* rx discard due to of mcast echo */
-       u_int32_t is_rx_notassoc;       /* rx discard due to sta !assoc */
-       u_int32_t is_rx_noprivacy;      /* rx w/ wep but privacy off */
-       u_int32_t is_rx_unencrypted;    /* rx w/o wep and privacy on */
-       u_int32_t is_rx_wepfail;        /* rx wep processing failed */
-       u_int32_t is_rx_decap;          /* rx decapsulation failed */
-       u_int32_t is_rx_mgtdiscard;     /* rx discard mgt frames */
-       u_int32_t is_rx_ctl;            /* rx discard ctrl frames */
-       u_int32_t is_rx_beacon;         /* rx beacon frames */
-       u_int32_t is_rx_rstoobig;       /* rx rate set truncated */
-       u_int32_t is_rx_elem_missing;   /* rx required element missing*/
-       u_int32_t is_rx_elem_toobig;    /* rx element too big */
-       u_int32_t is_rx_elem_toosmall;  /* rx element too small */
-       u_int32_t is_rx_elem_unknown;   /* rx element unknown */
-       u_int32_t is_rx_badchan;        /* rx frame w/ invalid chan */
-       u_int32_t is_rx_chanmismatch;   /* rx frame chan mismatch */
-       u_int32_t is_rx_nodealloc;      /* rx frame dropped */
-       u_int32_t is_rx_ssidmismatch;   /* rx frame ssid mismatch  */
-       u_int32_t is_rx_auth_unsupported;/* rx w/ unsupported auth alg */
-       u_int32_t is_rx_auth_fail;      /* rx sta auth failure */
-       u_int32_t is_rx_auth_countermeasures;/* rx auth discard due to CM */
-       u_int32_t is_rx_assoc_bss;      /* rx assoc from wrong bssid */
-       u_int32_t is_rx_assoc_notauth;  /* rx assoc w/o auth */
-       u_int32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
-       u_int32_t is_rx_assoc_norate;   /* rx assoc w/ no rate match */
-       u_int32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */
-       u_int32_t is_rx_deauth;         /* rx deauthentication */
-       u_int32_t is_rx_disassoc;       /* rx disassociation */
-       u_int32_t is_rx_badsubtype;     /* rx frame w/ unknown subtype*/
-       u_int32_t is_rx_nobuf;          /* rx failed for lack of buf */
-       u_int32_t is_rx_decryptcrc;     /* rx decrypt failed on crc */
-       u_int32_t is_rx_ahdemo_mgt;     /* rx discard ahdemo mgt frame*/
-       u_int32_t is_rx_bad_auth;       /* rx bad auth request */
-       u_int32_t is_rx_unauth;         /* rx on unauthorized port */
-       u_int32_t is_rx_badkeyid;       /* rx w/ incorrect keyid */
-       u_int32_t is_rx_ccmpreplay;     /* rx seq# violation (CCMP) */
-       u_int32_t is_rx_ccmpformat;     /* rx format bad (CCMP) */
-       u_int32_t is_rx_ccmpmic;        /* rx MIC check failed (CCMP) */
-       u_int32_t is_rx_tkipreplay;     /* rx seq# violation (TKIP) */
-       u_int32_t is_rx_tkipformat;     /* rx format bad (TKIP) */
-       u_int32_t is_rx_tkipmic;        /* rx MIC check failed (TKIP) */
-       u_int32_t is_rx_tkipicv;        /* rx ICV check failed (TKIP) */
-       u_int32_t is_rx_badcipher;      /* rx failed due to of key type */
-       u_int32_t is_rx_nocipherctx;    /* rx failed due to key !setup */
-       u_int32_t is_rx_acl;            /* rx discard due to of acl policy */
-       u_int32_t is_rx_ffcnt;          /* rx fast frames */
-       u_int32_t is_rx_badathtnl;      /* driver key alloc failed */
-       u_int32_t is_tx_nobuf;          /* tx failed for lack of buf */
-       u_int32_t is_tx_nonode;         /* tx failed for no node */
-       u_int32_t is_tx_unknownmgt;     /* tx of unknown mgt frame */
-       u_int32_t is_tx_badcipher;      /* tx failed due to of key type */
-       u_int32_t is_tx_nodefkey;       /* tx failed due to no defkey */
-       u_int32_t is_tx_noheadroom;     /* tx failed due to no space */
-       u_int32_t is_tx_ffokcnt;        /* tx fast frames sent success */
-       u_int32_t is_tx_fferrcnt;       /* tx fast frames sent success */
-       u_int32_t is_scan_active;       /* active scans started */
-       u_int32_t is_scan_passive;      /* passive scans started */
-       u_int32_t is_node_timeout;      /* nodes timed out inactivity */
-       u_int32_t is_crypto_nomem;      /* no memory for crypto ctx */
-       u_int32_t is_crypto_tkip;       /* tkip crypto done in s/w */
-       u_int32_t is_crypto_tkipenmic;  /* tkip en-MIC done in s/w */
-       u_int32_t is_crypto_tkipdemic;  /* tkip de-MIC done in s/w */
-       u_int32_t is_crypto_tkipcm;     /* tkip counter measures */
-       u_int32_t is_crypto_ccmp;       /* ccmp crypto done in s/w */
-       u_int32_t is_crypto_wep;        /* wep crypto done in s/w */
-       u_int32_t is_crypto_setkey_cipher;/* cipher rejected key */
-       u_int32_t is_crypto_setkey_nokey;/* no key index for setkey */
-       u_int32_t is_crypto_delkey;     /* driver key delete failed */
-       u_int32_t is_crypto_badcipher;  /* unknown cipher */
-       u_int32_t is_crypto_nocipher;   /* cipher not available */
-       u_int32_t is_crypto_attachfail; /* cipher attach failed */
-       u_int32_t is_crypto_swfallback; /* cipher fallback to s/w */
-       u_int32_t is_crypto_keyfail;    /* driver key alloc failed */
-       u_int32_t is_crypto_enmicfail;  /* en-MIC failed */
-       u_int32_t is_ibss_capmismatch;  /* merge failed-cap mismatch */
-       u_int32_t is_ibss_norate;       /* merge failed-rate mismatch */
-       u_int32_t is_ps_unassoc;        /* ps-poll for unassoc. sta */
-       u_int32_t is_ps_badaid;         /* ps-poll w/ incorrect aid */
-       u_int32_t is_ps_qempty;         /* ps-poll w/ nothing to send */
+  u_int32_t is_rx_badversion;           /* rx frame with bad version */
+  u_int32_t is_rx_tooshort;             /* rx frame too short */
+  u_int32_t is_rx_wrongbss;             /* rx from wrong bssid */
+  u_int32_t is_rx_dup;                  /* rx discard due to it's a dup */
+  u_int32_t is_rx_wrongdir;             /* rx w/ wrong direction */
+  u_int32_t is_rx_mcastecho;            /* rx discard due to of mcast echo */
+  u_int32_t is_rx_notassoc;             /* rx discard due to sta !assoc */
+  u_int32_t is_rx_noprivacy;            /* rx w/ wep but privacy off */
+  u_int32_t is_rx_unencrypted;          /* rx w/o wep and privacy on */
+  u_int32_t is_rx_wepfail;              /* rx wep processing failed */
+  u_int32_t is_rx_decap;                /* rx decapsulation failed */
+  u_int32_t is_rx_mgtdiscard;           /* rx discard mgt frames */
+  u_int32_t is_rx_ctl;                  /* rx discard ctrl frames */
+  u_int32_t is_rx_beacon;               /* rx beacon frames */
+  u_int32_t is_rx_rstoobig;             /* rx rate set truncated */
+  u_int32_t is_rx_elem_missing;         /* rx required element missing*/
+  u_int32_t is_rx_elem_toobig;          /* rx element too big */
+  u_int32_t is_rx_elem_toosmall;        /* rx element too small */
+  u_int32_t is_rx_elem_unknown;         /* rx element unknown */
+  u_int32_t is_rx_badchan;              /* rx frame w/ invalid chan */
+  u_int32_t is_rx_chanmismatch;         /* rx frame chan mismatch */
+  u_int32_t is_rx_nodealloc;            /* rx frame dropped */
+  u_int32_t is_rx_ssidmismatch;         /* rx frame ssid mismatch  */
+  u_int32_t is_rx_auth_unsupported;     /* rx w/ unsupported auth alg */
+  u_int32_t is_rx_auth_fail;            /* rx sta auth failure */
+  u_int32_t is_rx_auth_countermeasures; /* rx auth discard due to CM */
+  u_int32_t is_rx_assoc_bss;            /* rx assoc from wrong bssid */
+  u_int32_t is_rx_assoc_notauth;        /* rx assoc w/o auth */
+  u_int32_t is_rx_assoc_capmismatch;    /* rx assoc w/ cap mismatch */
+  u_int32_t is_rx_assoc_norate;         /* rx assoc w/ no rate match */
+  u_int32_t is_rx_assoc_badwpaie;       /* rx assoc w/ bad WPA IE */
+  u_int32_t is_rx_deauth;               /* rx deauthentication */
+  u_int32_t is_rx_disassoc;             /* rx disassociation */
+  u_int32_t is_rx_badsubtype;           /* rx frame w/ unknown subtype*/
+  u_int32_t is_rx_nobuf;                /* rx failed for lack of buf */
+  u_int32_t is_rx_decryptcrc;           /* rx decrypt failed on crc */
+  u_int32_t is_rx_ahdemo_mgt;           /* rx discard ahdemo mgt frame*/
+  u_int32_t is_rx_bad_auth;             /* rx bad auth request */
+  u_int32_t is_rx_unauth;               /* rx on unauthorized port */
+  u_int32_t is_rx_badkeyid;             /* rx w/ incorrect keyid */
+  u_int32_t is_rx_ccmpreplay;           /* rx seq# violation (CCMP) */
+  u_int32_t is_rx_ccmpformat;           /* rx format bad (CCMP) */
+  u_int32_t is_rx_ccmpmic;              /* rx MIC check failed (CCMP) */
+  u_int32_t is_rx_tkipreplay;           /* rx seq# violation (TKIP) */
+  u_int32_t is_rx_tkipformat;           /* rx format bad (TKIP) */
+  u_int32_t is_rx_tkipmic;              /* rx MIC check failed (TKIP) */
+  u_int32_t is_rx_tkipicv;              /* rx ICV check failed (TKIP) */
+  u_int32_t is_rx_badcipher;            /* rx failed due to of key type */
+  u_int32_t is_rx_nocipherctx;          /* rx failed due to key !setup */
+  u_int32_t is_rx_acl;                  /* rx discard due to of acl policy */
+  u_int32_t is_rx_ffcnt;                /* rx fast frames */
+  u_int32_t is_rx_badathtnl;            /* driver key alloc failed */
+  u_int32_t is_tx_nobuf;                /* tx failed for lack of buf */
+  u_int32_t is_tx_nonode;               /* tx failed for no node */
+  u_int32_t is_tx_unknownmgt;           /* tx of unknown mgt frame */
+  u_int32_t is_tx_badcipher;            /* tx failed due to of key type */
+  u_int32_t is_tx_nodefkey;             /* tx failed due to no defkey */
+  u_int32_t is_tx_noheadroom;           /* tx failed due to no space */
+  u_int32_t is_tx_ffokcnt;              /* tx fast frames sent success */
+  u_int32_t is_tx_fferrcnt;             /* tx fast frames sent success */
+  u_int32_t is_scan_active;             /* active scans started */
+  u_int32_t is_scan_passive;            /* passive scans started */
+  u_int32_t is_node_timeout;            /* nodes timed out inactivity */
+  u_int32_t is_crypto_nomem;            /* no memory for crypto ctx */
+  u_int32_t is_crypto_tkip;             /* tkip crypto done in s/w */
+  u_int32_t is_crypto_tkipenmic;        /* tkip en-MIC done in s/w */
+  u_int32_t is_crypto_tkipdemic;        /* tkip de-MIC done in s/w */
+  u_int32_t is_crypto_tkipcm;           /* tkip counter measures */
+  u_int32_t is_crypto_ccmp;             /* ccmp crypto done in s/w */
+  u_int32_t is_crypto_wep;              /* wep crypto done in s/w */
+  u_int32_t is_crypto_setkey_cipher;    /* cipher rejected key */
+  u_int32_t is_crypto_setkey_nokey;     /* no key index for setkey */
+  u_int32_t is_crypto_delkey;           /* driver key delete failed */
+  u_int32_t is_crypto_badcipher;        /* unknown cipher */
+  u_int32_t is_crypto_nocipher;         /* cipher not available */
+  u_int32_t is_crypto_attachfail;       /* cipher attach failed */
+  u_int32_t is_crypto_swfallback;       /* cipher fallback to s/w */
+  u_int32_t is_crypto_keyfail;          /* driver key alloc failed */
+  u_int32_t is_crypto_enmicfail;        /* en-MIC failed */
+  u_int32_t is_ibss_capmismatch;        /* merge failed-cap mismatch */
+  u_int32_t is_ibss_norate;             /* merge failed-rate mismatch */
+  u_int32_t is_ps_unassoc;              /* ps-poll for unassoc. sta */
+  u_int32_t is_ps_badaid;               /* ps-poll w/ incorrect aid */
+  u_int32_t is_ps_qempty;               /* ps-poll w/ nothing to send */
 };
 
 /*
  * Retrieve per-node statistics.
  */
 struct ieee80211req_sta_stats {
 };
 
 /*
  * Retrieve per-node statistics.
  */
 struct ieee80211req_sta_stats {
-       union {
-               /* NB: explicitly force 64-bit alignment */
-               u_int8_t macaddr[IEEE80211_ADDR_LEN];
-               u_int64_t pad;
-       } is_u;
-       struct ieee80211_nodestats is_stats;
+  union {
+    /* NB: explicitly force 64-bit alignment */
+    u_int8_t macaddr[IEEE80211_ADDR_LEN];
+    u_int64_t pad;
+  } is_u;
+  struct ieee80211_nodestats is_stats;
 };
 
 /*
 };
 
 /*
@@ -203,105 +202,103 @@ struct ieee80211req_sta_stats {
  * to retrieve other data like stats, unicast key, etc.
  */
 struct ieee80211req_sta_info {
  * to retrieve other data like stats, unicast key, etc.
  */
 struct ieee80211req_sta_info {
-       u_int16_t isi_len;              /* length (mult of 4) */
-       u_int16_t isi_freq;             /* MHz */
-       u_int16_t isi_flags;            /* channel flags */
-       u_int16_t isi_state;            /* state flags */
-       u_int8_t isi_authmode;          /* authentication algorithm */
-       u_int8_t isi_rssi;
-       u_int16_t isi_capinfo;          /* capabilities */
-       u_int8_t isi_athflags;          /* Atheros capabilities */
-       u_int8_t isi_erp;               /* ERP element */
-       u_int8_t isi_macaddr[IEEE80211_ADDR_LEN];
-       u_int8_t isi_nrates;            /* negotiated rates */
-       u_int8_t isi_rates[IEEE80211_RATE_MAXSIZE];
-       u_int8_t isi_txrate;            /* index to isi_rates[] */
-       u_int16_t isi_ie_len;           /* IE length */
-       u_int16_t isi_associd;          /* assoc response */
-       u_int16_t isi_txpower;          /* current tx power */
-       u_int16_t isi_vlan;             /* vlan tag */
-       u_int16_t isi_txseqs[17];       /* seq to be transmitted */
-       u_int16_t isi_rxseqs[17];       /* seq previous for qos frames*/
-       u_int16_t isi_inact;            /* inactivity timer */
-       u_int8_t isi_uapsd;             /* UAPSD queues */
-       u_int8_t isi_opmode;            /* sta operating mode */
+  u_int16_t isi_len;     /* length (mult of 4) */
+  u_int16_t isi_freq;    /* MHz */
+  u_int16_t isi_flags;   /* channel flags */
+  u_int16_t isi_state;   /* state flags */
+  u_int8_t isi_authmode; /* authentication algorithm */
+  u_int8_t isi_rssi;
+  u_int16_t isi_capinfo; /* capabilities */
+  u_int8_t isi_athflags; /* Atheros capabilities */
+  u_int8_t isi_erp;      /* ERP element */
+  u_int8_t isi_macaddr[IEEE80211_ADDR_LEN];
+  u_int8_t isi_nrates; /* negotiated rates */
+  u_int8_t isi_rates[IEEE80211_RATE_MAXSIZE];
+  u_int8_t isi_txrate;      /* index to isi_rates[] */
+  u_int16_t isi_ie_len;     /* IE length */
+  u_int16_t isi_associd;    /* assoc response */
+  u_int16_t isi_txpower;    /* current tx power */
+  u_int16_t isi_vlan;       /* vlan tag */
+  u_int16_t isi_txseqs[17]; /* seq to be transmitted */
+  u_int16_t isi_rxseqs[17]; /* seq previous for qos frames*/
+  u_int16_t isi_inact;      /* inactivity timer */
+  u_int8_t isi_uapsd;       /* UAPSD queues */
+  u_int8_t isi_opmode;      /* sta operating mode */
 
 
-       /* XXX frag state? */
-       /* variable length IE data */
+  /* XXX frag state? */
+  /* variable length IE data */
 };
 
 };
 
-
 struct ath_stats {
 struct ath_stats {
-       u_int32_t ast_watchdog;         /* device reset by watchdog */
-       u_int32_t ast_hardware;         /* fatal hardware error interrupts */
-       u_int32_t ast_bmiss;            /* beacon miss interrupts */
-       u_int32_t ast_rxorn;            /* rx overrun interrupts */
-       u_int32_t ast_rxeol;            /* rx eol interrupts */
-       u_int32_t ast_txurn;            /* tx underrun interrupts */
-       u_int32_t ast_mib;              /* mib interrupts */
-       u_int32_t ast_tx_packets;       /* packet sent on the interface */
-       u_int32_t ast_tx_mgmt;          /* management frames transmitted */
-       u_int32_t ast_tx_discard;       /* frames discarded prior to assoc */
-       u_int32_t ast_tx_invalid;       /* frames discarded due to is device gone */
-       u_int32_t ast_tx_qstop;         /* tx queue stopped because it's full */
-       u_int32_t ast_tx_encap;         /* tx encapsulation failed */
-       u_int32_t ast_tx_nonode;        /* tx failed due to of no node */
-       u_int32_t ast_tx_nobuf;         /* tx failed due to of no tx buffer (data) */
-       u_int32_t ast_tx_nobufmgt;      /* tx failed due to of no tx buffer (mgmt)*/
-       u_int32_t ast_tx_xretries;      /* tx failed due to of too many retries */
-       u_int32_t ast_tx_fifoerr;       /* tx failed due to of FIFO underrun */
-       u_int32_t ast_tx_filtered;      /* tx failed due to xmit filtered */
-       u_int32_t ast_tx_shortretry;    /* tx on-chip retries (short) */
-       u_int32_t ast_tx_longretry;     /* tx on-chip retries (long) */
-       u_int32_t ast_tx_badrate;       /* tx failed due to of bogus xmit rate */
-       u_int32_t ast_tx_noack;         /* tx frames with no ack marked */
-       u_int32_t ast_tx_rts;           /* tx frames with rts enabled */
-       u_int32_t ast_tx_cts;           /* tx frames with cts enabled */
-       u_int32_t ast_tx_shortpre;      /* tx frames with short preamble */
-       u_int32_t ast_tx_altrate;       /* tx frames with alternate rate */
-       u_int32_t ast_tx_protect;       /* tx frames with protection */
-       u_int32_t ast_rx_orn;           /* rx failed due to of desc overrun */
-       u_int32_t ast_rx_crcerr;        /* rx failed due to of bad CRC */
-       u_int32_t ast_rx_fifoerr;       /* rx failed due to of FIFO overrun */
-       u_int32_t ast_rx_badcrypt;      /* rx failed due to of decryption */
-       u_int32_t ast_rx_badmic;        /* rx failed due to of MIC failure */
-       u_int32_t ast_rx_phyerr;        /* rx PHY error summary count */
-       u_int32_t ast_rx_phy[32];       /* rx PHY error per-code counts */
-       u_int32_t ast_rx_tooshort;      /* rx discarded due to frame too short */
-       u_int32_t ast_rx_toobig;        /* rx discarded due to frame too large */
-       u_int32_t ast_rx_nobuf;         /* rx setup failed due to of no skbuff */
-       u_int32_t ast_rx_packets;       /* packet recv on the interface */
-       u_int32_t ast_rx_mgt;           /* management frames received */
-       u_int32_t ast_rx_ctl;           /* control frames received */
-       int8_t ast_tx_rssi;             /* tx rssi of last ack */
-       int8_t ast_rx_rssi;             /* rx rssi from histogram */
-       u_int32_t ast_be_xmit;          /* beacons transmitted */
-       u_int32_t ast_be_nobuf;         /* no skbuff available for beacon */
-       u_int32_t ast_per_cal;          /* periodic calibration calls */
-       u_int32_t ast_per_calfail;      /* periodic calibration failed */
-       u_int32_t ast_per_rfgain;       /* periodic calibration rfgain reset */
-       u_int32_t ast_rate_calls;       /* rate control checks */
-       u_int32_t ast_rate_raise;       /* rate control raised xmit rate */
-       u_int32_t ast_rate_drop;        /* rate control dropped xmit rate */
-       u_int32_t ast_ant_defswitch;    /* rx/default antenna switches */
-       u_int32_t ast_ant_txswitch;     /* tx antenna switches */
-       u_int32_t ast_ant_rx[8];        /* rx frames with antenna */
-       u_int32_t ast_ant_tx[8];        /* tx frames with antenna */
+  u_int32_t ast_watchdog;      /* device reset by watchdog */
+  u_int32_t ast_hardware;      /* fatal hardware error interrupts */
+  u_int32_t ast_bmiss;         /* beacon miss interrupts */
+  u_int32_t ast_rxorn;         /* rx overrun interrupts */
+  u_int32_t ast_rxeol;         /* rx eol interrupts */
+  u_int32_t ast_txurn;         /* tx underrun interrupts */
+  u_int32_t ast_mib;           /* mib interrupts */
+  u_int32_t ast_tx_packets;    /* packet sent on the interface */
+  u_int32_t ast_tx_mgmt;       /* management frames transmitted */
+  u_int32_t ast_tx_discard;    /* frames discarded prior to assoc */
+  u_int32_t ast_tx_invalid;    /* frames discarded due to is device gone */
+  u_int32_t ast_tx_qstop;      /* tx queue stopped because it's full */
+  u_int32_t ast_tx_encap;      /* tx encapsulation failed */
+  u_int32_t ast_tx_nonode;     /* tx failed due to of no node */
+  u_int32_t ast_tx_nobuf;      /* tx failed due to of no tx buffer (data) */
+  u_int32_t ast_tx_nobufmgt;   /* tx failed due to of no tx buffer (mgmt)*/
+  u_int32_t ast_tx_xretries;   /* tx failed due to of too many retries */
+  u_int32_t ast_tx_fifoerr;    /* tx failed due to of FIFO underrun */
+  u_int32_t ast_tx_filtered;   /* tx failed due to xmit filtered */
+  u_int32_t ast_tx_shortretry; /* tx on-chip retries (short) */
+  u_int32_t ast_tx_longretry;  /* tx on-chip retries (long) */
+  u_int32_t ast_tx_badrate;    /* tx failed due to of bogus xmit rate */
+  u_int32_t ast_tx_noack;      /* tx frames with no ack marked */
+  u_int32_t ast_tx_rts;        /* tx frames with rts enabled */
+  u_int32_t ast_tx_cts;        /* tx frames with cts enabled */
+  u_int32_t ast_tx_shortpre;   /* tx frames with short preamble */
+  u_int32_t ast_tx_altrate;    /* tx frames with alternate rate */
+  u_int32_t ast_tx_protect;    /* tx frames with protection */
+  u_int32_t ast_rx_orn;        /* rx failed due to of desc overrun */
+  u_int32_t ast_rx_crcerr;     /* rx failed due to of bad CRC */
+  u_int32_t ast_rx_fifoerr;    /* rx failed due to of FIFO overrun */
+  u_int32_t ast_rx_badcrypt;   /* rx failed due to of decryption */
+  u_int32_t ast_rx_badmic;     /* rx failed due to of MIC failure */
+  u_int32_t ast_rx_phyerr;     /* rx PHY error summary count */
+  u_int32_t ast_rx_phy[32];    /* rx PHY error per-code counts */
+  u_int32_t ast_rx_tooshort;   /* rx discarded due to frame too short */
+  u_int32_t ast_rx_toobig;     /* rx discarded due to frame too large */
+  u_int32_t ast_rx_nobuf;      /* rx setup failed due to of no skbuff */
+  u_int32_t ast_rx_packets;    /* packet recv on the interface */
+  u_int32_t ast_rx_mgt;        /* management frames received */
+  u_int32_t ast_rx_ctl;        /* control frames received */
+  int8_t ast_tx_rssi;          /* tx rssi of last ack */
+  int8_t ast_rx_rssi;          /* rx rssi from histogram */
+  u_int32_t ast_be_xmit;       /* beacons transmitted */
+  u_int32_t ast_be_nobuf;      /* no skbuff available for beacon */
+  u_int32_t ast_per_cal;       /* periodic calibration calls */
+  u_int32_t ast_per_calfail;   /* periodic calibration failed */
+  u_int32_t ast_per_rfgain;    /* periodic calibration rfgain reset */
+  u_int32_t ast_rate_calls;    /* rate control checks */
+  u_int32_t ast_rate_raise;    /* rate control raised xmit rate */
+  u_int32_t ast_rate_drop;     /* rate control dropped xmit rate */
+  u_int32_t ast_ant_defswitch; /* rx/default antenna switches */
+  u_int32_t ast_ant_txswitch;  /* tx antenna switches */
+  u_int32_t ast_ant_rx[8];     /* rx frames with antenna */
+  u_int32_t ast_ant_tx[8];     /* tx frames with antenna */
 };
 
 };
 
-#define        SIOCGATHSTATS                   (SIOCDEVPRIVATE+0)
-#define        SIOCGATHDIAG                    (SIOCDEVPRIVATE+1)
-#define        SIOCGATHRADARSIG                (SIOCDEVPRIVATE+2)
-#define        SIOCGATHHALDIAG                 (SIOCDEVPRIVATE+3)
-#define        SIOCG80211STATS                 (SIOCDEVPRIVATE+2)
+#define SIOCGATHSTATS (SIOCDEVPRIVATE + 0)
+#define SIOCGATHDIAG (SIOCDEVPRIVATE + 1)
+#define SIOCGATHRADARSIG (SIOCDEVPRIVATE + 2)
+#define SIOCGATHHALDIAG (SIOCDEVPRIVATE + 3)
+#define SIOCG80211STATS (SIOCDEVPRIVATE + 2)
 /* NB: require in+out parameters so cannot use wireless extensions, yech */
 /* NB: require in+out parameters so cannot use wireless extensions, yech */
-#define        IEEE80211_IOCTL_GETKEY          (SIOCDEVPRIVATE+3)
-#define        IEEE80211_IOCTL_GETWPAIE        (SIOCDEVPRIVATE+4)
-#define        IEEE80211_IOCTL_STA_STATS       (SIOCDEVPRIVATE+5)
-#define        IEEE80211_IOCTL_STA_INFO        (SIOCDEVPRIVATE+6)
-#define        SIOC80211IFCREATE               (SIOCDEVPRIVATE+7)
-#define        SIOC80211IFDESTROY              (SIOCDEVPRIVATE+8)
-#define        IEEE80211_IOCTL_SCAN_RESULTS    (SIOCDEVPRIVATE+9)
-
+#define IEEE80211_IOCTL_GETKEY (SIOCDEVPRIVATE + 3)
+#define IEEE80211_IOCTL_GETWPAIE (SIOCDEVPRIVATE + 4)
+#define IEEE80211_IOCTL_STA_STATS (SIOCDEVPRIVATE + 5)
+#define IEEE80211_IOCTL_STA_INFO (SIOCDEVPRIVATE + 6)
+#define SIOC80211IFCREATE (SIOCDEVPRIVATE + 7)
+#define SIOC80211IFDESTROY (SIOCDEVPRIVATE + 8)
+#define IEEE80211_IOCTL_SCAN_RESULTS (SIOCDEVPRIVATE + 9)
 
 #endif
 
 #endif
index fd87b38..799e09d 100644 (file)
@@ -73,9 +73,9 @@ static int mec_match(__attribute__((unused)) const data_set_t *ds, /* {{{ */
 } /* }}} int mec_match */
 
 void module_register(void) {
 } /* }}} int mec_match */
 
 void module_register(void) {
-  fc_register_match(
-      "empty_counter",
-      (match_proc_t){
-          .create = mec_create, .destroy = mec_destroy, .match = mec_match,
-      });
+  fc_register_match("empty_counter", (match_proc_t){
+                                         .create = mec_create,
+                                         .destroy = mec_destroy,
+                                         .match = mec_match,
+                                     });
 } /* module_register */
 } /* module_register */
index 0cce0c6..d71195f 100644 (file)
@@ -90,14 +90,16 @@ static int socket_reinit(socket_adapter_t *self);
 static int socket_receive(socket_adapter_t *self, FILE **p_file);
 
 static mcelog_config_t g_mcelog_config = {
 static int socket_receive(socket_adapter_t *self, FILE **p_file);
 
 static mcelog_config_t g_mcelog_config = {
-    .logfile = "/var/log/mcelog", .persist = false,
+    .logfile = "/var/log/mcelog",
+    .persist = false,
 };
 
 static socket_adapter_t socket_adapter = {
     .sock_fd = -1,
     .unix_sock =
         {
 };
 
 static socket_adapter_t socket_adapter = {
     .sock_fd = -1,
     .unix_sock =
         {
-            .sun_family = AF_UNIX, .sun_path = "/var/run/mcelog-client",
+            .sun_family = AF_UNIX,
+            .sun_path = "/var/run/mcelog-client",
         },
     .lock = PTHREAD_RWLOCK_INITIALIZER,
     .close = socket_close,
         },
     .lock = PTHREAD_RWLOCK_INITIALIZER,
     .close = socket_close,
@@ -523,7 +525,8 @@ static int socket_receive(socket_adapter_t *self, FILE **pp_file) {
   int res = -1;
   pthread_rwlock_rdlock(&self->lock);
   struct pollfd poll_fd = {
   int res = -1;
   pthread_rwlock_rdlock(&self->lock);
   struct pollfd poll_fd = {
-      .fd = self->sock_fd, .events = POLLIN | POLLPRI,
+      .fd = self->sock_fd,
+      .events = POLLIN | POLLPRI,
   };
 
   if ((res = poll(&poll_fd, 1, MCELOG_POLL_TIMEOUT)) <= 0) {
   };
 
   if ((res = poll(&poll_fd, 1, MCELOG_POLL_TIMEOUT)) <= 0) {
index 0baf6c2..89dc75f 100644 (file)
@@ -171,7 +171,8 @@ static int memcached_connect_inet(memcached_t *st) {
 
     /* Wait until connection establishes */
     struct pollfd pollfd = {
 
     /* Wait until connection establishes */
     struct pollfd pollfd = {
-        .fd = fd, .events = POLLOUT,
+        .fd = fd,
+        .events = POLLOUT,
     };
     do
       status = poll(&pollfd, 1, MEMCACHED_CONNECT_TIMEOUT);
     };
     do
       status = poll(&pollfd, 1, MEMCACHED_CONNECT_TIMEOUT);
@@ -226,7 +227,8 @@ static int memcached_query_daemon(char *buffer, size_t buffer_size,
   }
 
   struct pollfd pollfd = {
   }
 
   struct pollfd pollfd = {
-      .fd = st->fd, .events = POLLOUT,
+      .fd = st->fd,
+      .events = POLLOUT,
   };
 
   do
   };
 
   do
@@ -346,7 +348,8 @@ static void submit_derive2(const char *type, const char *type_inst,
                            derive_t value0, derive_t value1, memcached_t *st) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
                            derive_t value0, derive_t value1, memcached_t *st) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
-      {.derive = value0}, {.derive = value1},
+      {.derive = value0},
+      {.derive = value1},
   };
 
   memcached_init_vl(&vl, st);
   };
 
   memcached_init_vl(&vl, st);
@@ -377,7 +380,8 @@ static void submit_gauge2(const char *type, const char *type_inst,
                           gauge_t value0, gauge_t value1, memcached_t *st) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
                           gauge_t value0, gauge_t value1, memcached_t *st) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
-      {.gauge = value0}, {.gauge = value1},
+      {.gauge = value0},
+      {.gauge = value1},
   };
 
   memcached_init_vl(&vl, st);
   };
 
   memcached_init_vl(&vl, st);
@@ -685,7 +689,8 @@ static int memcached_add_read_callback(memcached_t *st) {
       /* callback  = */ memcached_read,
       /* interval  = */ 0,
       &(user_data_t){
       /* callback  = */ memcached_read,
       /* interval  = */ 0,
       &(user_data_t){
-          .data = st, .free_func = memcached_free,
+          .data = st,
+          .free_func = memcached_free,
       });
 } /* int memcached_add_read_callback */
 
       });
 } /* int memcached_add_read_callback */
 
index 4a3a772..10bccde 100644 (file)
@@ -118,7 +118,7 @@ static int memory_init(void) {
 #if HAVE_HOST_STATISTICS
   port_host = mach_host_self();
   host_page_size(port_host, &pagesize);
 #if HAVE_HOST_STATISTICS
   port_host = mach_host_self();
   host_page_size(port_host, &pagesize);
-/* #endif HAVE_HOST_STATISTICS */
+  /* #endif HAVE_HOST_STATISTICS */
 
 #elif HAVE_SYSCTLBYNAME
 /* no init stuff */
 
 #elif HAVE_SYSCTLBYNAME
 /* no init stuff */
@@ -140,7 +140,7 @@ static int memory_init(void) {
     return -1;
   }
 
     return -1;
   }
 
-/* #endif HAVE_LIBKSTAT */
+    /* #endif HAVE_LIBKSTAT */
 
 #elif HAVE_SYSCTL
   pagesize = getpagesize();
 
 #elif HAVE_SYSCTL
   pagesize = getpagesize();
@@ -148,7 +148,7 @@ static int memory_init(void) {
     ERROR("memory plugin: Invalid pagesize: %i", pagesize);
     return -1;
   }
     ERROR("memory plugin: Invalid pagesize: %i", pagesize);
     return -1;
   }
-/* #endif HAVE_SYSCTL */
+    /* #endif HAVE_SYSCTL */
 
 #elif HAVE_LIBSTATGRAB
 /* no init stuff */
 
 #elif HAVE_LIBSTATGRAB
 /* no init stuff */
@@ -218,7 +218,7 @@ static int memory_read_internal(value_list_t *vl) {
 
   MEMORY_SUBMIT("wired", wired, "active", active, "inactive", inactive, "free",
                 free);
 
   MEMORY_SUBMIT("wired", wired, "active", active, "inactive", inactive, "free",
                 free);
-/* #endif HAVE_HOST_STATISTICS */
+  /* #endif HAVE_HOST_STATISTICS */
 
 #elif HAVE_SYSCTLBYNAME
   /*
 
 #elif HAVE_SYSCTLBYNAME
   /*
@@ -259,7 +259,7 @@ static int memory_read_internal(value_list_t *vl) {
                 (gauge_t)sysctl_vals[3], "active", (gauge_t)sysctl_vals[4],
                 "inactive", (gauge_t)sysctl_vals[5], "cache",
                 (gauge_t)sysctl_vals[6]);
                 (gauge_t)sysctl_vals[3], "active", (gauge_t)sysctl_vals[4],
                 "inactive", (gauge_t)sysctl_vals[5], "cache",
                 (gauge_t)sysctl_vals[6]);
-/* #endif HAVE_SYSCTLBYNAME */
+  /* #endif HAVE_SYSCTLBYNAME */
 
 #elif KERNEL_LINUX
   FILE *fh;
 
 #elif KERNEL_LINUX
   FILE *fh;
@@ -334,7 +334,7 @@ static int memory_read_internal(value_list_t *vl) {
   else
     MEMORY_SUBMIT("used", mem_used, "buffered", mem_buffered, "cached",
                   mem_cached, "free", mem_free, "slab", mem_slab_total);
   else
     MEMORY_SUBMIT("used", mem_used, "buffered", mem_buffered, "cached",
                   mem_cached, "free", mem_free, "slab", mem_slab_total);
-/* #endif KERNEL_LINUX */
+    /* #endif KERNEL_LINUX */
 
 #elif HAVE_LIBKSTAT
   /* Most of the additions here were taken as-is from the k9toolkit from
 
 #elif HAVE_LIBKSTAT
   /* Most of the additions here were taken as-is from the k9toolkit from
@@ -406,7 +406,7 @@ static int memory_read_internal(value_list_t *vl) {
   MEMORY_SUBMIT("used", (gauge_t)mem_used, "free", (gauge_t)mem_free, "locked",
                 (gauge_t)mem_lock, "kernel", (gauge_t)mem_kern, "arc",
                 (gauge_t)arcsize, "unusable", (gauge_t)mem_unus);
   MEMORY_SUBMIT("used", (gauge_t)mem_used, "free", (gauge_t)mem_free, "locked",
                 (gauge_t)mem_lock, "kernel", (gauge_t)mem_kern, "arc",
                 (gauge_t)arcsize, "unusable", (gauge_t)mem_unus);
-/* #endif HAVE_LIBKSTAT */
+  /* #endif HAVE_LIBKSTAT */
 
 #elif HAVE_SYSCTL
   int mib[] = {CTL_VM, VM_METER};
 
 #elif HAVE_SYSCTL
   int mib[] = {CTL_VM, VM_METER};
@@ -430,7 +430,7 @@ static int memory_read_internal(value_list_t *vl) {
 
   MEMORY_SUBMIT("active", mem_active, "inactive", mem_inactive, "free",
                 mem_free);
 
   MEMORY_SUBMIT("active", mem_active, "inactive", mem_inactive, "free",
                 mem_free);
-/* #endif HAVE_SYSCTL */
+  /* #endif HAVE_SYSCTL */
 
 #elif HAVE_LIBSTATGRAB
   sg_mem_stats *ios;
 
 #elif HAVE_LIBSTATGRAB
   sg_mem_stats *ios;
@@ -441,7 +441,7 @@ static int memory_read_internal(value_list_t *vl) {
 
   MEMORY_SUBMIT("used", (gauge_t)ios->used, "cached", (gauge_t)ios->cache,
                 "free", (gauge_t)ios->free);
 
   MEMORY_SUBMIT("used", (gauge_t)ios->used, "cached", (gauge_t)ios->cache,
                 "free", (gauge_t)ios->free);
-/* #endif HAVE_LIBSTATGRAB */
+  /* #endif HAVE_LIBSTATGRAB */
 
 #elif HAVE_PERFSTAT
   perfstat_memory_total_t pmemory = {0};
 
 #elif HAVE_PERFSTAT
   perfstat_memory_total_t pmemory = {0};
index 5b2509b..e36f3da 100644 (file)
@@ -341,7 +341,7 @@ static int mb_init_connection(mb_host_t *host) /* {{{ */
   host->is_connected = true;
   return 0;
 } /* }}} int mb_init_connection */
   host->is_connected = true;
   return 0;
 } /* }}} int mb_init_connection */
-/* #endif LEGACY_LIBMODBUS */
+  /* #endif LEGACY_LIBMODBUS */
 
 #else /* if !LEGACY_LIBMODBUS */
 /* Version 2.9.2 */
 
 #else /* if !LEGACY_LIBMODBUS */
 /* Version 2.9.2 */
@@ -1078,7 +1078,8 @@ static int mb_config_add_host(oconfig_item_t *ci) /* {{{ */
                                  /* callback = */ mb_read,
                                  /* interval = */ interval,
                                  &(user_data_t){
                                  /* callback = */ mb_read,
                                  /* interval = */ interval,
                                  &(user_data_t){
-                                     .data = host, .free_func = host_free,
+                                     .data = host,
+                                     .free_func = host_free,
                                  });
   } else {
     host_free(host);
                                  });
   } else {
     host_free(host);
index 7ba10f6..aafd4db 100644 (file)
@@ -225,7 +225,8 @@ static int mysql_config_database(oconfig_item_t *ci) /* {{{ */
     plugin_register_complex_read(
         /* group = */ NULL, cb_name, mysql_read, /* interval = */ 0,
         &(user_data_t){
     plugin_register_complex_read(
         /* group = */ NULL, cb_name, mysql_read, /* interval = */ 0,
         &(user_data_t){
-            .data = db, .free_func = mysql_database_free,
+            .data = db,
+            .free_func = mysql_database_free,
         });
   } else {
     mysql_database_free(db);
         });
   } else {
     mysql_database_free(db);
@@ -354,7 +355,8 @@ static void derive_submit(const char *type, const char *type_instance,
 
 static void traffic_submit(derive_t rx, derive_t tx, mysql_database_t *db) {
   value_t values[] = {
 
 static void traffic_submit(derive_t rx, derive_t tx, mysql_database_t *db) {
   value_t values[] = {
-      {.derive = rx}, {.derive = tx},
+      {.derive = rx},
+      {.derive = tx},
   };
 
   submit("mysql_octets", NULL, values, STATIC_ARRAY_SIZE(values), db);
   };
 
   submit("mysql_octets", NULL, values, STATIC_ARRAY_SIZE(values), db);
index ae49b5e..43aaa7a 100644 (file)
@@ -643,7 +643,8 @@ static int submit_two_derive(const char *host,
                              derive_t val0, derive_t val1, cdtime_t timestamp,
                              cdtime_t interval) {
   value_t values[] = {
                              derive_t val0, derive_t val1, cdtime_t timestamp,
                              cdtime_t interval) {
   value_t values[] = {
-      {.derive = val0}, {.derive = val1},
+      {.derive = val0},
+      {.derive = val1},
   };
 
   return submit_values(host, plugin_inst, type, type_inst, values,
   };
 
   return submit_values(host, plugin_inst, type, type_inst, values,
@@ -666,7 +667,8 @@ static int submit_two_gauge(const char *host, const char *plugin_inst, /* {{{ */
                             gauge_t val0, gauge_t val1, cdtime_t timestamp,
                             cdtime_t interval) {
   value_t values[] = {
                             gauge_t val0, gauge_t val1, cdtime_t timestamp,
                             cdtime_t interval) {
   value_t values[] = {
-      {.gauge = val0}, {.gauge = val1},
+      {.gauge = val0},
+      {.gauge = val1},
   };
 
   return submit_values(host, plugin_inst, type, type_inst, values,
   };
 
   return submit_values(host, plugin_inst, type, type_inst, values,
@@ -778,9 +780,8 @@ static int submit_volume_perf_data(const char *hostname, /* {{{ */
 
   /* Check for and submit disk-octet values */
   if (HAS_ALL_FLAGS(old_data->flags, CFG_VOLUME_PERF_IO) &&
 
   /* Check for and submit disk-octet values */
   if (HAS_ALL_FLAGS(old_data->flags, CFG_VOLUME_PERF_IO) &&
-      HAS_ALL_FLAGS(new_data->flags,
-                    HAVE_VOLUME_PERF_BYTES_READ |
-                        HAVE_VOLUME_PERF_BYTES_WRITE)) {
+      HAS_ALL_FLAGS(new_data->flags, HAVE_VOLUME_PERF_BYTES_READ |
+                                         HAVE_VOLUME_PERF_BYTES_WRITE)) {
     submit_two_derive(
         hostname, plugin_instance, "disk_octets", /* type instance = */ NULL,
         (derive_t)new_data->read_bytes, (derive_t)new_data->write_bytes,
     submit_two_derive(
         hostname, plugin_instance, "disk_octets", /* type instance = */ NULL,
         (derive_t)new_data->read_bytes, (derive_t)new_data->write_bytes,
@@ -798,15 +799,15 @@ static int submit_volume_perf_data(const char *hostname, /* {{{ */
   }
 
   /* Check for, calculate and submit disk-latency values */
   }
 
   /* Check for, calculate and submit disk-latency values */
-  if (HAS_ALL_FLAGS(old_data->flags,
-                    CFG_VOLUME_PERF_LATENCY | HAVE_VOLUME_PERF_OPS_READ |
-                        HAVE_VOLUME_PERF_OPS_WRITE |
-                        HAVE_VOLUME_PERF_LATENCY_READ |
-                        HAVE_VOLUME_PERF_LATENCY_WRITE) &&
-      HAS_ALL_FLAGS(new_data->flags,
-                    HAVE_VOLUME_PERF_OPS_READ | HAVE_VOLUME_PERF_OPS_WRITE |
-                        HAVE_VOLUME_PERF_LATENCY_READ |
-                        HAVE_VOLUME_PERF_LATENCY_WRITE)) {
+  if (HAS_ALL_FLAGS(old_data->flags, CFG_VOLUME_PERF_LATENCY |
+                                         HAVE_VOLUME_PERF_OPS_READ |
+                                         HAVE_VOLUME_PERF_OPS_WRITE |
+                                         HAVE_VOLUME_PERF_LATENCY_READ |
+                                         HAVE_VOLUME_PERF_LATENCY_WRITE) &&
+      HAS_ALL_FLAGS(new_data->flags, HAVE_VOLUME_PERF_OPS_READ |
+                                         HAVE_VOLUME_PERF_OPS_WRITE |
+                                         HAVE_VOLUME_PERF_LATENCY_READ |
+                                         HAVE_VOLUME_PERF_LATENCY_WRITE)) {
     gauge_t latency_per_op_read;
     gauge_t latency_per_op_write;
 
     gauge_t latency_per_op_read;
     gauge_t latency_per_op_write;
 
@@ -1406,9 +1407,8 @@ static int cna_submit_volume_usage_data(const char *hostname, /* {{{ */
 
     ssnprintf(plugin_instance, sizeof(plugin_instance), "volume-%s", v->name);
 
 
     ssnprintf(plugin_instance, sizeof(plugin_instance), "volume-%s", v->name);
 
-    if (HAS_ALL_FLAGS(v->flags,
-                      HAVE_VOLUME_USAGE_SNAP_USED |
-                          HAVE_VOLUME_USAGE_SNAP_RSVD)) {
+    if (HAS_ALL_FLAGS(v->flags, HAVE_VOLUME_USAGE_SNAP_USED |
+                                    HAVE_VOLUME_USAGE_SNAP_RSVD)) {
       if (v->snap_reserved > v->snap_used) {
         snap_reserve_free = v->snap_reserved - v->snap_used;
         snap_reserve_used = v->snap_used;
       if (v->snap_reserved > v->snap_used) {
         snap_reserve_free = v->snap_reserved - v->snap_used;
         snap_reserve_used = v->snap_used;
@@ -1422,9 +1422,8 @@ static int cna_submit_volume_usage_data(const char *hostname, /* {{{ */
 
     /* The space used by snapshots but not reserved for them is included in
      * both, norm_used and snap_norm_used. If possible, subtract this here. */
 
     /* The space used by snapshots but not reserved for them is included in
      * both, norm_used and snap_norm_used. If possible, subtract this here. */
-    if (HAS_ALL_FLAGS(v->flags,
-                      HAVE_VOLUME_USAGE_NORM_USED |
-                          HAVE_VOLUME_USAGE_SNAP_USED)) {
+    if (HAS_ALL_FLAGS(v->flags, HAVE_VOLUME_USAGE_NORM_USED |
+                                    HAVE_VOLUME_USAGE_SNAP_USED)) {
       if (norm_used >= snap_norm_used)
         norm_used -= snap_norm_used;
       else {
       if (norm_used >= snap_norm_used)
         norm_used -= snap_norm_used;
       else {
@@ -1466,9 +1465,8 @@ static int cna_submit_volume_usage_data(const char *hostname, /* {{{ */
                     "df_complex", "snap_reserved", (double)snap_reserve_free,
                     /* timestamp = */ 0, interval);
 
                     "df_complex", "snap_reserved", (double)snap_reserve_free,
                     /* timestamp = */ 0, interval);
 
-    if (HAS_ALL_FLAGS(v->flags,
-                      HAVE_VOLUME_USAGE_SNAP_USED |
-                          HAVE_VOLUME_USAGE_SNAP_RSVD))
+    if (HAS_ALL_FLAGS(v->flags, HAVE_VOLUME_USAGE_SNAP_USED |
+                                    HAVE_VOLUME_USAGE_SNAP_RSVD))
       submit_double(hostname, /* plugin instance = */ plugin_instance,
                     "df_complex", "snap_reserve_used",
                     (double)snap_reserve_used, /* timestamp = */ 0, interval);
       submit_double(hostname, /* plugin instance = */ plugin_instance,
                     "df_complex", "snap_reserve_used",
                     (double)snap_reserve_used, /* timestamp = */ 0, interval);
@@ -2798,7 +2796,8 @@ static int cna_register_host(host_config_t *host) /* {{{ */
       /* callback  = */ cna_read,
       /* interval  = */ host->interval,
       &(user_data_t){
       /* callback  = */ cna_read,
       /* interval  = */ host->interval,
       &(user_data_t){
-          .data = host, .free_func = (void *)free_host_config,
+          .data = host,
+          .free_func = (void *)free_host_config,
       });
 
   return 0;
       });
 
   return 0;
index e8a2877..806265a 100644 (file)
@@ -198,7 +198,8 @@ static void submit_two(const char *dev, const char *type,
                        const char *type_instance, derive_t rx, derive_t tx) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
                        const char *type_instance, derive_t rx, derive_t tx) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
-      {.derive = rx}, {.derive = tx},
+      {.derive = rx},
+      {.derive = tx},
   };
 
   vl.values = values;
   };
 
   vl.values = values;
index f6f0ac1..cf2f811 100644 (file)
@@ -1108,7 +1108,7 @@ static int parse_part_sign_sha256(sockent_t *se, /* {{{ */
 
   return 0;
 } /* }}} int parse_part_sign_sha256 */
 
   return 0;
 } /* }}} int parse_part_sign_sha256 */
-/* #endif HAVE_GCRYPT_H */
+  /* #endif HAVE_GCRYPT_H */
 
 #else  /* if !HAVE_GCRYPT_H */
 static int parse_part_sign_sha256(sockent_t *se, /* {{{ */
 
 #else  /* if !HAVE_GCRYPT_H */
 static int parse_part_sign_sha256(sockent_t *se, /* {{{ */
@@ -1263,7 +1263,7 @@ static int parse_part_encr_aes256(sockent_t *se, /* {{{ */
 
   return 0;
 } /* }}} int parse_part_encr_aes256 */
 
   return 0;
 } /* }}} int parse_part_encr_aes256 */
-/* #endif HAVE_GCRYPT_H */
+  /* #endif HAVE_GCRYPT_H */
 
 #else  /* if !HAVE_GCRYPT_H */
 static int parse_part_encr_aes256(sockent_t *se, /* {{{ */
 
 #else  /* if !HAVE_GCRYPT_H */
 static int parse_part_encr_aes256(sockent_t *se, /* {{{ */
@@ -1668,7 +1668,7 @@ static int network_set_interface(const sockent_t *se,
       ERROR("network plugin: setsockopt (bind-if): %s", STRERRNO);
       return -1;
     }
       ERROR("network plugin: setsockopt (bind-if): %s", STRERRNO);
       return -1;
     }
-/* #endif HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */
+      /* #endif HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */
 
 #else
     WARNING("network plugin: Cannot set the interface on a unicast "
 
 #else
     WARNING("network plugin: Cannot set the interface on a unicast "
index 320caa4..97d9125 100644 (file)
--- a/src/nfs.c
+++ b/src/nfs.c
@@ -322,7 +322,7 @@ static int nfs_config(const char *key, const char *value) {
 
 #if KERNEL_LINUX
 static int nfs_init(void) { return 0; }
 
 #if KERNEL_LINUX
 static int nfs_init(void) { return 0; }
-/* #endif KERNEL_LINUX */
+  /* #endif KERNEL_LINUX */
 
 #elif HAVE_LIBKSTAT
 static int nfs_init(void) {
 
 #elif HAVE_LIBKSTAT
 static int nfs_init(void) {
@@ -594,7 +594,7 @@ static int nfs_read(void) {
 
   return 0;
 }
 
   return 0;
 }
-/* #endif KERNEL_LINUX */
+  /* #endif KERNEL_LINUX */
 
 #elif HAVE_LIBKSTAT
 static int nfs_read(void) {
 
 #elif HAVE_LIBKSTAT
 static int nfs_read(void) {
index ae48692..552359e 100644 (file)
--- a/src/nut.c
+++ b/src/nut.c
@@ -100,8 +100,10 @@ static int nut_add_ups(const char *name) {
       /* name      = */ cb_name,
       /* callback  = */ nut_read,
       /* interval  = */ 0,
       /* name      = */ cb_name,
       /* callback  = */ nut_read,
       /* interval  = */ 0,
-      /* user_data = */ &(user_data_t){
-          .data = ups, .free_func = free_nut_ups_t,
+      /* user_data = */
+      &(user_data_t){
+          .data = ups,
+          .free_func = free_nut_ups_t,
       });
 
   sfree(cb_name);
       });
 
   sfree(cb_name);
index 41e2ec0..cd72cdb 100644 (file)
@@ -472,7 +472,8 @@ static int cldap_config_add(oconfig_item_t *ci) /* {{{ */
                                       /* callback  = */ cldap_read_host,
                                       /* interval  = */ 0,
                                       &(user_data_t){
                                       /* callback  = */ cldap_read_host,
                                       /* interval  = */ 0,
                                       &(user_data_t){
-                                          .data = st, .free_func = cldap_free,
+                                          .data = st,
+                                          .free_func = cldap_free,
                                       });
 } /* }}} int cldap_config_add */
 
                                       });
 } /* }}} int cldap_config_add */
 
index 4ec14f4..e22e851 100644 (file)
@@ -282,7 +282,9 @@ static void ovs_stats_submit_interfaces(port_list_t *port) {
     }
     strjoin(devname, sizeof(devname),
             (char *[]){
     }
     strjoin(devname, sizeof(devname),
             (char *[]){
-                bridge->name, port->name, iface->name,
+                bridge->name,
+                port->name,
+                iface->name,
             },
             3, ".");
     ovs_stats_submit_one(devname, "if_collisions", NULL,
             },
             3, ".");
     ovs_stats_submit_one(devname, "if_collisions", NULL,
index 6399605..b7282ea 100644 (file)
@@ -492,7 +492,7 @@ static void pcie_dispatch_uncorrectable_errors(pcie_device_t *dev,
 /* Find offset of PCI Express Capability Structure
  * in PCI configuration space.
  * Returns offset, -1 if not found.
 /* Find offset of PCI Express Capability Structure
  * in PCI configuration space.
  * Returns offset, -1 if not found.
-**/
+ **/
 static int pcie_find_cap_exp(pcie_device_t *dev) {
   int pos = pcie_read8(dev, PCI_CAPABILITY_LIST) & ~3;
 
 static int pcie_find_cap_exp(pcie_device_t *dev) {
   int pos = pcie_read8(dev, PCI_CAPABILITY_LIST) & ~3;
 
@@ -515,7 +515,7 @@ static int pcie_find_cap_exp(pcie_device_t *dev) {
 
 /* Find offset of Advanced Error Reporting Capability.
  * Returns AER offset, -1 if not found.
 
 /* Find offset of Advanced Error Reporting Capability.
  * Returns AER offset, -1 if not found.
-**/
+ **/
 static int pcie_find_ecap_aer(pcie_device_t *dev) {
   int pos = PCIE_ECAP_OFFSET;
   uint32_t header = pcie_read32(dev, pos);
 static int pcie_find_ecap_aer(pcie_device_t *dev) {
   int pos = PCIE_ECAP_OFFSET;
   uint32_t header = pcie_read32(dev, pos);
index ac5ec60..f83913a 100644 (file)
@@ -757,7 +757,7 @@ static int ps_init(void) {
     pset_list_len = 0;
     return -1;
   }
     pset_list_len = 0;
     return -1;
   }
-/* #endif HAVE_THREAD_INFO */
+    /* #endif HAVE_THREAD_INFO */
 
 #elif KERNEL_LINUX
   pagesize_g = sysconf(_SC_PAGESIZE);
 
 #elif KERNEL_LINUX
   pagesize_g = sysconf(_SC_PAGESIZE);
@@ -771,13 +771,13 @@ static int ps_init(void) {
     }
   }
 #endif
     }
   }
 #endif
-/* #endif KERNEL_LINUX */
+    /* #endif KERNEL_LINUX */
 
 #elif HAVE_LIBKVM_GETPROCS &&                                                  \
     (HAVE_STRUCT_KINFO_PROC_FREEBSD || HAVE_STRUCT_KINFO_PROC_OPENBSD)
   pagesize = getpagesize();
 
 #elif HAVE_LIBKVM_GETPROCS &&                                                  \
     (HAVE_STRUCT_KINFO_PROC_FREEBSD || HAVE_STRUCT_KINFO_PROC_OPENBSD)
   pagesize = getpagesize();
-/* #endif HAVE_LIBKVM_GETPROCS && (HAVE_STRUCT_KINFO_PROC_FREEBSD ||
- * HAVE_STRUCT_KINFO_PROC_OPENBSD) */
+  /* #endif HAVE_LIBKVM_GETPROCS && (HAVE_STRUCT_KINFO_PROC_FREEBSD ||
  * HAVE_STRUCT_KINFO_PROC_OPENBSD) */
 
 #elif HAVE_PROCINFO_H
   pagesize = getpagesize();
 
 #elif HAVE_PROCINFO_H
   pagesize = getpagesize();
@@ -1681,7 +1681,7 @@ static int ps_read_process(long pid, process_entry_t *ps, char *state) {
 
   /*
    * TODO: context switch counters for Solaris
 
   /*
    * TODO: context switch counters for Solaris
-*/
+   */
   ps->cswitch_vol = -1;
   ps->cswitch_invol = -1;
 
   ps->cswitch_vol = -1;
   ps->cswitch_invol = -1;
 
@@ -2013,7 +2013,7 @@ static int ps_read(void) {
 
   for (ps = list_head_g; ps != NULL; ps = ps->next)
     ps_submit_proc_list(ps);
 
   for (ps = list_head_g; ps != NULL; ps = ps->next)
     ps_submit_proc_list(ps);
-/* #endif HAVE_THREAD_INFO */
+    /* #endif HAVE_THREAD_INFO */
 
 #elif KERNEL_LINUX
   int running = 0;
 
 #elif KERNEL_LINUX
   int running = 0;
@@ -2095,7 +2095,7 @@ static int ps_read(void) {
     ps_submit_proc_list(ps_ptr);
 
   read_fork_rate();
     ps_submit_proc_list(ps_ptr);
 
   read_fork_rate();
-/* #endif KERNEL_LINUX */
+  /* #endif KERNEL_LINUX */
 
 #elif HAVE_LIBKVM_GETPROCS && HAVE_STRUCT_KINFO_PROC_FREEBSD
   int running = 0;
 
 #elif HAVE_LIBKVM_GETPROCS && HAVE_STRUCT_KINFO_PROC_FREEBSD
   int running = 0;
@@ -2250,7 +2250,7 @@ static int ps_read(void) {
 
   for (procstat_t *ps_ptr = list_head_g; ps_ptr != NULL; ps_ptr = ps_ptr->next)
     ps_submit_proc_list(ps_ptr);
 
   for (procstat_t *ps_ptr = list_head_g; ps_ptr != NULL; ps_ptr = ps_ptr->next)
     ps_submit_proc_list(ps_ptr);
-/* #endif HAVE_LIBKVM_GETPROCS && HAVE_STRUCT_KINFO_PROC_FREEBSD */
+    /* #endif HAVE_LIBKVM_GETPROCS && HAVE_STRUCT_KINFO_PROC_FREEBSD */
 
 #elif HAVE_LIBKVM_GETPROCS && HAVE_STRUCT_KINFO_PROC_OPENBSD
   int running = 0;
 
 #elif HAVE_LIBKVM_GETPROCS && HAVE_STRUCT_KINFO_PROC_OPENBSD
   int running = 0;
@@ -2394,7 +2394,7 @@ static int ps_read(void) {
 
   for (procstat_t *ps_ptr = list_head_g; ps_ptr != NULL; ps_ptr = ps_ptr->next)
     ps_submit_proc_list(ps_ptr);
 
   for (procstat_t *ps_ptr = list_head_g; ps_ptr != NULL; ps_ptr = ps_ptr->next)
     ps_submit_proc_list(ps_ptr);
-/* #endif HAVE_LIBKVM_GETPROCS && HAVE_STRUCT_KINFO_PROC_OPENBSD */
+    /* #endif HAVE_LIBKVM_GETPROCS && HAVE_STRUCT_KINFO_PROC_OPENBSD */
 
 #elif HAVE_PROCINFO_H
   /* AIX */
 
 #elif HAVE_PROCINFO_H
   /* AIX */
@@ -2533,7 +2533,7 @@ static int ps_read(void) {
 
   for (procstat_t *ps = list_head_g; ps != NULL; ps = ps->next)
     ps_submit_proc_list(ps);
 
   for (procstat_t *ps = list_head_g; ps != NULL; ps = ps->next)
     ps_submit_proc_list(ps);
-/* #endif HAVE_PROCINFO_H */
+    /* #endif HAVE_PROCINFO_H */
 
 #elif KERNEL_SOLARIS
   /*
 
 #elif KERNEL_SOLARIS
   /*
index 8d3dafa..7bfa663 100644 (file)
@@ -41,7 +41,8 @@
  * Global variables
  */
 static const char *config_keys[] = {
  * Global variables
  */
 static const char *config_keys[] = {
-    "Value", "IgnoreSelected",
+    "Value",
+    "IgnoreSelected",
 };
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
 };
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
index 5669f45..70db6b6 100644 (file)
@@ -703,8 +703,9 @@ static PyObject *cpy_get_dataset(PyObject *self, PyObject *args) {
   for (size_t i = 0; i < ds->ds_num; ++i) {
     tuple = PyTuple_New(4);
     PyTuple_SET_ITEM(tuple, 0, cpy_string_to_unicode_or_bytes(ds->ds[i].name));
   for (size_t i = 0; i < ds->ds_num; ++i) {
     tuple = PyTuple_New(4);
     PyTuple_SET_ITEM(tuple, 0, cpy_string_to_unicode_or_bytes(ds->ds[i].name));
-    PyTuple_SET_ITEM(tuple, 1, cpy_string_to_unicode_or_bytes(
-                                   DS_TYPE_TO_STRING(ds->ds[i].type)));
+    PyTuple_SET_ITEM(
+        tuple, 1,
+        cpy_string_to_unicode_or_bytes(DS_TYPE_TO_STRING(ds->ds[i].type)));
     PyTuple_SET_ITEM(tuple, 2, float_or_none(ds->ds[i].min));
     PyTuple_SET_ITEM(tuple, 3, float_or_none(ds->ds[i].max));
     PyList_SET_ITEM(list, i, tuple);
     PyTuple_SET_ITEM(tuple, 2, float_or_none(ds->ds[i].min));
     PyTuple_SET_ITEM(tuple, 3, float_or_none(ds->ds[i].max));
     PyList_SET_ITEM(list, i, tuple);
@@ -774,7 +775,8 @@ static PyObject *cpy_register_generic_userdata(void *reg, void *handler,
 
   register_function(buf, handler,
                     &(user_data_t){
 
   register_function(buf, handler,
                     &(user_data_t){
-                        .data = c, .free_func = cpy_destroy_user_data,
+                        .data = c,
+                        .free_func = cpy_destroy_user_data,
                     });
 
   ++cpy_num_callbacks;
                     });
 
   ++cpy_num_callbacks;
@@ -817,7 +819,8 @@ static PyObject *cpy_register_read(PyObject *self, PyObject *args,
       /* group = */ "python", buf, cpy_read_callback,
       DOUBLE_TO_CDTIME_T(interval),
       &(user_data_t){
       /* group = */ "python", buf, cpy_read_callback,
       DOUBLE_TO_CDTIME_T(interval),
       &(user_data_t){
-          .data = c, .free_func = cpy_destroy_user_data,
+          .data = c,
+          .free_func = cpy_destroy_user_data,
       });
   ++cpy_num_callbacks;
   return cpy_string_to_unicode_or_bytes(buf);
       });
   ++cpy_num_callbacks;
   return cpy_string_to_unicode_or_bytes(buf);
@@ -1201,8 +1204,9 @@ static PyObject *cpy_oconfig_to_pyconfig(oconfig_item_t *ci, PyObject *parent) {
   values = PyTuple_New(ci->values_num); /* New reference. */
   for (int i = 0; i < ci->values_num; ++i) {
     if (ci->values[i].type == OCONFIG_TYPE_STRING) {
   values = PyTuple_New(ci->values_num); /* New reference. */
   for (int i = 0; i < ci->values_num; ++i) {
     if (ci->values[i].type == OCONFIG_TYPE_STRING) {
-      PyTuple_SET_ITEM(values, i, cpy_string_to_unicode_or_bytes(
-                                      ci->values[i].value.string));
+      PyTuple_SET_ITEM(
+          values, i,
+          cpy_string_to_unicode_or_bytes(ci->values[i].value.string));
     } else if (ci->values[i].type == OCONFIG_TYPE_NUMBER) {
       PyTuple_SET_ITEM(values, i,
                        PyFloat_FromDouble(ci->values[i].value.number));
     } else if (ci->values[i].type == OCONFIG_TYPE_NUMBER) {
       PyTuple_SET_ITEM(values, i,
                        PyFloat_FromDouble(ci->values[i].value.number));
index 12f6894..77ce5fb 100644 (file)
@@ -123,7 +123,8 @@ static int redis_node_add(redis_node_t *rn) /* {{{ */
       /* callback  = */ redis_read,
       /* interval  = */ 0,
       &(user_data_t){
       /* callback  = */ redis_read,
       /* interval  = */ 0,
       &(user_data_t){
-          .data = rn, .free_func = redis_node_free,
+          .data = rn,
+          .free_func = redis_node_free,
       });
 } /* }}} */
 
       });
 } /* }}} */
 
index fa28f04..ece865b 100644 (file)
@@ -53,7 +53,8 @@ static void cr_submit_io(cr_data_t *rd, const char *type, /* {{{ */
                          const char *type_instance, derive_t rx, derive_t tx) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
                          const char *type_instance, derive_t rx, derive_t tx) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
-      {.derive = rx}, {.derive = tx},
+      {.derive = rx},
+      {.derive = tx},
   };
 
   vl.values = values;
   };
 
   vl.values = values;
@@ -442,7 +443,8 @@ static int cr_config_router(oconfig_item_t *ci) /* {{{ */
   return plugin_register_complex_read(
       /* group = */ NULL, read_name, cr_read, /* interval = */ 0,
       &(user_data_t){
   return plugin_register_complex_read(
       /* group = */ NULL, read_name, cr_read, /* interval = */ 0,
       &(user_data_t){
-          .data = router_data, .free_func = (void *)cr_free_data,
+          .data = router_data,
+          .free_func = (void *)cr_free_data,
       });
 } /* }}} int cr_config_router */
 
       });
 } /* }}} int cr_config_router */
 
index 6f34e67..1e75ff8 100644 (file)
@@ -426,7 +426,8 @@ static int rc_write(const data_set_t *ds, const value_list_t *vl,
   }
 
   char *values_array[2] = {
   }
 
   char *values_array[2] = {
-          [0] = values, [1] = NULL,
+      [0] = values,
+      [1] = NULL,
   };
 
   while (42) {
   };
 
   while (42) {
index f30bc26..bd5943c 100644 (file)
@@ -120,7 +120,7 @@ static int srrd_update(char *filename, char *template, int argc,
 
   return status;
 } /* int srrd_update */
 
   return status;
 } /* int srrd_update */
-/* #endif HAVE_THREADSAFE_LIBRRD */
+  /* #endif HAVE_THREADSAFE_LIBRRD */
 
 #else  /* !HAVE_THREADSAFE_LIBRRD */
 static int srrd_update(char *filename, char *template, int argc,
 
 #else  /* !HAVE_THREADSAFE_LIBRRD */
 static int srrd_update(char *filename, char *template, int argc,
index 8d1ece9..61868e8 100644 (file)
@@ -230,7 +230,7 @@ static int sensors_load_conf(void) {
       last_feature = fl;
     } /* while sensors_get_all_features */
   }   /* while sensors_get_detected_chips */
       last_feature = fl;
     } /* while sensors_get_all_features */
   }   /* while sensors_get_detected_chips */
-/* #endif SENSORS_API_VERSION < 0x400 */
+      /* #endif SENSORS_API_VERSION < 0x400 */
 
 #elif (SENSORS_API_VERSION >= 0x400)
   chip_num = 0;
 
 #elif (SENSORS_API_VERSION >= 0x400)
   chip_num = 0;
@@ -368,7 +368,7 @@ static int sensors_read(void) {
     sensors_submit(plugin_instance, sensor_type_name_map[fl->type],
                    type_instance, value);
   } /* for fl = first_feature .. NULL */
     sensors_submit(plugin_instance, sensor_type_name_map[fl->type],
                    type_instance, value);
   } /* for fl = first_feature .. NULL */
-/* #endif SENSORS_API_VERSION < 0x400 */
+    /* #endif SENSORS_API_VERSION < 0x400 */
 
 #elif (SENSORS_API_VERSION >= 0x400)
   for (featurelist_t *fl = first_feature; fl != NULL; fl = fl->next) {
 
 #elif (SENSORS_API_VERSION >= 0x400)
   for (featurelist_t *fl = first_feature; fl != NULL; fl = fl->next) {
index aae9978..ae6f443 100644 (file)
@@ -33,7 +33,8 @@
 static void serial_submit(const char *type_instance, derive_t rx, derive_t tx) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
 static void serial_submit(const char *type_instance, derive_t rx, derive_t tx) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
-      {.derive = rx}, {.derive = tx},
+      {.derive = rx},
+      {.derive = tx},
   };
 
   vl.values = values;
   };
 
   vl.values = values;
index dd7e998..aeb04fd 100644 (file)
@@ -876,7 +876,8 @@ static int csnmp_config_add_host(oconfig_item_t *ci) {
   status = plugin_register_complex_read(
       /* group = */ NULL, cb_name, csnmp_read_host, interval,
       &(user_data_t){
   status = plugin_register_complex_read(
       /* group = */ NULL, cb_name, csnmp_read_host, interval,
       &(user_data_t){
-          .data = hd, .free_func = csnmp_host_definition_destroy,
+          .data = hd,
+          .free_func = csnmp_host_definition_destroy,
       });
   if (status != 0) {
     ERROR("snmp plugin: Registering complex read function failed.");
       });
   if (status != 0) {
     ERROR("snmp plugin: Registering complex read function failed.");
index 6c7820a..9050596 100644 (file)
@@ -606,9 +606,8 @@ static int statsd_config_timer_percentile(oconfig_item_t *ci) /* {{{ */
     return ERANGE;
   }
 
     return ERANGE;
   }
 
-  tmp =
-      realloc(conf_timer_percentile,
-              sizeof(*conf_timer_percentile) * (conf_timer_percentile_num + 1));
+  tmp = realloc(conf_timer_percentile, sizeof(*conf_timer_percentile) *
+                                           (conf_timer_percentile_num + 1));
   if (tmp == NULL) {
     ERROR("statsd plugin: realloc failed.");
     return ENOMEM;
   if (tmp == NULL) {
     ERROR("statsd plugin: realloc failed.");
     return ENOMEM;
index 9e58919..61c9e28 100644 (file)
@@ -150,12 +150,12 @@ static int swap_init(void) /* {{{ */
 {
 #if KERNEL_LINUX
   pagesize = (derive_t)sysconf(_SC_PAGESIZE);
 {
 #if KERNEL_LINUX
   pagesize = (derive_t)sysconf(_SC_PAGESIZE);
-/* #endif KERNEL_LINUX */
+  /* #endif KERNEL_LINUX */
 
 #elif HAVE_SWAPCTL && HAVE_SWAPCTL_TWO_ARGS
   /* getpagesize(3C) tells me this does not fail.. */
   pagesize = (derive_t)getpagesize();
 
 #elif HAVE_SWAPCTL && HAVE_SWAPCTL_TWO_ARGS
   /* getpagesize(3C) tells me this does not fail.. */
   pagesize = (derive_t)getpagesize();
-/* #endif HAVE_SWAPCTL */
+  /* #endif HAVE_SWAPCTL */
 
 #elif defined(VM_SWAPUSAGE)
 /* No init stuff */
 
 #elif defined(VM_SWAPUSAGE)
 /* No init stuff */
@@ -177,7 +177,7 @@ static int swap_init(void) /* {{{ */
     ERROR("swap plugin: kvm_openfiles failed, %s", errbuf);
     return -1;
   }
     ERROR("swap plugin: kvm_openfiles failed, %s", errbuf);
     return -1;
   }
-/* #endif HAVE_LIBKVM_GETSWAPINFO */
+    /* #endif HAVE_LIBKVM_GETSWAPINFO */
 
 #elif HAVE_LIBSTATGRAB
 /* No init stuff */
 
 #elif HAVE_LIBSTATGRAB
 /* No init stuff */
index e1d473e..ab8bf6d 100644 (file)
@@ -482,7 +482,8 @@ static int tcsv_config_add_file(oconfig_item_t *ci) {
   status = plugin_register_complex_read(
       NULL, cb_name, tcsv_read, interval,
       &(user_data_t){
   status = plugin_register_complex_read(
       NULL, cb_name, tcsv_read, interval,
       &(user_data_t){
-          .data = id, .free_func = tcsv_instance_definition_destroy,
+          .data = id,
+          .free_func = tcsv_instance_definition_destroy,
       });
   if (status != 0) {
     ERROR("tail_csv plugin: Registering complex read function failed.");
       });
   if (status != 0) {
     ERROR("tail_csv plugin: Registering complex read function failed.");
index ccf8825..c95ebfb 100644 (file)
@@ -63,7 +63,8 @@ static void tape_submit(const char *plugin_instance, const char *type,
                         derive_t read, derive_t write) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
                         derive_t read, derive_t write) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
-      {.derive = read}, {.derive = write},
+      {.derive = read},
+      {.derive = write},
   };
 
   vl.values = values;
   };
 
   vl.values = values;
index d01bcd2..ae08b88 100644 (file)
@@ -413,7 +413,7 @@ static int conn_handle_ports(uint16_t port_local, uint16_t port_remote,
 #if TCP_STATE_MIN > 0
       || (state < TCP_STATE_MIN)
 #endif
 #if TCP_STATE_MIN > 0
       || (state < TCP_STATE_MIN)
 #endif
-          ) {
+  ) {
     NOTICE("tcpconns plugin: Ignoring connection with "
            "unknown state 0x%02" PRIx8 ".",
            state);
     NOTICE("tcpconns plugin: Ignoring connection with "
            "unknown state 0x%02" PRIx8 ".",
            state);
@@ -630,10 +630,10 @@ static int conn_read_file(const char *file) {
 
   return 0;
 } /* int conn_read_file */
 
   return 0;
 } /* int conn_read_file */
-/* #endif KERNEL_LINUX */
+  /* #endif KERNEL_LINUX */
 
 #elif HAVE_SYSCTLBYNAME
 
 #elif HAVE_SYSCTLBYNAME
-/* #endif HAVE_SYSCTLBYNAME */
+  /* #endif HAVE_SYSCTLBYNAME */
 
 #elif HAVE_LIBKVM_NLIST
 #endif /* HAVE_LIBKVM_NLIST */
 
 #elif HAVE_LIBKVM_NLIST
 #endif /* HAVE_LIBKVM_NLIST */
@@ -729,7 +729,7 @@ static int conn_read(void) {
 
   return 0;
 } /* int conn_read */
 
   return 0;
 } /* int conn_read */
-/* #endif KERNEL_LINUX */
+  /* #endif KERNEL_LINUX */
 
 #elif HAVE_SYSCTLBYNAME
 static int conn_read(void) {
 
 #elif HAVE_SYSCTLBYNAME
 static int conn_read(void) {
@@ -848,8 +848,8 @@ static int conn_read(void) {
 
   return 0;
 }
 
   return 0;
 }
-/* int conn_read */
-/* #endif HAVE_KVM_GETFILES */
+  /* int conn_read */
+  /* #endif HAVE_KVM_GETFILES */
 
 #elif HAVE_LIBKVM_NLIST
 static int kread(u_long addr, void *buf, int size) {
 
 #elif HAVE_LIBKVM_NLIST
 static int kread(u_long addr, void *buf, int size) {
@@ -966,7 +966,7 @@ static int conn_read(void) {
 
   return 0;
 }
 
   return 0;
 }
-/* #endif HAVE_LIBKVM_NLIST */
+  /* #endif HAVE_LIBKVM_NLIST */
 
 #elif KERNEL_AIX
 
 
 #elif KERNEL_AIX
 
index 1ab6e4b..42cc54e 100644 (file)
@@ -132,7 +132,8 @@ static void tss2_submit_io(const char *plugin_instance, const char *type,
    */
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
    */
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
-      {.derive = rx}, {.derive = tx},
+      {.derive = rx},
+      {.derive = tx},
   };
 
   vl.values = values;
   };
 
   vl.values = values;
index b08d353..e74dfc2 100644 (file)
@@ -367,8 +367,9 @@ static int ut_report_state(const data_set_t *ds, const value_list_t *vl,
     if (state_old == STATE_MISSING)
       ssnprintf(buf, bufsize, ": Value is no longer missing.");
     else
     if (state_old == STATE_MISSING)
       ssnprintf(buf, bufsize, ": Value is no longer missing.");
     else
-      ssnprintf(buf, bufsize, ": All data sources are within range again. "
-                              "Current value of \"%s\" is %f.",
+      ssnprintf(buf, bufsize,
+                ": All data sources are within range again. "
+                "Current value of \"%s\" is %f.",
                 ds->ds[ds_index].name, values[ds_index]);
   } else if (state == STATE_UNKNOWN) {
     ERROR("ut_report_state: metric transition to UNKNOWN from a different "
                 ds->ds[ds_index].name, values[ds_index]);
   } else if (state == STATE_UNKNOWN) {
     ERROR("ut_report_state: metric transition to UNKNOWN from a different "
@@ -391,8 +392,9 @@ static int ut_report_state(const data_set_t *ds, const value_list_t *vl,
                   ((th->flags & UT_FLAG_PERCENTAGE) != 0) ? "%" : "", max,
                   ((th->flags & UT_FLAG_PERCENTAGE) != 0) ? "%" : "");
       } else {
                   ((th->flags & UT_FLAG_PERCENTAGE) != 0) ? "%" : "", max,
                   ((th->flags & UT_FLAG_PERCENTAGE) != 0) ? "%" : "");
       } else {
-        ssnprintf(buf, bufsize, ": Data source \"%s\" is currently "
-                                "%f. That is %s the %s threshold of %f%s.",
+        ssnprintf(buf, bufsize,
+                  ": Data source \"%s\" is currently "
+                  "%f. That is %s the %s threshold of %f%s.",
                   ds->ds[ds_index].name, values[ds_index],
                   isnan(min) ? "below" : "above",
                   (state == STATE_ERROR) ? "failure" : "warning",
                   ds->ds[ds_index].name, values[ds_index],
                   isnan(min) ? "below" : "above",
                   (state == STATE_ERROR) ? "failure" : "warning",
@@ -425,8 +427,9 @@ static int ut_report_state(const data_set_t *ds, const value_list_t *vl,
                 (value < min) ? min : max);
     } else /* is not inverted */
     {
                 (value < min) ? min : max);
     } else /* is not inverted */
     {
-      ssnprintf(buf, bufsize, ": Data source \"%s\" is currently "
-                              "%f. That is %s the %s threshold of %f.",
+      ssnprintf(buf, bufsize,
+                ": Data source \"%s\" is currently "
+                "%f. That is %s the %s threshold of %f.",
                 ds->ds[ds_index].name, values[ds_index],
                 (values[ds_index] < min) ? "below" : "above",
                 (state == STATE_ERROR) ? "failure" : "warning",
                 ds->ds[ds_index].name, values[ds_index],
                 (values[ds_index] < min) ? "below" : "above",
                 (state == STATE_ERROR) ? "failure" : "warning",
index ce57942..9465ddc 100644 (file)
@@ -1434,9 +1434,9 @@ static void free_all_buffers(void) {
   package_delta = NULL;
 }
 
   package_delta = NULL;
 }
 
-/**********************
- * Collectd functions *
- **********************/
+  /**********************
  * Collectd functions *
  **********************/
 
 #define DO_OR_GOTO_ERR(something)                                              \
   do {                                                                         \
 
 #define DO_OR_GOTO_ERR(something)                                              \
   do {                                                                         \
index dd33ab3..0892bda 100644 (file)
@@ -96,7 +96,7 @@ static time_t uptime_get_sys(void) { /* {{{ */
   }
 
   result = (time_t)info.uptime;
   }
 
   result = (time_t)info.uptime;
-/* #endif KERNEL_LINUX */
+  /* #endif KERNEL_LINUX */
 
 #elif HAVE_LIBKSTAT
   kstat_t *ksp;
 
 #elif HAVE_LIBKSTAT
   kstat_t *ksp;
@@ -136,7 +136,7 @@ static time_t uptime_get_sys(void) { /* {{{ */
   }
 
   result = time(NULL) - (time_t)knp->value.ui32;
   }
 
   result = time(NULL) - (time_t)knp->value.ui32;
-/* #endif HAVE_LIBKSTAT */
+  /* #endif HAVE_LIBKSTAT */
 
 #elif HAVE_SYS_SYSCTL_H
   struct timeval boottv = {0};
 
 #elif HAVE_SYS_SYSCTL_H
   struct timeval boottv = {0};
@@ -161,7 +161,7 @@ static time_t uptime_get_sys(void) { /* {{{ */
   }
 
   result = time(NULL) - boottv.tv_sec;
   }
 
   result = time(NULL) - boottv.tv_sec;
-/* #endif HAVE_SYS_SYSCTL_H */
+  /* #endif HAVE_SYS_SYSCTL_H */
 
 #elif HAVE_PERFSTAT
   int status;
 
 #elif HAVE_PERFSTAT
   int status;
index fc03ba2..768d488 100644 (file)
@@ -71,7 +71,7 @@ static int users_read(void) {
   endutxent();
 
   users_submit(users);
   endutxent();
 
   users_submit(users);
-/* #endif HAVE_GETUTXENT */
+  /* #endif HAVE_GETUTXENT */
 
 #elif HAVE_GETUTENT
   unsigned int users = 0;
 
 #elif HAVE_GETUTENT
   unsigned int users = 0;
@@ -89,7 +89,7 @@ static int users_read(void) {
   endutent();
 
   users_submit(users);
   endutent();
 
   users_submit(users);
-/* #endif HAVE_GETUTENT */
+  /* #endif HAVE_GETUTENT */
 
 #elif HAVE_LIBSTATGRAB
   sg_user_stats *us;
 
 #elif HAVE_LIBSTATGRAB
   sg_user_stats *us;
@@ -109,7 +109,7 @@ static int users_read(void) {
 #else
                    us->num_entries);
 #endif
 #else
                    us->num_entries);
 #endif
-/* #endif HAVE_LIBSTATGRAB */
+  /* #endif HAVE_LIBSTATGRAB */
 
 #else
 #error "No applicable input method."
 
 #else
 #error "No applicable input method."
index 6470b81..edbf5c9 100644 (file)
@@ -57,114 +57,201 @@ static struct {
 } parse_data[] = {
     /* Valid FLUSH commands. */
     {
 } parse_data[] = {
     /* Valid FLUSH commands. */
     {
-        "FLUSH", NULL, CMD_OK, CMD_FLUSH,
+        "FLUSH",
+        NULL,
+        CMD_OK,
+        CMD_FLUSH,
     },
     {
     },
     {
-        "FLUSH identifier=myhost/magic/MAGIC", NULL, CMD_OK, CMD_FLUSH,
+        "FLUSH identifier=myhost/magic/MAGIC",
+        NULL,
+        CMD_OK,
+        CMD_FLUSH,
     },
     {
     },
     {
-        "FLUSH identifier=magic/MAGIC", &default_host_opts, CMD_OK, CMD_FLUSH,
+        "FLUSH identifier=magic/MAGIC",
+        &default_host_opts,
+        CMD_OK,
+        CMD_FLUSH,
     },
     {
     },
     {
-        "FLUSH timeout=123 plugin=\"A\"", NULL, CMD_OK, CMD_FLUSH,
+        "FLUSH timeout=123 plugin=\"A\"",
+        NULL,
+        CMD_OK,
+        CMD_FLUSH,
     },
     /* Invalid FLUSH commands. */
     {
         /* Missing hostname; no default. */
     },
     /* Invalid FLUSH commands. */
     {
         /* Missing hostname; no default. */
-        "FLUSH identifier=magic/MAGIC", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "FLUSH identifier=magic/MAGIC",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
         /* Missing 'identifier' key. */
     },
     {
         /* Missing 'identifier' key. */
-        "FLUSH myhost/magic/MAGIC", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "FLUSH myhost/magic/MAGIC",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
         /* Invalid timeout. */
     },
     {
         /* Invalid timeout. */
-        "FLUSH timeout=A", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "FLUSH timeout=A",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
         /* Invalid identifier. */
     },
     {
         /* Invalid identifier. */
-        "FLUSH identifier=invalid", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "FLUSH identifier=invalid",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
         /* Invalid option. */
     },
     {
         /* Invalid option. */
-        "FLUSH invalid=option", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "FLUSH invalid=option",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
 
     /* Valid GETVAL commands. */
     {
     },
 
     /* Valid GETVAL commands. */
     {
-        "GETVAL myhost/magic/MAGIC", NULL, CMD_OK, CMD_GETVAL,
+        "GETVAL myhost/magic/MAGIC",
+        NULL,
+        CMD_OK,
+        CMD_GETVAL,
     },
     {
     },
     {
-        "GETVAL magic/MAGIC", &default_host_opts, CMD_OK, CMD_GETVAL,
+        "GETVAL magic/MAGIC",
+        &default_host_opts,
+        CMD_OK,
+        CMD_GETVAL,
     },
 
     /* Invalid GETVAL commands. */
     {
     },
 
     /* Invalid GETVAL commands. */
     {
-        "GETVAL magic/MAGIC", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "GETVAL magic/MAGIC",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
     },
     {
-        "GETVAL", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "GETVAL",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
     },
     {
-        "GETVAL invalid", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "GETVAL invalid",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
 
     /* Valid LISTVAL commands. */
     {
     },
 
     /* Valid LISTVAL commands. */
     {
-        "LISTVAL", NULL, CMD_OK, CMD_LISTVAL,
+        "LISTVAL",
+        NULL,
+        CMD_OK,
+        CMD_LISTVAL,
     },
 
     /* Invalid LISTVAL commands. */
     {
     },
 
     /* Invalid LISTVAL commands. */
     {
-        "LISTVAL invalid", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "LISTVAL invalid",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
 
     /* Valid PUTVAL commands. */
     {
     },
 
     /* Valid PUTVAL commands. */
     {
-        "PUTVAL magic/MAGIC N:42", &default_host_opts, CMD_OK, CMD_PUTVAL,
+        "PUTVAL magic/MAGIC N:42",
+        &default_host_opts,
+        CMD_OK,
+        CMD_PUTVAL,
     },
     {
     },
     {
-        "PUTVAL myhost/magic/MAGIC N:42", NULL, CMD_OK, CMD_PUTVAL,
+        "PUTVAL myhost/magic/MAGIC N:42",
+        NULL,
+        CMD_OK,
+        CMD_PUTVAL,
     },
     {
     },
     {
-        "PUTVAL myhost/magic/MAGIC 1234:42", NULL, CMD_OK, CMD_PUTVAL,
+        "PUTVAL myhost/magic/MAGIC 1234:42",
+        NULL,
+        CMD_OK,
+        CMD_PUTVAL,
     },
     {
     },
     {
-        "PUTVAL myhost/magic/MAGIC 1234:42 2345:23", NULL, CMD_OK, CMD_PUTVAL,
+        "PUTVAL myhost/magic/MAGIC 1234:42 2345:23",
+        NULL,
+        CMD_OK,
+        CMD_PUTVAL,
     },
     {
     },
     {
-        "PUTVAL myhost/magic/MAGIC interval=2 1234:42", NULL, CMD_OK,
+        "PUTVAL myhost/magic/MAGIC interval=2 1234:42",
+        NULL,
+        CMD_OK,
         CMD_PUTVAL,
     },
     {
         CMD_PUTVAL,
     },
     {
-        "PUTVAL myhost/magic/MAGIC interval=2 1234:42 interval=5 2345:23", NULL,
-        CMD_OK, CMD_PUTVAL,
+        "PUTVAL myhost/magic/MAGIC interval=2 1234:42 interval=5 2345:23",
+        NULL,
+        CMD_OK,
+        CMD_PUTVAL,
     },
 
     /* Invalid PUTVAL commands. */
     {
     },
 
     /* Invalid PUTVAL commands. */
     {
-        "PUTVAL magic/MAGIC N:42", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "PUTVAL magic/MAGIC N:42",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
     },
     {
-        "PUTVAL", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "PUTVAL",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
     },
     {
-        "PUTVAL invalid N:42", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "PUTVAL invalid N:42",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
     },
     {
-        "PUTVAL myhost/magic/MAGIC A:42", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "PUTVAL myhost/magic/MAGIC A:42",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
     },
     {
-        "PUTVAL myhost/magic/MAGIC 1234:A", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "PUTVAL myhost/magic/MAGIC 1234:A",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
     },
     {
-        "PUTVAL myhost/magic/MAGIC", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "PUTVAL myhost/magic/MAGIC",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
     },
     {
-        "PUTVAL 1234:A", NULL, CMD_PARSE_ERROR, CMD_UNKNOWN,
+        "PUTVAL 1234:A",
+        NULL,
+        CMD_PARSE_ERROR,
+        CMD_UNKNOWN,
     },
     {
     },
     {
-        "PUTVAL myhost/magic/UNKNOWN 1234:42", NULL, CMD_PARSE_ERROR,
+        "PUTVAL myhost/magic/UNKNOWN 1234:42",
+        NULL,
+        CMD_PARSE_ERROR,
         CMD_UNKNOWN,
     },
     /*
         CMD_UNKNOWN,
     },
     /*
@@ -179,10 +266,16 @@ static struct {
 
     /* Invalid commands. */
     {
 
     /* Invalid commands. */
     {
-        "INVALID", NULL, CMD_UNKNOWN_COMMAND, CMD_UNKNOWN,
+        "INVALID",
+        NULL,
+        CMD_UNKNOWN_COMMAND,
+        CMD_UNKNOWN,
     },
     {
     },
     {
-        "INVALID interval=2", NULL, CMD_UNKNOWN_COMMAND, CMD_UNKNOWN,
+        "INVALID interval=2",
+        NULL,
+        CMD_UNKNOWN_COMMAND,
+        CMD_UNKNOWN,
     },
 };
 
     },
 };
 
@@ -202,9 +295,10 @@ DEF_TEST(parse) {
     memset(&cmd, 0, sizeof(cmd));
 
     status = cmd_parse(input, &cmd, parse_data[i].opts, &err);
     memset(&cmd, 0, sizeof(cmd));
 
     status = cmd_parse(input, &cmd, parse_data[i].opts, &err);
-    ssnprintf(description, sizeof(description), "cmd_parse (\"%s\", opts=%p) = "
-                                                "%d (type=%d [%s]); want %d "
-                                                "(type=%d [%s])",
+    ssnprintf(description, sizeof(description),
+              "cmd_parse (\"%s\", opts=%p) = "
+              "%d (type=%d [%s]); want %d "
+              "(type=%d [%s])",
               parse_data[i].input, parse_data[i].opts, status, cmd.type,
               CMD_TO_STRING(cmd.type), parse_data[i].expected_status,
               parse_data[i].expected_type,
               parse_data[i].input, parse_data[i].opts, status, cmd.type,
               CMD_TO_STRING(cmd.type), parse_data[i].expected_status,
               parse_data[i].expected_type,
index 6ee4e08..7cfd310 100644 (file)
@@ -181,7 +181,7 @@ char *sstrerror(int errnum, char *buf, size_t buflen) {
 
     pthread_mutex_unlock(&strerror_r_lock);
   }
 
     pthread_mutex_unlock(&strerror_r_lock);
   }
-/* #endif !HAVE_STRERROR_R */
+    /* #endif !HAVE_STRERROR_R */
 
 #elif STRERROR_R_CHAR_P
   {
 
 #elif STRERROR_R_CHAR_P
   {
@@ -191,17 +191,19 @@ char *sstrerror(int errnum, char *buf, size_t buflen) {
       if ((temp != NULL) && (temp != buf) && (temp[0] != '\0'))
         sstrncpy(buf, temp, buflen);
       else
       if ((temp != NULL) && (temp != buf) && (temp[0] != '\0'))
         sstrncpy(buf, temp, buflen);
       else
-        sstrncpy(buf, "strerror_r did not return "
-                      "an error message",
+        sstrncpy(buf,
+                 "strerror_r did not return "
+                 "an error message",
                  buflen);
     }
   }
                  buflen);
     }
   }
-/* #endif STRERROR_R_CHAR_P */
+    /* #endif STRERROR_R_CHAR_P */
 
 #else
   if (strerror_r(errnum, buf, buflen) != 0) {
 
 #else
   if (strerror_r(errnum, buf, buflen) != 0) {
-    snprintf(buf, buflen, "Error #%i; "
-                          "Additionally, strerror_r failed.",
+    snprintf(buf, buflen,
+             "Error #%i; "
+             "Additionally, strerror_r failed.",
              errnum);
   }
 #endif /* STRERROR_R_CHAR_P */
              errnum);
   }
 #endif /* STRERROR_R_CHAR_P */
@@ -767,8 +769,8 @@ unsigned long long htonll(unsigned long long n) {
 #endif /* HAVE_HTONLL */
 
 #if FP_LAYOUT_NEED_NOTHING
 #endif /* HAVE_HTONLL */
 
 #if FP_LAYOUT_NEED_NOTHING
-/* Well, we need nothing.. */
-/* #endif FP_LAYOUT_NEED_NOTHING */
+  /* Well, we need nothing.. */
+  /* #endif FP_LAYOUT_NEED_NOTHING */
 
 #elif FP_LAYOUT_NEED_ENDIANFLIP || FP_LAYOUT_NEED_INTSWAP
 #if FP_LAYOUT_NEED_ENDIANFLIP
 
 #elif FP_LAYOUT_NEED_ENDIANFLIP || FP_LAYOUT_NEED_INTSWAP
 #if FP_LAYOUT_NEED_ENDIANFLIP
index 6efdcea..981828d 100644 (file)
@@ -466,7 +466,7 @@ static int handle_ipv6(struct ip6_hdr *ipv6, int len) {
 
   return 1; /* Success */
 } /* int handle_ipv6 */
 
   return 1; /* Success */
 } /* int handle_ipv6 */
-/* #endif HAVE_IPV6 */
+  /* #endif HAVE_IPV6 */
 
 #else  /* if !HAVE_IPV6 */
 static int handle_ipv6(__attribute__((unused)) void *pkg,
 
 #else  /* if !HAVE_IPV6 */
 static int handle_ipv6(__attribute__((unused)) void *pkg,
index efc39da..7d9f7ab 100644 (file)
@@ -704,7 +704,8 @@ static void dpdk_helper_check_pipe(dpdk_helper_ctx_t *phc) {
 
   /* non blocking check on helper logging pipe */
   struct pollfd fds = {
 
   /* non blocking check on helper logging pipe */
   struct pollfd fds = {
-      .fd = phc->pipes[0], .events = POLLIN,
+      .fd = phc->pipes[0],
+      .events = POLLIN,
   };
   int data_avail = poll(&fds, 1, 0);
   DEBUG("%s:dpdk_helper_check_pipe: poll data_avail=%d", phc->shm_name,
   };
   int data_avail = poll(&fds, 1, 0);
   DEBUG("%s:dpdk_helper_check_pipe: poll data_avail=%d", phc->shm_name,
index b82f21d..ac3729a 100644 (file)
@@ -578,12 +578,11 @@ static int format_alert(yajl_gen g, notification_t const *n) /* {{{ */
   }
 
   JSON_ADD(g, "severity");
   }
 
   JSON_ADD(g, "severity");
-  JSON_ADD(g,
-           (n->severity == NOTIF_FAILURE)
-               ? "FAILURE"
-               : (n->severity == NOTIF_WARNING)
-                     ? "WARNING"
-                     : (n->severity == NOTIF_OKAY) ? "OKAY" : "UNKNOWN");
+  JSON_ADD(g, (n->severity == NOTIF_FAILURE)
+                  ? "FAILURE"
+                  : (n->severity == NOTIF_WARNING)
+                        ? "WARNING"
+                        : (n->severity == NOTIF_OKAY) ? "OKAY" : "UNKNOWN");
 
   JSON_ADD(g, "service");
   JSON_ADD(g, "collectd");
 
   JSON_ADD(g, "service");
   JSON_ADD(g, "collectd");
index d041604..30c89bb 100644 (file)
@@ -131,7 +131,8 @@ static int test_string(void *ctx, unsigned char const *value,
 
 static int expect_json_labels(char *json, label_t *labels, size_t labels_num) {
   yajl_callbacks funcs = {
 
 static int expect_json_labels(char *json, label_t *labels, size_t labels_num) {
   yajl_callbacks funcs = {
-      .yajl_string = test_string, .yajl_map_key = test_map_key,
+      .yajl_string = test_string,
+      .yajl_map_key = test_map_key,
   };
 
   test_case_t c = {labels, labels_num, NULL};
   };
 
   test_case_t c = {labels, labels_num, NULL};
index d4935a3..0a4f268 100644 (file)
@@ -27,7 +27,9 @@
 
 DEF_TEST(sd_format_metric_descriptor) {
   value_list_t vl = {
 
 DEF_TEST(sd_format_metric_descriptor) {
   value_list_t vl = {
-      .host = "example.com", .plugin = "unit-test", .type = "example",
+      .host = "example.com",
+      .plugin = "unit-test",
+      .type = "example",
   };
   char got[1024];
 
   };
   char got[1024];
 
@@ -36,7 +38,10 @@ DEF_TEST(sd_format_metric_descriptor) {
       .ds_num = 1,
       .ds =
           &(data_source_t){
       .ds_num = 1,
       .ds =
           &(data_source_t){
-              .name = "value", .type = DS_TYPE_GAUGE, .min = NAN, .max = NAN,
+              .name = "value",
+              .type = DS_TYPE_GAUGE,
+              .min = NAN,
+              .max = NAN,
           },
   };
   EXPECT_EQ_INT(
           },
   };
   EXPECT_EQ_INT(
index 12ff2ca..e32c97b 100644 (file)
@@ -56,22 +56,22 @@ struct latency_counter_s {
 };
 
 /*
 };
 
 /*
-* Histogram represents the distribution of data, it has a list of "bins".
-* Each bin represents an interval and has a count (frequency) of
-* number of values fall within its interval.
-*
-* Histogram's range is determined by the number of bins and the bin width,
-* There are 1000 bins and all bins have the same width of default 1 millisecond.
-* When a value above this range is added, Histogram's range is increased by
-* increasing the bin width (note that number of bins remains always at 1000).
-* This operation of increasing bin width is little expensive as each bin need
-* to be visited to update its count. To reduce frequent change of bin width,
-* new bin width will be the next nearest power of 2. Example: 2, 4, 8, 16, 32,
-* 64, 128, 256, 512, 1024, 2048, 5086, ...
-*
-* So, if the required bin width is 300, then new bin width will be 512 as it is
-* the next nearest power of 2.
-*/
+ * Histogram represents the distribution of data, it has a list of "bins".
+ * Each bin represents an interval and has a count (frequency) of
+ * number of values fall within its interval.
+ *
+ * Histogram's range is determined by the number of bins and the bin width,
+ * There are 1000 bins and all bins have the same width of default 1
+ * millisecond. When a value above this range is added, Histogram's range is
+ * increased by increasing the bin width (note that number of bins remains
+ * always at 1000). This operation of increasing bin width is little expensive
+ * as each bin need to be visited to update its count. To reduce frequent change
+ * of bin width, new bin width will be the next nearest power of 2. Example: 2,
+ * 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 5086, ...
+ *
+ * So, if the required bin width is 300, then new bin width will be 512 as it is
+ * the next nearest power of 2.
+ */
 static void change_bin_width(latency_counter_t *lc, cdtime_t latency) /* {{{ */
 {
   /* This function is called because the new value is above histogram's range.
 static void change_bin_width(latency_counter_t *lc, cdtime_t latency) /* {{{ */
 {
   /* This function is called because the new value is above histogram's range.
index a5ae471..7d614e7 100644 (file)
@@ -124,7 +124,8 @@ int latency_config(latency_config_t *conf, oconfig_item_t *ci) {
 
 int latency_config_copy(latency_config_t *dst, const latency_config_t src) {
   *dst = (latency_config_t){
 
 int latency_config_copy(latency_config_t *dst, const latency_config_t src) {
   *dst = (latency_config_t){
-      .percentile_num = src.percentile_num, .buckets_num = src.buckets_num,
+      .percentile_num = src.percentile_num,
+      .buckets_num = src.buckets_num,
   };
 
   dst->percentile = calloc(dst->percentile_num, sizeof(*dst->percentile));
   };
 
   dst->percentile = calloc(dst->percentile_num, sizeof(*dst->percentile));
index 1325017..8954463 100644 (file)
@@ -159,58 +159,75 @@ DEF_TEST(get_rate) {
   } cases[] = {
       {
           // bucket 6 is zero
   } cases[] = {
       {
           // bucket 6 is zero
-          DOUBLE_TO_CDTIME_T_STATIC(0.750), DOUBLE_TO_CDTIME_T_STATIC(0.875),
+          DOUBLE_TO_CDTIME_T_STATIC(0.750),
+          DOUBLE_TO_CDTIME_T_STATIC(0.875),
           0.00,
       },
       {
           // bucket 7 contains the t=1 update
           0.00,
       },
       {
           // bucket 7 contains the t=1 update
-          DOUBLE_TO_CDTIME_T_STATIC(0.875), DOUBLE_TO_CDTIME_T_STATIC(1.000),
+          DOUBLE_TO_CDTIME_T_STATIC(0.875),
+          DOUBLE_TO_CDTIME_T_STATIC(1.000),
           1.00,
       },
       {
           // range: bucket 7 - bucket 15; contains the t=1 and t=2 updates
           1.00,
       },
       {
           // range: bucket 7 - bucket 15; contains the t=1 and t=2 updates
-          DOUBLE_TO_CDTIME_T_STATIC(0.875), DOUBLE_TO_CDTIME_T_STATIC(2.000),
+          DOUBLE_TO_CDTIME_T_STATIC(0.875),
+          DOUBLE_TO_CDTIME_T_STATIC(2.000),
           2.00,
       },
       {
           // lower bucket is only partially applied
           DOUBLE_TO_CDTIME_T_STATIC(0.875 + (0.125 / 4)),
           2.00,
       },
       {
           // lower bucket is only partially applied
           DOUBLE_TO_CDTIME_T_STATIC(0.875 + (0.125 / 4)),
-          DOUBLE_TO_CDTIME_T_STATIC(2.000), 1.75,
+          DOUBLE_TO_CDTIME_T_STATIC(2.000),
+          1.75,
       },
       {
           // upper bucket is only partially applied
           DOUBLE_TO_CDTIME_T_STATIC(0.875),
       },
       {
           // upper bucket is only partially applied
           DOUBLE_TO_CDTIME_T_STATIC(0.875),
-          DOUBLE_TO_CDTIME_T_STATIC(2.000 - (0.125 / 4)), 1.75,
+          DOUBLE_TO_CDTIME_T_STATIC(2.000 - (0.125 / 4)),
+          1.75,
       },
       {
           // both buckets are only partially applied
           DOUBLE_TO_CDTIME_T_STATIC(0.875 + (0.125 / 4)),
       },
       {
           // both buckets are only partially applied
           DOUBLE_TO_CDTIME_T_STATIC(0.875 + (0.125 / 4)),
-          DOUBLE_TO_CDTIME_T_STATIC(2.000 - (0.125 / 4)), 1.50,
+          DOUBLE_TO_CDTIME_T_STATIC(2.000 - (0.125 / 4)),
+          1.50,
       },
       {
           // lower bound is unspecified
       },
       {
           // lower bound is unspecified
-          0, DOUBLE_TO_CDTIME_T_STATIC(2.000), 2.00,
+          0,
+          DOUBLE_TO_CDTIME_T_STATIC(2.000),
+          2.00,
       },
       {
           // upper bound is unspecified
       },
       {
           // upper bound is unspecified
-          DOUBLE_TO_CDTIME_T_STATIC(125.000 - 0.125), 0, 1.00,
+          DOUBLE_TO_CDTIME_T_STATIC(125.000 - 0.125),
+          0,
+          1.00,
       },
       {
           // overflow test: upper >> longest latency
       },
       {
           // overflow test: upper >> longest latency
-          DOUBLE_TO_CDTIME_T_STATIC(1.000), DOUBLE_TO_CDTIME_T_STATIC(999999),
+          DOUBLE_TO_CDTIME_T_STATIC(1.000),
+          DOUBLE_TO_CDTIME_T_STATIC(999999),
           124.00,
       },
       {
           // overflow test: lower > longest latency
           124.00,
       },
       {
           // overflow test: lower > longest latency
-          DOUBLE_TO_CDTIME_T_STATIC(130), 0, 0.00,
+          DOUBLE_TO_CDTIME_T_STATIC(130),
+          0,
+          0.00,
       },
       {
           // lower > upper => error
       },
       {
           // lower > upper => error
-          DOUBLE_TO_CDTIME_T_STATIC(10), DOUBLE_TO_CDTIME_T_STATIC(9), NAN,
+          DOUBLE_TO_CDTIME_T_STATIC(10),
+          DOUBLE_TO_CDTIME_T_STATIC(9),
+          NAN,
       },
       {
           // lower == upper => zero
       },
       {
           // lower == upper => zero
-          DOUBLE_TO_CDTIME_T_STATIC(9), DOUBLE_TO_CDTIME_T_STATIC(9), 0.00,
+          DOUBLE_TO_CDTIME_T_STATIC(9),
+          DOUBLE_TO_CDTIME_T_STATIC(9),
+          0.00,
       },
   };
 
       },
   };
 
index 319c624..1d362e1 100644 (file)
@@ -18,7 +18,7 @@
  *
  * Author:
  *   Niki W. Waibel <niki.waibel@gmx.net>
  *
  * Author:
  *   Niki W. Waibel <niki.waibel@gmx.net>
-**/
+ **/
 
 #if HAVE_CONFIG_H
 #include "config.h"
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -250,14 +250,14 @@ static void uuidcache_init(void) {
 
       if (isdigit((int)s[-1])) {
         /*
 
       if (isdigit((int)s[-1])) {
         /*
-        * Note: this is a heuristic only - there is no reason
-        * why these devices should live in /dev.
-        * Perhaps this directory should be specifiable by option.
-        * One might for example have /devlabel with links to /dev
-        * for the devices that may be accessed in this way.
-        * (This is useful, if the cdrom on /dev/hdc must not
-        * be accessed.)
-        */
+         * Note: this is a heuristic only - there is no reason
+         * why these devices should live in /dev.
+         * Perhaps this directory should be specifiable by option.
+         * One might for example have /devlabel with links to /dev
+         * for the devices that may be accessed in this way.
+         * (This is useful, if the cdrom on /dev/hdc must not
+         * be accessed.)
+         */
         snprintf(device, sizeof(device), "%s/%s", DEVLABELDIR, ptname);
         if (!get_label_uuid(device, &label, uuid)) {
           uuidcache_addentry(sstrdup(device), label, uuid);
         snprintf(device, sizeof(device), "%s/%s", DEVLABELDIR, ptname);
         if (!get_label_uuid(device, &label, uuid)) {
           uuidcache_addentry(sstrdup(device), label, uuid);
@@ -522,7 +522,7 @@ static cu_mount_t *cu_mount_gen_getmntent(void) {
 
 #elif HAVE_SEQ_GETMNTENT
 #warn "This version of `getmntent' hat not yet been implemented!"
 
 #elif HAVE_SEQ_GETMNTENT
 #warn "This version of `getmntent' hat not yet been implemented!"
-/* #endif HAVE_SEQ_GETMNTENT */
+  /* #endif HAVE_SEQ_GETMNTENT */
 
 #elif HAVE_GETMNTENT_R
 static cu_mount_t *cu_mount_getmntent(void) {
 
 #elif HAVE_GETMNTENT_R
 static cu_mount_t *cu_mount_getmntent(void) {
index 5bae546..05adcc3 100644 (file)
@@ -18,7 +18,7 @@
  *
  * Author:
  *   Niki W. Waibel <niki.waibel@gmx.net>
  *
  * Author:
  *   Niki W. Waibel <niki.waibel@gmx.net>
-**/
+ **/
 
 /* See below for instructions how to use the public functions. */
 
 
 /* See below for instructions how to use the public functions. */
 
index aa6e99a..36f2125 100644 (file)
@@ -35,21 +35,29 @@ struct {
 } cases[] = {
     {
         "{\"access_token\":\"MaeC6kaePhie1ree\",\"expires_in\":3600}",
 } cases[] = {
     {
         "{\"access_token\":\"MaeC6kaePhie1ree\",\"expires_in\":3600}",
-        /* status = */ 0, "MaeC6kaePhie1ree", TIME_T_TO_CDTIME_T_STATIC(3600),
+        /* status = */ 0,
+        "MaeC6kaePhie1ree",
+        TIME_T_TO_CDTIME_T_STATIC(3600),
     },
     {
         "{\"token_type\":\"Bearer\",\"expires_in\":1800,\"access_token\":"
         "\"aeThiebee2gushuY\"}",
     },
     {
         "{\"token_type\":\"Bearer\",\"expires_in\":1800,\"access_token\":"
         "\"aeThiebee2gushuY\"}",
-        /* status = */ 0, "aeThiebee2gushuY", TIME_T_TO_CDTIME_T_STATIC(1800),
+        /* status = */ 0,
+        "aeThiebee2gushuY",
+        TIME_T_TO_CDTIME_T_STATIC(1800),
     },
     {
         "{\"ignored_key\":\"uaph5aewaeghi1Ge\",\"expires_in\":3600}",
     },
     {
         "{\"ignored_key\":\"uaph5aewaeghi1Ge\",\"expires_in\":3600}",
-        /* status = */ -1, NULL, 0,
+        /* status = */ -1,
+        NULL,
+        0,
     },
     {
         /* expires_in missing */
         "{\"access_token\":\"shaephohbie9Ahch\"}",
     },
     {
         /* expires_in missing */
         "{\"access_token\":\"shaephohbie9Ahch\"}",
-        /* status = */ -1, NULL, 0,
+        /* status = */ -1,
+        NULL,
+        0,
     },
 };
 
     },
 };
 
index 336a996..fb30172 100644 (file)
@@ -140,7 +140,7 @@ int pids_list_contains_pid(pids_list_t *list, const pid_t pid) {
  * RETURN VALUE
  *   On success, the number of read bytes (includes stripped \n).
  *   -1 on file open error
  * RETURN VALUE
  *   On success, the number of read bytes (includes stripped \n).
  *   -1 on file open error
-*/
+ */
 static int read_proc_name(const char *procfs_path,
                           const struct dirent *pid_entry, char *name,
                           const size_t out_size) {
 static int read_proc_name(const char *procfs_path,
                           const struct dirent *pid_entry, char *name,
                           const size_t out_size) {
index 7a2867c..f543e11 100644 (file)
@@ -343,7 +343,7 @@ static int srrd_create(const char *filename, /* {{{ */
 
   return status;
 } /* }}} int srrd_create */
 
   return status;
 } /* }}} int srrd_create */
-/* #endif HAVE_THREADSAFE_LIBRRD */
+  /* #endif HAVE_THREADSAFE_LIBRRD */
 
 #else  /* !HAVE_THREADSAFE_LIBRRD */
 static int srrd_create(const char *filename, /* {{{ */
 
 #else  /* !HAVE_THREADSAFE_LIBRRD */
 static int srrd_create(const char *filename, /* {{{ */
index b020c06..348f93f 100644 (file)
@@ -188,7 +188,8 @@ static int get_family_id(ts_t *ts) {
 
   struct genlmsghdr *genh = mnl_nlmsg_put_extra_header(nlh, sizeof(*genh));
   *genh = (struct genlmsghdr){
 
   struct genlmsghdr *genh = mnl_nlmsg_put_extra_header(nlh, sizeof(*genh));
   *genh = (struct genlmsghdr){
-      .cmd = CTRL_CMD_GETFAMILY, .version = 0x01,
+      .cmd = CTRL_CMD_GETFAMILY,
+      .version = 0x01,
   };
 
   mnl_attr_put_strz(nlh, CTRL_ATTR_FAMILY_NAME, TASKSTATS_GENL_NAME);
   };
 
   mnl_attr_put_strz(nlh, CTRL_ATTR_FAMILY_NAME, TASKSTATS_GENL_NAME);
index 0217a7e..43d3fcf 100644 (file)
@@ -131,5 +131,5 @@ int tail_match_add_match_simple(cu_tail_match_t *obj, const char *regex,
  *
  * RETURN VALUE
  *   Zero on success, nonzero on failure.
  *
  * RETURN VALUE
  *   Zero on success, nonzero on failure.
-*/
+ */
 int tail_match_read(cu_tail_match_t *obj);
 int tail_match_read(cu_tail_match_t *obj);
index 4200c21..f4c70af 100644 (file)
@@ -1546,7 +1546,8 @@ static int varnish_init(void) /* {{{ */
       /* callback  = */ varnish_read,
       /* interval  = */ 0,
       &(user_data_t){
       /* callback  = */ varnish_read,
       /* interval  = */ 0,
       &(user_data_t){
-          .data = conf, .free_func = varnish_config_free,
+          .data = conf,
+          .free_func = varnish_config_free,
       });
 
   return 0;
       });
 
   return 0;
@@ -1751,7 +1752,7 @@ static int varnish_config_instance(const oconfig_item_t *ci) /* {{{ */
       !conf->collect_mgt && !conf->collect_lck && !conf->collect_mempool &&
       !conf->collect_mse
 #endif
       !conf->collect_mgt && !conf->collect_lck && !conf->collect_mempool &&
       !conf->collect_mse
 #endif
-      ) {
+  ) {
     WARNING("Varnish plugin: No metric has been configured for "
             "instance \"%s\". Disabling this instance.",
             (conf->instance == NULL) ? "localhost" : conf->instance);
     WARNING("Varnish plugin: No metric has been configured for "
             "instance \"%s\". Disabling this instance.",
             (conf->instance == NULL) ? "localhost" : conf->instance);
@@ -1768,7 +1769,8 @@ static int varnish_config_instance(const oconfig_item_t *ci) /* {{{ */
       /* callback  = */ varnish_read,
       /* interval  = */ 0,
       &(user_data_t){
       /* callback  = */ varnish_read,
       /* interval  = */ 0,
       &(user_data_t){
-          .data = conf, .free_func = varnish_config_free,
+          .data = conf,
+          .free_func = varnish_config_free,
       });
 
   have_instance = true;
       });
 
   have_instance = true;
index 7e1c866..5c894c2 100644 (file)
@@ -131,16 +131,16 @@ static bool report_network_interfaces = true;
 static virt_notif_thread_t notif_thread;
 
 const char *domain_states[] = {
 static virt_notif_thread_t notif_thread;
 
 const char *domain_states[] = {
-        [VIR_DOMAIN_NOSTATE] = "no state",
-        [VIR_DOMAIN_RUNNING] = "the domain is running",
-        [VIR_DOMAIN_BLOCKED] = "the domain is blocked on resource",
-        [VIR_DOMAIN_PAUSED] = "the domain is paused by user",
-        [VIR_DOMAIN_SHUTDOWN] = "the domain is being shut down",
-        [VIR_DOMAIN_SHUTOFF] = "the domain is shut off",
-        [VIR_DOMAIN_CRASHED] = "the domain is crashed",
+    [VIR_DOMAIN_NOSTATE] = "no state",
+    [VIR_DOMAIN_RUNNING] = "the domain is running",
+    [VIR_DOMAIN_BLOCKED] = "the domain is blocked on resource",
+    [VIR_DOMAIN_PAUSED] = "the domain is paused by user",
+    [VIR_DOMAIN_SHUTDOWN] = "the domain is being shut down",
+    [VIR_DOMAIN_SHUTOFF] = "the domain is shut off",
+    [VIR_DOMAIN_CRASHED] = "the domain is crashed",
 #ifdef HAVE_DOM_STATE_PMSUSPENDED
 #ifdef HAVE_DOM_STATE_PMSUSPENDED
-        [VIR_DOMAIN_PMSUSPENDED] =
-            "the domain is suspended by guest power management",
+    [VIR_DOMAIN_PMSUSPENDED] =
+        "the domain is suspended by guest power management",
 #endif
 };
 
 #endif
 };
 
@@ -352,107 +352,99 @@ static int map_domain_event_detail_to_reason(int event, int detail) {
 
 #define DOMAIN_STATE_REASON_MAX_SIZE 20
 const char *domain_reasons[][DOMAIN_STATE_REASON_MAX_SIZE] = {
 
 #define DOMAIN_STATE_REASON_MAX_SIZE 20
 const char *domain_reasons[][DOMAIN_STATE_REASON_MAX_SIZE] = {
-        [VIR_DOMAIN_NOSTATE][VIR_DOMAIN_NOSTATE_UNKNOWN] =
-            "the reason is unknown",
-
-        [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_UNKNOWN] =
-            "the reason is unknown",
-        [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_BOOTED] =
-            "normal startup from boot",
-        [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_MIGRATED] =
-            "migrated from another host",
-        [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_RESTORED] =
-            "restored from a state file",
-        [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_FROM_SNAPSHOT] =
-            "restored from snapshot",
-        [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_UNPAUSED] =
-            "returned from paused state",
-        [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_MIGRATION_CANCELED] =
-            "returned from migration",
-        [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_SAVE_CANCELED] =
-            "returned from failed save process",
+    [VIR_DOMAIN_NOSTATE][VIR_DOMAIN_NOSTATE_UNKNOWN] = "the reason is unknown",
+
+    [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_UNKNOWN] = "the reason is unknown",
+    [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_BOOTED] =
+        "normal startup from boot",
+    [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_MIGRATED] =
+        "migrated from another host",
+    [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_RESTORED] =
+        "restored from a state file",
+    [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_FROM_SNAPSHOT] =
+        "restored from snapshot",
+    [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_UNPAUSED] =
+        "returned from paused state",
+    [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_MIGRATION_CANCELED] =
+        "returned from migration",
+    [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_SAVE_CANCELED] =
+        "returned from failed save process",
 #ifdef HAVE_DOM_REASON_RUNNING_WAKEUP
 #ifdef HAVE_DOM_REASON_RUNNING_WAKEUP
-        [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_WAKEUP] =
-            "returned from pmsuspended due to wakeup event",
+    [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_WAKEUP] =
+        "returned from pmsuspended due to wakeup event",
 #endif
 #ifdef HAVE_DOM_REASON_CRASHED
 #endif
 #ifdef HAVE_DOM_REASON_CRASHED
-        [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_CRASHED] =
-            "resumed from crashed",
+    [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_CRASHED] = "resumed from crashed",
 #endif
 #ifdef HAVE_DOM_REASON_POSTCOPY
 #endif
 #ifdef HAVE_DOM_REASON_POSTCOPY
-        [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_POSTCOPY] =
-            "running in post-copy migration mode",
-#endif
-        [VIR_DOMAIN_BLOCKED][VIR_DOMAIN_BLOCKED_UNKNOWN] =
-            "the reason is unknown",
-
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_UNKNOWN] =
-            "the reason is unknown",
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_USER] = "paused on user request",
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_MIGRATION] =
-            "paused for offline migration",
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_SAVE] = "paused for save",
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_DUMP] =
-            "paused for offline core dump",
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_IOERROR] =
-            "paused due to a disk I/O error",
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_WATCHDOG] =
-            "paused due to a watchdog event",
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_FROM_SNAPSHOT] =
-            "paused after restoring from snapshot",
+    [VIR_DOMAIN_RUNNING][VIR_DOMAIN_RUNNING_POSTCOPY] =
+        "running in post-copy migration mode",
+#endif
+    [VIR_DOMAIN_BLOCKED][VIR_DOMAIN_BLOCKED_UNKNOWN] = "the reason is unknown",
+
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_UNKNOWN] = "the reason is unknown",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_USER] = "paused on user request",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_MIGRATION] =
+        "paused for offline migration",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_SAVE] = "paused for save",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_DUMP] =
+        "paused for offline core dump",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_IOERROR] =
+        "paused due to a disk I/O error",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_WATCHDOG] =
+        "paused due to a watchdog event",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_FROM_SNAPSHOT] =
+        "paused after restoring from snapshot",
 #ifdef HAVE_DOM_REASON_PAUSED_SHUTTING_DOWN
 #ifdef HAVE_DOM_REASON_PAUSED_SHUTTING_DOWN
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_SHUTTING_DOWN] =
-            "paused during shutdown process",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_SHUTTING_DOWN] =
+        "paused during shutdown process",
 #endif
 #ifdef HAVE_DOM_REASON_PAUSED_SNAPSHOT
 #endif
 #ifdef HAVE_DOM_REASON_PAUSED_SNAPSHOT
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_SNAPSHOT] =
-            "paused while creating a snapshot",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_SNAPSHOT] =
+        "paused while creating a snapshot",
 #endif
 #ifdef HAVE_DOM_REASON_PAUSED_CRASHED
 #endif
 #ifdef HAVE_DOM_REASON_PAUSED_CRASHED
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_CRASHED] =
-            "paused due to a guest crash",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_CRASHED] =
+        "paused due to a guest crash",
 #endif
 #ifdef HAVE_DOM_REASON_PAUSED_STARTING_UP
 #endif
 #ifdef HAVE_DOM_REASON_PAUSED_STARTING_UP
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_STARTING_UP] =
-            "the domain is being started",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_STARTING_UP] =
+        "the domain is being started",
 #endif
 #ifdef HAVE_DOM_REASON_POSTCOPY
 #endif
 #ifdef HAVE_DOM_REASON_POSTCOPY
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_POSTCOPY] =
-            "paused for post-copy migration",
-        [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_POSTCOPY_FAILED] =
-            "paused after failed post-copy",
-#endif
-        [VIR_DOMAIN_SHUTDOWN][VIR_DOMAIN_SHUTDOWN_UNKNOWN] =
-            "the reason is unknown",
-        [VIR_DOMAIN_SHUTDOWN][VIR_DOMAIN_SHUTDOWN_USER] =
-            "shutting down on user request",
-
-        [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_UNKNOWN] =
-            "the reason is unknown",
-        [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_SHUTDOWN] = "normal shutdown",
-        [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_DESTROYED] = "forced poweroff",
-        [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_CRASHED] = "domain crashed",
-        [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_MIGRATED] =
-            "migrated to another host",
-        [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_SAVED] = "saved to a file",
-        [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_FAILED] =
-            "domain failed to start",
-        [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT] =
-            "restored from a snapshot which was taken while domain was shutoff",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_POSTCOPY] =
+        "paused for post-copy migration",
+    [VIR_DOMAIN_PAUSED][VIR_DOMAIN_PAUSED_POSTCOPY_FAILED] =
+        "paused after failed post-copy",
+#endif
+    [VIR_DOMAIN_SHUTDOWN][VIR_DOMAIN_SHUTDOWN_UNKNOWN] =
+        "the reason is unknown",
+    [VIR_DOMAIN_SHUTDOWN][VIR_DOMAIN_SHUTDOWN_USER] =
+        "shutting down on user request",
+
+    [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_UNKNOWN] = "the reason is unknown",
+    [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_SHUTDOWN] = "normal shutdown",
+    [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_DESTROYED] = "forced poweroff",
+    [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_CRASHED] = "domain crashed",
+    [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_MIGRATED] =
+        "migrated to another host",
+    [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_SAVED] = "saved to a file",
+    [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_FAILED] = "domain failed to start",
+    [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT] =
+        "restored from a snapshot which was taken while domain was shutoff",
 #ifdef HAVE_DOM_REASON_SHUTOFF_DAEMON
 #ifdef HAVE_DOM_REASON_SHUTOFF_DAEMON
-        [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_DAEMON] =
-            "daemon decides to kill domain during reconnection processing",
+    [VIR_DOMAIN_SHUTOFF][VIR_DOMAIN_SHUTOFF_DAEMON] =
+        "daemon decides to kill domain during reconnection processing",
 #endif
 
 #endif
 
-        [VIR_DOMAIN_CRASHED][VIR_DOMAIN_CRASHED_UNKNOWN] =
-            "the reason is unknown",
+    [VIR_DOMAIN_CRASHED][VIR_DOMAIN_CRASHED_UNKNOWN] = "the reason is unknown",
 #ifdef VIR_DOMAIN_CRASHED_PANICKED
 #ifdef VIR_DOMAIN_CRASHED_PANICKED
-        [VIR_DOMAIN_CRASHED][VIR_DOMAIN_CRASHED_PANICKED] = "domain panicked",
+    [VIR_DOMAIN_CRASHED][VIR_DOMAIN_CRASHED_PANICKED] = "domain panicked",
 #endif
 
 #ifdef HAVE_DOM_STATE_PMSUSPENDED
 #endif
 
 #ifdef HAVE_DOM_STATE_PMSUSPENDED
-        [VIR_DOMAIN_PMSUSPENDED][VIR_DOMAIN_PMSUSPENDED_UNKNOWN] =
-            "the reason is unknown",
+    [VIR_DOMAIN_PMSUSPENDED][VIR_DOMAIN_PMSUSPENDED_UNKNOWN] =
+        "the reason is unknown",
 #endif
 };
 #endif /* HAVE_DOM_REASON */
 #endif
 };
 #endif /* HAVE_DOM_REASON */
@@ -742,7 +734,8 @@ static char *metadata_get_hostname(virDomainPtr dom) {
   const char *namespace = NULL;
   if (hm_ns == NULL) {
     namespace = "http://openstack.org/xmlns/libvirt/nova/1.0";
   const char *namespace = NULL;
   if (hm_ns == NULL) {
     namespace = "http://openstack.org/xmlns/libvirt/nova/1.0";
-  } else {
+  } // namespace =hm_ns;
+  else {
     namespace = hm_ns;
   }
 
     namespace = hm_ns;
   }
 
@@ -957,7 +950,8 @@ static void memory_stats_submit(gauge_t value, virDomainPtr dom,
 static void submit_derive2(const char *type, derive_t v0, derive_t v1,
                            virDomainPtr dom, const char *devname) {
   value_t values[] = {
 static void submit_derive2(const char *type, derive_t v0, derive_t v1,
                            virDomainPtr dom, const char *devname) {
   value_t values[] = {
-      {.derive = v0}, {.derive = v1},
+      {.derive = v0},
+      {.derive = v1},
   };
 
   submit(dom, type, devname, values, STATIC_ARRAY_SIZE(values));
   };
 
   submit(dom, type, devname, values, STATIC_ARRAY_SIZE(values));
@@ -1718,7 +1712,8 @@ static int submit_domain_state(virDomainPtr domain) {
   }
 
   value_t values[] = {
   }
 
   value_t values[] = {
-      {.gauge = (gauge_t)domain_state}, {.gauge = (gauge_t)domain_reason},
+      {.gauge = (gauge_t)domain_state},
+      {.gauge = (gauge_t)domain_reason},
   };
 
   submit(domain, "domain_state", NULL, values, STATIC_ARRAY_SIZE(values));
   };
 
   submit(domain, "domain_state", NULL, values, STATIC_ARRAY_SIZE(values));
@@ -1802,7 +1797,8 @@ static int get_memory_stats(virDomainPtr domain) {
 
   if (min_flt > 0 || maj_flt > 0) {
     value_t values[] = {
 
   if (min_flt > 0 || maj_flt > 0) {
     value_t values[] = {
-        {.gauge = (gauge_t)min_flt}, {.gauge = (gauge_t)maj_flt},
+        {.gauge = (gauge_t)min_flt},
+        {.gauge = (gauge_t)maj_flt},
     };
     submit(domain, "ps_pagefaults", NULL, values, STATIC_ARRAY_SIZE(values));
   }
     };
     submit(domain, "ps_pagefaults", NULL, values, STATIC_ARRAY_SIZE(values));
   }
index 2ab7dda..a4112bb 100644 (file)
@@ -60,7 +60,8 @@ static void submit(const char *plugin_instance, const char *type,
 static void submit_two(const char *plugin_instance, const char *type,
                        const char *type_instance, derive_t c0, derive_t c1) {
   value_t values[] = {
 static void submit_two(const char *plugin_instance, const char *type,
                        const char *type_instance, derive_t c0, derive_t c1) {
   value_t values[] = {
-      {.derive = c0}, {.derive = c1},
+      {.derive = c0},
+      {.derive = c1},
   };
 
   submit(plugin_instance, type, type_instance, values,
   };
 
   submit(plugin_instance, type, type_instance, values,
index e1d1b35..424a218 100644 (file)
@@ -57,7 +57,8 @@ static void traffic_submit(const char *plugin_instance,
                            derive_t tx) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
                            derive_t tx) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
-      {.derive = rx}, {.derive = tx},
+      {.derive = rx},
+      {.derive = tx},
   };
 
   vl.values = values;
   };
 
   vl.values = values;
@@ -74,7 +75,9 @@ static void load_submit(const char *plugin_instance, gauge_t snum, gauge_t mnum,
                         gauge_t lnum) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
                         gauge_t lnum) {
   value_list_t vl = VALUE_LIST_INIT;
   value_t values[] = {
-      {.gauge = snum}, {.gauge = mnum}, {.gauge = lnum},
+      {.gauge = snum},
+      {.gauge = mnum},
+      {.gauge = lnum},
   };
 
   vl.values = values;
   };
 
   vl.values = values;
index cb6793d..dc3b2c7 100644 (file)
@@ -552,7 +552,8 @@ static int wg_config_node(oconfig_item_t *ci) {
 
   plugin_register_write(callback_name, wg_write,
                         &(user_data_t){
 
   plugin_register_write(callback_name, wg_write,
                         &(user_data_t){
-                            .data = cb, .free_func = wg_callback_free,
+                            .data = cb,
+                            .free_func = wg_callback_free,
                         });
 
   plugin_register_flush(callback_name, wg_flush, &(user_data_t){.data = cb});
                         });
 
   plugin_register_flush(callback_name, wg_flush, &(user_data_t){.data = cb});
index 74fdaca..7cd19c3 100644 (file)
@@ -815,7 +815,8 @@ static int wh_config_node(oconfig_item_t *ci) /* {{{ */
         callback_name, cb->location);
 
   user_data_t user_data = {
         callback_name, cb->location);
 
   user_data_t user_data = {
-      .data = cb, .free_func = wh_callback_free,
+      .data = cb,
+      .free_func = wh_callback_free,
   };
 
   if (cb->send_metrics) {
   };
 
   if (cb->send_metrics) {
index 592d669..09bb639 100644 (file)
@@ -413,11 +413,11 @@ static void kafka_config_topic(rd_kafka_conf_t *conf,
   ssnprintf(callback_name, sizeof(callback_name), "write_kafka/%s",
             tctx->topic_name);
 
   ssnprintf(callback_name, sizeof(callback_name), "write_kafka/%s",
             tctx->topic_name);
 
-  status = plugin_register_write(
-      callback_name, kafka_write,
-      &(user_data_t){
-          .data = tctx, .free_func = kafka_topic_context_free,
-      });
+  status = plugin_register_write(callback_name, kafka_write,
+                                 &(user_data_t){
+                                     .data = tctx,
+                                     .free_func = kafka_topic_context_free,
+                                 });
   if (status != 0) {
     WARNING("write_kafka plugin: plugin_register_write (\"%s\") "
             "failed with status %i.",
   if (status != 0) {
     WARNING("write_kafka plugin: plugin_register_write (\"%s\") "
             "failed with status %i.",
index 0cb1e02..b43906e 100644 (file)
@@ -370,11 +370,11 @@ static int wm_config_node(oconfig_item_t *ci) /* {{{ */
 
     snprintf(cb_name, sizeof(cb_name), "write_mongodb/%s", node->name);
 
 
     snprintf(cb_name, sizeof(cb_name), "write_mongodb/%s", node->name);
 
-    status =
-        plugin_register_write(cb_name, wm_write,
-                              &(user_data_t){
-                                  .data = node, .free_func = wm_config_free,
-                              });
+    status = plugin_register_write(cb_name, wm_write,
+                                   &(user_data_t){
+                                       .data = node,
+                                       .free_func = wm_config_free,
+                                   });
     INFO("write_mongodb plugin: registered write plugin %s %d", cb_name,
          status);
   }
     INFO("write_mongodb plugin: registered write plugin %s %d", cb_name,
          status);
   }
index fe3b940..b904022 100644 (file)
@@ -156,7 +156,8 @@ static char *format_labels(char *buffer, size_t buffer_size,
 #define LABEL_BUFFER_SIZE (LABEL_KEY_SIZE + LABEL_VALUE_SIZE + 4)
 
   char *labels[3] = {
 #define LABEL_BUFFER_SIZE (LABEL_KEY_SIZE + LABEL_VALUE_SIZE + 4)
 
   char *labels[3] = {
-      (char[LABEL_BUFFER_SIZE]){0}, (char[LABEL_BUFFER_SIZE]){0},
+      (char[LABEL_BUFFER_SIZE]){0},
+      (char[LABEL_BUFFER_SIZE]){0},
       (char[LABEL_BUFFER_SIZE]){0},
   };
 
       (char[LABEL_BUFFER_SIZE]){0},
   };