X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fconnectivity.c;h=45b65aab5b09c1c5ba35110bbff618f6144de153;hp=204bbf6524ef3e5224f361af45788513bd4ac0c3;hb=48efd3deb4c9139fd060ff3d289896e9031bcc7c;hpb=718b7c7e9e097e413b78e9bfe46856767fbae7a3 diff --git a/src/connectivity.c b/src/connectivity.c index 204bbf65..45b65aab 100644 --- a/src/connectivity.c +++ b/src/connectivity.c @@ -21,16 +21,16 @@ * * Authors: * Red Hat NFVPE - * Andrew Bays + * Andrew Bays * Aneesh Puttur **/ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" +#include "utils/ignorelist/ignorelist.h" #include "utils_complain.h" -#include "utils_ignorelist.h" #include #include @@ -306,10 +306,11 @@ static int gen_message_payload(int state, int old_state, const char *interface, (state == 0 ? strlen(CONNECTIVITY_NEW_STATE_FIELD_DOWN_VALUE) : strlen(CONNECTIVITY_NEW_STATE_FIELD_UP_VALUE)); - if (yajl_gen_string( - g, (u_char *)(state == 0 ? CONNECTIVITY_NEW_STATE_FIELD_DOWN_VALUE - : CONNECTIVITY_NEW_STATE_FIELD_UP_VALUE), - new_state_len) != yajl_gen_status_ok) + if (yajl_gen_string(g, + (u_char *)(state == 0 + ? CONNECTIVITY_NEW_STATE_FIELD_DOWN_VALUE + : CONNECTIVITY_NEW_STATE_FIELD_UP_VALUE), + new_state_len) != yajl_gen_status_ok) goto err; // oldState @@ -322,10 +323,11 @@ static int gen_message_payload(int state, int old_state, const char *interface, (old_state == 0 ? strlen(CONNECTIVITY_OLD_STATE_FIELD_DOWN_VALUE) : strlen(CONNECTIVITY_OLD_STATE_FIELD_UP_VALUE)); - if (yajl_gen_string( - g, (u_char *)(old_state == 0 ? CONNECTIVITY_OLD_STATE_FIELD_DOWN_VALUE - : CONNECTIVITY_OLD_STATE_FIELD_UP_VALUE), - old_state_len) != yajl_gen_status_ok) + if (yajl_gen_string(g, + (u_char *)(old_state == 0 + ? CONNECTIVITY_OLD_STATE_FIELD_DOWN_VALUE + : CONNECTIVITY_OLD_STATE_FIELD_UP_VALUE), + old_state_len) != yajl_gen_status_ok) goto err; // stateChangeFieldsVersion @@ -472,7 +474,8 @@ static int connectivity_link_state(struct nlmsghdr *msg) { } DEBUG("connectivity plugin (%llu): Interface %s status is now %s", - il->timestamp, dev, ((ifi->ifi_flags & IFF_RUNNING) ? "UP" : "DOWN")); + (unsigned long long)il->timestamp, dev, + ((ifi->ifi_flags & IFF_RUNNING) ? "UP" : "DOWN")); // no need to loop again, we found the interface name attr // (otherwise the first if-statement in the loop would @@ -694,7 +697,9 @@ static void *connectivity_dequeue_thread(void *arg) /* {{{ */ static int nl_connect() { struct sockaddr_nl sa_nl = { - .nl_family = AF_NETLINK, .nl_groups = RTMGRP_LINK, .nl_pid = getpid(), + .nl_family = AF_NETLINK, + .nl_groups = RTMGRP_LINK, + .nl_pid = getpid(), }; nl_sock = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);