X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Flibcollectdclient%2Fnetwork_parse.c;h=a8f6bd61c8b541a20451c122a9b8b0195448730b;hp=67034116b9f90a6b0e7f869c71713efdf2978de2;hb=d486225f89ea52d8ed2b4242eba2ad94c409f837;hpb=936d749328d399463f2bbb5ec3d07cd3a271a7c7 diff --git a/src/libcollectdclient/network_parse.c b/src/libcollectdclient/network_parse.c index 67034116..a8f6bd61 100644 --- a/src/libcollectdclient/network_parse.c +++ b/src/libcollectdclient/network_parse.c @@ -31,10 +31,12 @@ #include "collectd/lcc_features.h" #include "collectd/network_parse.h" +#include "globals.h" #include #include #include +#include #include #include @@ -43,6 +45,8 @@ #include #elif HAVE_SYS_ENDIAN_H #include +#else /* fallback */ +#include "collectd/stdendian.h" #endif #if HAVE_GCRYPT_H @@ -65,7 +69,7 @@ static int network_parse(void *data, size_t data_size, lcc_security_level_t sl, lcc_network_parse_options_t const *opts); #if HAVE_GCRYPT_H -static int init_gcrypt() { +static int init_gcrypt(void) { /* http://lists.gnupg.org/pipermail/gcrypt-devel/2003-August/000458.html * Because you can't know in a library whether another library has * already initialized the library */ @@ -217,7 +221,7 @@ static int parse_time(uint16_t type, void *payload, size_t payload_size, static double ntohd(double val) /* {{{ */ { - static int config = 0; + static int config; union { uint8_t byte[8]; @@ -432,7 +436,7 @@ static int decrypt_aes256(buffer_t *b, void *iv, size_t iv_size, uint8_t pwhash[32] = {0}; gcry_md_hash_buffer(GCRY_MD_SHA256, pwhash, password, strlen(password)); - fprintf(stderr, "sizeof(iv) = %zu\n", sizeof(iv)); + fprintf(stderr, "sizeof(iv) = %" PRIsz "\n", sizeof(iv)); if (gcry_cipher_setkey(cipher, pwhash, sizeof(pwhash)) || gcry_cipher_setiv(cipher, iv, iv_size) || gcry_cipher_decrypt(cipher, b->data, b->len, /* in = */ NULL, @@ -517,7 +521,7 @@ static int network_parse(void *data, size_t data_size, lcc_security_level_t sl, if ((sz < 5) || (((size_t)sz - 4) > b->len)) { DEBUG("lcc_network_parse(): invalid 'sz' field: sz = %" PRIu16 - ", b->len = %zu\n", + ", b->len = %" PRIsz "\n", sz, b->len); return EINVAL; }