X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=net.c;h=5a7eb9175427c2fcee0f4d3a2532870fb11dcc08;hp=28bc777d4dde6f56be5414d4d8d92aeb0d47ab6e;hb=4c6dd71312400fc04b3f0582b23a0cff831ee8fa;hpb=e7966be29d104bc2932f402abbe3e36750a0f846 diff --git a/net.c b/net.c index 28bc777d..5a7eb917 100644 --- a/net.c +++ b/net.c @@ -23,15 +23,26 @@ #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) { @@ -48,6 +59,13 @@ void enable_crypt(int fd, crypt_function *recv, crypt_function *send, 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)