chiark / gitweb /
polypath: Provide polypath comm module
[secnet.git] / secnet.h
index 1bfe8a183d5a0becb31a6926558833014b79b2de..ecbc9de8a502841ff72b1ae42480cb99974100b4 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -14,6 +14,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
+#include <fnmatch.h>
 #include <sys/poll.h>
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -174,6 +175,7 @@ extern void *safe_realloc_ary(void *p, size_t size, size_t count,
                              const char *message);
 
 void setcloexec(int fd); /* cannot fail */
+void setnonblock(int fd); /* cannot fail */
 void pipe_cloexec(int fd[2]); /* pipe(), setcloexec() twice; cannot fail */
 
 extern int sys_cmd(const char *file, const char *argc, ...);
@@ -267,12 +269,19 @@ bool_t remove_hook(uint32_t phase, hook_fn *f, void *state);
 extern uint32_t current_phase;
 extern void enter_phase(uint32_t new_phase);
 
+void phase_hooks_init(void); /* for main() only */
+
 /* Some features (like netlink 'soft' routes) require that secnet
    retain root privileges.  They should indicate that here when
    appropriate. */
 extern bool_t require_root_privileges;
 extern cstring_t require_root_privileges_explanation;
 
+/* Some modules may want to know whether secnet is going to drop
+   privilege, so that they know whether to do privsep.  Call only
+   in phases SETUP and later. */
+bool_t will_droppriv(void);
+
 /***** END of program lifetime support *****/
 
 /***** MODULE support *****/
@@ -287,6 +296,7 @@ extern void init_builtin_modules(dict_t *dict);
 extern init_module resolver_module;
 extern init_module random_module;
 extern init_module udp_module;
+extern init_module polypath_module;
 extern init_module util_module;
 extern init_module site_module;
 extern init_module transform_eax_module;