chiark / gitweb /
cleanup: fix up the type of string buffers
[secnet.git] / secnet.h
index 4b211f5c687a1e17caf8b7d4dc0057ab72e2a5b3..656c86d262a54e0910ca5dc580becf720236270c 100644 (file)
--- a/secnet.h
+++ b/secnet.h
 #include <sys/time.h>
 #include <netinet/in.h>
 
+/*
+ * Macros added by SGT for endianness-independence
+ */
+#define GET_32BIT_MSB_FIRST(cp) \
+  (((unsigned long)(unsigned char)(cp)[0] << 24) | \
+  ((unsigned long)(unsigned char)(cp)[1] << 16) | \
+  ((unsigned long)(unsigned char)(cp)[2] << 8) | \
+  ((unsigned long)(unsigned char)(cp)[3]))
+
+#define PUT_32BIT_MSB_FIRST(cp, value) ( \
+  (cp)[0] = (char)((value) >> 24), \
+  (cp)[1] = (char)((value) >> 16), \
+  (cp)[2] = (char)((value) >> 8), \
+  (cp)[3] = (char)(value) )
+
 typedef char *string_t;
 typedef const char *cstring_t;
 typedef enum {False,True} bool_t;
@@ -19,6 +34,14 @@ typedef enum {False,True} bool_t;
 #define ASSERT(x) do { if (!(x)) { fatal("assertion failed line %d file " \
                                         __FILE__,__LINE__); } } while(0)
 
+/* from logmsg.c */
+extern uint32_t message_level;
+extern bool_t secnet_is_daemon;
+extern struct log_if *system_log;
+
+/* from process.c */
+extern void start_signal_handling(void);
+
 /***** CONFIGURATION support *****/
 
 extern bool_t just_check_config; /* If True then we're going to exit after
@@ -183,6 +206,23 @@ extern cstring_t require_root_privileges_explanation;
    modules it's called "secnet_module". */
 typedef void init_module(dict_t *dict);
 
+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 util_module;
+extern init_module site_module;
+extern init_module transform_module;
+extern init_module netlink_module;
+extern init_module rsa_module;
+extern init_module dh_module;
+extern init_module md5_module;
+extern init_module slip_module;
+extern init_module tun_module;
+extern init_module sha1_module;
+extern init_module log_module;
+
 /***** END of module support *****/
 
 /***** CLOSURE TYPES and interface definitions *****/
@@ -281,7 +321,7 @@ struct log_if {
     log_vmsg_fn *vlog;
 };
 /* (convenience function, defined in util.c) */
-extern void log(struct log_if *lf, int class, const char *message, ...)
+extern void slilog(struct log_if *lf, int class, const char *message, ...)
 FORMAT(printf,3,4);
 
 /* SITE interface */