#include "string.h"
#include "error.h"
+
+/** \cond holds information about one encrypted connection */
struct crypt_data {
crypt_function *recv;
crypt_function *send;
void *private_data;
};
-
static struct crypt_data *crypt_data_array;
static unsigned cda_size = 0;
+/** \endcond */
+
+/**
+ * activate encryption for one file descriptor
+ *
+ * \param fd the file descriptor
+ * \param recv the function used for decrypting received data
+ * \param send the function used for encrypting before sending
+ * \param private_data user data supplied by the caller
+ */
void enable_crypt(int fd, crypt_function *recv, crypt_function *send,
void *private_data)
{
PARA_INFO_LOG("rc4 encryption activated for fd %d\n", fd);
}
+/**
+ * deactivate encryption for a given fd
+ *
+ * \param fd the file descriptor
+ *
+ * This must be called if and only if \p fd was activated via enable_crypt().
+ */
void disable_crypt(int fd)
{
if (cda_size < fd + 1)