Move Kore hook functions to kore/hooks.h.

This commit is contained in:
Joris Vink 2021-01-11 23:58:26 +01:00
parent cef5ac4003
commit 4e2ca90095
9 changed files with 38 additions and 11 deletions

View File

@ -15,6 +15,7 @@
*/
#include <kore/kore.h>
#include <kore/hooks.h>
/* Let kore handle the default option parsing. */
void

View File

@ -15,6 +15,7 @@
*/
#include <kore/kore.h>
#include <kore/hooks.h>
/* Let kore handle the default option parsing. */
void

View File

@ -15,6 +15,7 @@
*/
#include <kore/kore.h>
#include <kore/hooks.h>
/* Let kore handle the default option parsing. */
void

View File

@ -15,6 +15,7 @@
*/
#include <kore/kore.h>
#include <kore/hooks.h>
/* Let kore handle the default option parsing. */
void

View File

@ -15,6 +15,7 @@
*/
#include <kore/kore.h>
#include <kore/hooks.h>
/* Let kore handle the default option parsing. */
void

View File

@ -15,6 +15,7 @@
*/
#include <kore/kore.h>
#include <kore/hooks.h>
/* Let kore handle the default option parsing. */
void

31
include/kore/hooks.h Normal file
View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2021 Joris Vink <joris@coders.se>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef __H_HOOKS_H
#define __H_HOOKS_H
#define KORE_CONFIG_HOOK "kore_parent_configure"
#define KORE_TEARDOWN_HOOK "kore_parent_teardown"
#define KORE_DAEMONIZED_HOOK "kore_parent_daemonized"
void kore_seccomp_hook(void);
void kore_worker_teardown(void);
void kore_parent_teardown(void);
void kore_worker_configure(void);
void kore_parent_daemonized(void);
void kore_parent_configure(int, char **);
#endif

View File

@ -100,10 +100,6 @@ extern int daemon(int, int);
#define KORE_PIDFILE_DEFAULT "kore.pid"
#define KORE_DEFAULT_CIPHER_LIST "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK:!kRSA:!kDSA"
#define KORE_CONFIG_HOOK "kore_parent_configure"
#define KORE_TEARDOWN_HOOK "kore_parent_teardown"
#define KORE_DAEMONIZED_HOOK "kore_parent_daemonized"
#if defined(KORE_DEBUG)
#define kore_debug(...) \
if (kore_debug) \
@ -1052,13 +1048,6 @@ struct kore_json_item *kore_json_create_item(struct kore_json_item *,
void kore_keymgr_run(void);
void kore_keymgr_cleanup(int);
void kore_seccomp_hook(void);
void kore_worker_teardown(void);
void kore_parent_teardown(void);
void kore_worker_configure(void);
void kore_parent_daemonized(void);
void kore_parent_configure(int, char **);
#if defined(__cplusplus)
}
#endif

View File

@ -28,6 +28,7 @@
#include <signal.h>
#include "kore.h"
#include "hooks.h"
#if !defined(KORE_NO_HTTP)
#include "http.h"