651ed03707bf375f4633d9a62810d03be7723a27
4 * @brief Main of IKEv2-Daemon
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
28 #include <threads/sender.h>
29 #include <threads/receiver.h>
30 #include <threads/scheduler.h>
31 #include <threads/thread_pool.h>
32 #include <sa/ike_sa_manager.h>
33 #include <queues/send_queue.h>
34 #include <queues/job_queue.h>
35 #include <network/socket.h>
36 #include <queues/event_queue.h>
37 #include <utils/logger_manager.h>
38 #include <config/configuration_manager.h>
43 #define DAEMON_NAME "charon"
46 * Number of threads in the thread pool
48 * There are several other threads, this defines
49 * only the number of threads in thread_pool_t.
51 #define NUMBER_OF_WORKING_THREADS 4
54 * Port on which the daemon will
55 * listen for incoming traffic
57 #define IKEV2_UDP_PORT 500
60 * Default loglevel to use. This is the
61 * maximum allowed level for ever context, the definiton
62 * of the context may be less verbose.
64 #define DEFAULT_LOGLEVEL FULL
66 typedef struct daemon_t daemon_t
;
69 * @brief Main class of daemon, contains some globals
77 * send_queue_t instance
79 send_queue_t
*send_queue
;
81 * job_queue_t instance
83 job_queue_t
*job_queue
;
85 * event_queue_t instance
87 event_queue_t
*event_queue
;
89 * logger_manager_t instance
91 logger_manager_t
*logger_manager
;
93 * ike_sa_manager_t instance
95 ike_sa_manager_t
*ike_sa_manager
;
97 * configuration_manager_t instance
99 configuration_manager_t
*configuration_manager
;
109 receiver_t
*receiver
;
114 scheduler_t
*scheduler
;
117 * Thread pool holding the worker threads
119 thread_pool_t
*thread_pool
;
122 * @brief shut down the daemon
124 * @param this the daemon to kill
125 * @param reason describition why it will be killed
127 void (*kill
) (daemon_t
*this, char *reason
);
131 * one and only instance of the daemon
133 extern daemon_t
*charon
;