/* callback = */ apache_read_host,
/* interval = */ 0,
&(user_data_t){
- .data = st, .free_func = apache_free,
+ .data = st,
+ .free_func = apache_free,
});
} /* int config_add */
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
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;
#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;
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;
} 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 {
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) {
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));
}
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;
}
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 {
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)
}
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);
}
cs_submit(value);
-/* #endif HAVE_SYSCTLBYNAME */
+ /* #endif HAVE_SYSCTLBYNAME */
#elif KERNEL_LINUX
FILE *fh;
if (status == -2)
ERROR("contextswitch plugin: Unable to find context switch value.");
-/* #endif KERNEL_LINUX */
+ /* #endif KERNEL_LINUX */
#elif HAVE_PERFSTAT
int status = 0;
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;
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;
WARNING("cpu plugin: sysctl: %s", STRERRNO);
return -1;
}
-/* #endif CAN_USE_SYSCTL */
+ /* #endif CAN_USE_SYSCTL */
#elif defined(HAVE_SYSCTLBYNAME)
size_t numcpu_size;
"%i)",
numcpu);
#endif
-/* #endif HAVE_SYSCTLBYNAME */
+ /* #endif HAVE_SYSCTLBYNAME */
#elif defined(HAVE_LIBSTATGRAB)
/* nothing to initialize */
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;
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;
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];
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) /* {{{ \
- */
+ */
long cpuinfo[maxcpu][CPUSTATES];
size_t cpuinfo_size;
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];
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;
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;
* 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"
typedef struct {
PluginData data;
- PyObject *meta; /* dict */
+ PyObject *meta; /* dict */
int severity;
char message[NOTIF_MAX_MSG_LEN];
} Notification;
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);
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 {
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;
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;
#ifdef KERNEL_LINUX
&& notify_upstart() == 0 && notify_systemd() == 0
#endif
- ) {
+ ) {
pid_t pid;
if ((pid = fork()) == -1) {
/* error */
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
- "fP:"
+ "fP:"
#endif
- );
+ );
if (c == -1)
break;
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);
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;
/* 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);
* 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) {
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;
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) {
- 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",
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 */
#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);
{.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 */
{.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 */
{.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 */
{.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 */
{.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 */
};
oconfig_item_t config_item = {
- .values = values, .values_num = STATIC_ARRAY_SIZE(values),
+ .values = values,
+ .values_num = STATIC_ARRAY_SIZE(values),
};
/* check */
{.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 */
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,
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;
/* 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);
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);
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);
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);
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);
"(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},
- {"registerMatch", "(Ljava/lang/String;Lorg/collectd/api/"
- "CollectdMatchFactoryInterface;)I",
+ {"registerMatch",
+ "(Ljava/lang/String;Lorg/collectd/api/"
+ "CollectdMatchFactoryInterface;)I",
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},
#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
{
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);
}
}
-/* #endif STRERROR_R_CHAR_P */
+ /* #endif STRERROR_R_CHAR_P */
#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 */
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;
}
buffer_t *b = &(buffer_t){
- .data = signature, .len = signature_len,
+ .data = signature,
+ .len = signature_len,
};
uint8_t hash[32];
}
buffer_t *b = &(buffer_t){
- .data = data, .len = data_size,
+ .data = data,
+ .len = data_size,
};
uint16_t username_len;
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};
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;
}
- 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",
int status = decrypt_aes256(
&(buffer_t){
- .data = ciphertext, .len = ciphertext_len,
+ .data = ciphertext,
+ .len = ciphertext_len,
},
iv, iv_len, "admin");
if (status != 0) {
#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;
-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;
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));
#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 {
- 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 {
- 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 {
- 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;
};
/*
* 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 {
- 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 */
-#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
} /* }}} 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 */
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 =
{
- .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,
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) {
/* Wait until connection establishes */
struct pollfd pollfd = {
- .fd = fd, .events = POLLOUT,
+ .fd = fd,
+ .events = POLLOUT,
};
do
status = poll(&pollfd, 1, MEMCACHED_CONNECT_TIMEOUT);
}
struct pollfd pollfd = {
- .fd = st->fd, .events = POLLOUT,
+ .fd = st->fd,
+ .events = POLLOUT,
};
do
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);
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);
/* 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 */
#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 */
return -1;
}
-/* #endif HAVE_LIBKSTAT */
+ /* #endif HAVE_LIBKSTAT */
#elif HAVE_SYSCTL
pagesize = getpagesize();
ERROR("memory plugin: Invalid pagesize: %i", pagesize);
return -1;
}
-/* #endif HAVE_SYSCTL */
+ /* #endif HAVE_SYSCTL */
#elif HAVE_LIBSTATGRAB
/* no init stuff */
MEMORY_SUBMIT("wired", wired, "active", active, "inactive", inactive, "free",
free);
-/* #endif HAVE_HOST_STATISTICS */
+ /* #endif HAVE_HOST_STATISTICS */
#elif HAVE_SYSCTLBYNAME
/*
(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;
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
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};
MEMORY_SUBMIT("active", mem_active, "inactive", mem_inactive, "free",
mem_free);
-/* #endif HAVE_SYSCTL */
+ /* #endif HAVE_SYSCTL */
#elif HAVE_LIBSTATGRAB
sg_mem_stats *ios;
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};
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, /* {{{ */
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, /* {{{ */
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 "
#if KERNEL_LINUX
static int nfs_init(void) { return 0; }
-/* #endif KERNEL_LINUX */
+ /* #endif KERNEL_LINUX */
#elif HAVE_LIBKSTAT
static int nfs_init(void) {
return 0;
}
-/* #endif KERNEL_LINUX */
+ /* #endif KERNEL_LINUX */
#elif HAVE_LIBKSTAT
static int nfs_read(void) {
/* 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);
/* 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;
/* 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);
pset_list_len = 0;
return -1;
}
-/* #endif HAVE_THREAD_INFO */
+ /* #endif HAVE_THREAD_INFO */
#elif KERNEL_LINUX
pagesize_g = sysconf(_SC_PAGESIZE);
}
}
#endif
-/* #endif KERNEL_LINUX */
+ /* #endif KERNEL_LINUX */
#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();
/*
* TODO: context switch counters for Solaris
-*/
+ */
ps->cswitch_vol = -1;
ps->cswitch_invol = -1;
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;
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;
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;
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 */
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
/*
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;
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) {
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;
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 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();
-/* #endif HAVE_SWAPCTL */
+ /* #endif HAVE_SWAPCTL */
#elif defined(VM_SWAPUSAGE)
/* No init stuff */
ERROR("swap plugin: kvm_openfiles failed, %s", errbuf);
return -1;
}
-/* #endif HAVE_LIBKVM_GETSWAPINFO */
+ /* #endif HAVE_LIBKVM_GETSWAPINFO */
#elif HAVE_LIBSTATGRAB
/* No init stuff */
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.");
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;
#if TCP_STATE_MIN > 0
|| (state < TCP_STATE_MIN)
#endif
- ) {
+ ) {
NOTICE("tcpconns plugin: Ignoring connection with "
"unknown state 0x%02" PRIx8 ".",
state);
return 0;
} /* int conn_read_file */
-/* #endif KERNEL_LINUX */
+ /* #endif KERNEL_LINUX */
#elif HAVE_SYSCTLBYNAME
-/* #endif HAVE_SYSCTLBYNAME */
+ /* #endif HAVE_SYSCTLBYNAME */
#elif HAVE_LIBKVM_NLIST
#endif /* HAVE_LIBKVM_NLIST */
return 0;
} /* int conn_read */
-/* #endif KERNEL_LINUX */
+ /* #endif KERNEL_LINUX */
#elif HAVE_SYSCTLBYNAME
static int conn_read(void) {
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) {
return 0;
}
-/* #endif HAVE_LIBKVM_NLIST */
+ /* #endif HAVE_LIBKVM_NLIST */
#elif KERNEL_AIX
*/
value_list_t vl = VALUE_LIST_INIT;
value_t values[] = {
- {.derive = rx}, {.derive = tx},
+ {.derive = rx},
+ {.derive = tx},
};
vl.values = values;
package_delta = NULL;
}
-/**********************
- * Collectd functions *
- **********************/
+ /**********************
+ * Collectd functions *
+ **********************/
#define DO_OR_GOTO_ERR(something) \
do { \
}
result = (time_t)info.uptime;
-/* #endif KERNEL_LINUX */
+ /* #endif KERNEL_LINUX */
#elif HAVE_LIBKSTAT
kstat_t *ksp;
}
result = time(NULL) - (time_t)knp->value.ui32;
-/* #endif HAVE_LIBKSTAT */
+ /* #endif HAVE_LIBKSTAT */
#elif HAVE_SYS_SYSCTL_H
struct timeval boottv = {0};
}
result = time(NULL) - boottv.tv_sec;
-/* #endif HAVE_SYS_SYSCTL_H */
+ /* #endif HAVE_SYS_SYSCTL_H */
#elif HAVE_PERFSTAT
int status;
endutxent();
users_submit(users);
-/* #endif HAVE_GETUTXENT */
+ /* #endif HAVE_GETUTXENT */
#elif HAVE_GETUTENT
unsigned int users = 0;
endutent();
users_submit(users);
-/* #endif HAVE_GETUTENT */
+ /* #endif HAVE_GETUTENT */
#elif HAVE_LIBSTATGRAB
sg_user_stats *us;
#else
us->num_entries);
#endif
-/* #endif HAVE_LIBSTATGRAB */
+ /* #endif HAVE_LIBSTATGRAB */
#else
#error "No applicable input method."
pthread_mutex_unlock(&strerror_r_lock);
}
-/* #endif !HAVE_STRERROR_R */
+ /* #endif !HAVE_STRERROR_R */
#elif STRERROR_R_CHAR_P
{
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);
}
}
-/* #endif STRERROR_R_CHAR_P */
+ /* #endif STRERROR_R_CHAR_P */
#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 */
#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
}
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");
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};
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];
.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(
};
/*
-* 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.
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));
} 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
- 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
- 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)),
- 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),
- 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)),
- 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
- 0, DOUBLE_TO_CDTIME_T_STATIC(2.000), 2.00,
+ 0,
+ DOUBLE_TO_CDTIME_T_STATIC(2.000),
+ 2.00,
},
{
// 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
- 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
- DOUBLE_TO_CDTIME_T_STATIC(130), 0, 0.00,
+ DOUBLE_TO_CDTIME_T_STATIC(130),
+ 0,
+ 0.00,
},
{
// 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
- 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,
},
};
*
* Author:
* Niki W. Waibel <niki.waibel@gmx.net>
-**/
+ **/
#if HAVE_CONFIG_H
#include "config.h"
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);
#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) {
*
* Author:
* Niki W. Waibel <niki.waibel@gmx.net>
-**/
+ **/
/* See below for instructions how to use the public functions. */
} 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\"}",
- /* 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}",
- /* status = */ -1, NULL, 0,
+ /* status = */ -1,
+ NULL,
+ 0,
},
{
/* expires_in missing */
"{\"access_token\":\"shaephohbie9Ahch\"}",
- /* status = */ -1, NULL, 0,
+ /* status = */ -1,
+ NULL,
+ 0,
},
};
* 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) {
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);
*
* RETURN VALUE
* Zero on success, nonzero on failure.
-*/
+ */
int tail_match_read(cu_tail_match_t *obj);
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,
derive_t tx) {
value_list_t vl = VALUE_LIST_INIT;
value_t values[] = {
- {.derive = rx}, {.derive = tx},
+ {.derive = rx},
+ {.derive = tx},
};
vl.values = 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;
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});
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) {
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);
}