#include <catacomb/ct.h>
#include <catacomb/chacha.h>
+#include <catacomb/gaead.h>
#include <catacomb/gcipher.h>
#include <catacomb/gmac.h>
#include <catacomb/grand.h>
+#include <catacomb/latinpoly.h>
#include <catacomb/key.h>
#include <catacomb/paranoia.h>
#include <catacomb/poly1305.h>
const char *name; /* Name of this tunnel driver */
unsigned flags; /* Various interesting flags */
#define TUNF_PRIVOPEN 1u /* Need helper to open file */
- void (*init)(void); /* Initializes the system */
+ int (*init)(void); /* Initializes the system */
tunnel *(*create)(struct peer */*p*/, int /*fd*/, char **/*ifn*/);
/* Initializes a new tunnel */
void (*setifname)(tunnel */*t*/, const char */*ifn*/);
* @const char *pubkr@ = public keyring file
* @const char *ptag@ = default private-key tag
*
- * Returns: ---
+ * Returns: Zero on success, @-1@ on failure.
*
* Use: Initializes the key-management machinery, loading the
* keyrings and so on.
*/
-extern void km_init(const char */*privkr*/, const char */*pubkr*/,
- const char */*ptag*/);
+extern int km_init(const char */*privkr*/, const char */*pubkr*/,
+ const char */*ptag*/);
/* --- @km_reload@ --- *
*
* @gid_t g@ = group to own the socket
* @mode_t m@ = permissions to set on the socket
*
- * Returns: ---
+ * Returns: Zero on success, @-1@ on failure.
*
* Use: Creates the admin listening socket.
*/
-extern void a_listen(const char */*sock*/,
- uid_t /*u*/, gid_t /*g*/, mode_t /*m*/);
+extern int a_listen(const char */*sock*/,
+ uid_t /*u*/, gid_t /*g*/, mode_t /*m*/);
/* --- @a_unlisten@ --- *
*
* @gid_t g@ = group to own the socket
* @mode_t m@ = permissions to set on the socket
*
- * Returns: ---
+ * Returns: Zero on success, @-1@ on failure.
*
* Use: Creates the admin listening socket.
*/
-extern void a_init(void);
+extern int a_init(void);
/*----- Mapping with addresses as keys ------------------------------------*/
*
* Arguments: @int detachp@ = whether to detach the child from its terminal
*
- * Returns: ---
+ * Returns: Zero on success, @-1@ on failure.
*
* Use: Separates off the privileged tunnel-opening service from the
* rest of the server.
*/
-extern void ps_split(int /*detachp*/);
+extern int ps_split(int /*detachp*/);
/* --- @ps_quit@ --- *
*
*
* Arguments: @struct addrinfo *ailist@ = addresses to bind to
*
- * Returns: ---
+ * Returns: Zero on success, @-1@ on failure.
*
* Use: Binds to the main UDP sockets.
*/
-extern void p_bind(struct addrinfo */*ailist*/);
+extern int p_bind(struct addrinfo */*ailist*/);
/* --- @p_unbind@ --- *
*
*
* Arguments: @const tunnel_ops *tops@ = tunnel ops to add
*
- * Returns: ---
+ * Returns: Zero on success, @-1@ on failure.
*
- * Use: Adds a tunnel class to the list of known classes. If there
- * is no current default tunnel, then this one is made the
- * default.
+ * Use: Adds a tunnel class to the list of known classes, if it
+ * initializes properly. If there is no current default tunnel,
+ * then this one is made the default.
*
* Does nothing if the tunnel class is already known. So adding
* a bunch of tunnels takes quadratic time, but there will be
* too few to care about.
*/
-extern void p_addtun(const tunnel_ops */*tops*/);
+extern int p_addtun(const tunnel_ops */*tops*/);
/* --- @p_setdflttun@ --- *
*