extern list_t *new_closure(closure_t *cl);
extern void add_closure(dict_t *dict, cstring_t name, apply_fn apply);
extern void *find_cl_if(dict_t *dict, cstring_t name, uint32_t type,
- bool_t fail_if_invalid, cstring_t desc,
+ bool_t required, cstring_t desc,
struct cloc loc);
extern item_t *dict_find_item(dict_t *dict, cstring_t key, bool_t required,
cstring_t desc, struct cloc loc);
#define CL_BUFFER 13
#define CL_NETLINK 14
#define CL_PRIVCACHE 15
+/* When editing this list, edit closure_type_names[] too */
+
+extern const char *const closure_type_names[];
+
+const char *closure_type_name(uint32_t ty, char buf[]);
struct buffer_if;
/* SIGPUBKEY interface */
-typedef void sig_sethash_fn(void *st, struct hash_if *hash);
typedef void sig_dispose_fn(void *st);
typedef bool_t sig_unpick_fn(void *sst, struct buffer_if *msg,
const struct alg_msg_data *sig);
struct sigpubkey_if {
void *st;
- sig_sethash_fn *sethash; /* must be called before use, if non-0 */
sig_unpick_fn *unpick;
sig_checksig_fn *check;
const struct hash_if *hash;
struct buffer_if *msg);
struct sigprivkey_if {
void *st;
- sig_sethash_fn *sethash; /* must be called before use, if non-0 */
sig_makesig_fn *sign;
const struct hash_if *hash;
sig_dispose_fn *dispose;
typedef struct sigprivkey_if *privcache_lookup_fn(void *st,
const struct sigkeyid *id,
struct log_if*);
- /* Return is valid only until you return from the current event!
- * You do not need to call ->sethash. */
+ /* Return is valid only until you return from the current event! */
struct privcache_if {
void *st;
cfl->facility=facility;
}
+void log_early_init(void);
+void log_early_setlevel(void);
+
/* SITE interface */
/* Pretty much a placeholder; allows starting and stopping of processing,
key expiry, etc. */
-typedef void site_control_fn(void *st, bool_t run);
+typedef void site_startup_fn(void *st);
typedef uint32_t site_status_fn(void *st);
struct site_if {
void *st;
- site_control_fn *control;
+ site_startup_fn *startup;
site_status_fn *status;
};
hash_final_fn *final;
};
+extern struct hash_if *const sha1_hash_if; /* for where this is hardcoded */
+
/* BUFFER interface */
struct buffer_if {
const char *message, ...))
FORMAT(printf,4,5);
+extern NORETURN(cfgfatal_cl_type(struct cloc loc, const char *facility,
+ closure_t *cl, uint32_t exp_type,
+ const char *name));
+
extern void Message(uint32_t class, const char *message, ...)
FORMAT(printf,2,3);
extern void log_from_fd(int fd, cstring_t prefix, struct log_if *log);