* Florian octo Forster <octo at verplant.org>
**/
+#define _BSD_SOURCE /* For struct ip_mreq */
+
#include "collectd.h"
#include "plugin.h"
#include "common.h"
/*
* Maximum size required for encryption / signing:
*
- * 44 bytes for the encryption header
+ * 42 bytes for the encryption header
* + 64 bytes for the username
* -----------
- * = 108 bytes
+ * = 106 bytes
*/
-#define BUFF_SIG_SIZE 108
+#define BUFF_SIG_SIZE 106
/*
* Private data types
* +---------------------------------------------------------------+
*/
/* Minimum size */
-#define PART_ENCRYPTION_AES256_SIZE 44
+#define PART_ENCRYPTION_AES256_SIZE 42
struct part_encryption_aes256_s
{
part_header_t head;
gcry_error_t err;
gcry_cipher_hd_t cypher;
- DEBUG ("network plugin: networt_send_buffer_encrypted: "
- "buffer_size = %zu;", buffer_size);
-
/* Initialize the header fields */
memset (&pea, 0, sizeof (pea));
pea.head.type = htons (TYPE_ENCR_AES256);
- sizeof (pea.hash);
assert (buffer_size <= sizeof (buffer));
+ DEBUG ("network plugin: networt_send_buffer_encrypted: "
+ "buffer_size = %zu;", buffer_size);
pea.head.length = htons ((uint16_t) (PART_ENCRYPTION_AES256_SIZE
+ username_len + in_buffer_size));
return (0);
} /* }}} int network_config_set_ttl */
+#if HAVE_LIBGCRYPT
static int network_config_set_string (const oconfig_item_t *ci, /* {{{ */
char **ret_string)
{
return (0);
} /* }}} int network_config_set_string */
+#endif /* HAVE_LIBGCRYPT */
#if HAVE_LIBGCRYPT
static int network_config_set_security_level (oconfig_item_t *ci, /* {{{ */
}
}
+#if HAVE_LIBGCRYPT
if ((se->data.server.security_level > SECURITY_LEVEL_NONE)
&& (se->data.server.auth_file == NULL))
{
sockent_destroy (se);
return (-1);
}
+#endif /* HAVE_LIBGCRYPT */
status = sockent_open (se);
if (status != 0)
}
}
+#if HAVE_LIBGCRYPT
if ((se->data.client.security_level > SECURITY_LEVEL_NONE)
&& ((se->data.client.username == NULL)
|| (se->data.client.password == NULL)))
sockent_destroy (se);
return (-1);
}
+#endif /* HAVE_LIBGCRYPT */
status = sockent_open (se);
if (status != 0)
tmp = (int) ci->values[0].value.number;
if (tmp > 0)
- network_config_ttl = tmp;
+ cache_flush_interval = tmp;
return (0);
} /* }}} int network_config_set_cache_flush */