00001 /*! \file server_config.h
00002 Header file for the logging module 'server_config.c'.
00003 */
00004
00005 #ifdef __cplusplus
00006 extern "C" {
00007 #endif
00008
00009 #ifndef CONFIG_HEADER
00010 #define CONFIG_HEADER
00011
00012 #include "config.h"
00013
00014
00015 /*! \brief Maximum number of characters for a file name.
00016 */
00017
00018 #define FILE_NAME_SIZE 256
00019
00020 /*! \brief Maximum number of characters for a host name (or IP address).
00021 */
00022
00023 #define HOST_NAME_MAX_SIZE 256
00024
00025 /*! \brief Maximum number of characters for an IP address.
00026 */
00027
00028 #define MAX_IP_ADDRESS_STR_SIZE 16
00029
00030 /*! \brief Maximum number of characters for user ID.
00031 */
00032
00033 #define MAX_UID_SIZE 128
00034
00035 /*! \brief Maximum number of characters for group ID.
00036 */
00037
00038 #define MAX_GID_SIZE 128
00039
00040 /*! \brief Maximum number of characters for the list of manufacturer's IDs.
00041 */
00042
00043 #define MAX_MANUFACTURER_ID_LIST_SIZE 1024
00044
00045 /*! \brief Maximum number of characters for a manufacturer's ID.
00046 */
00047
00048 #define MAX_MANUFACTURER_ID_SIZE 128
00049
00050 /*! \brief This structure contains the main server's configuration.
00051 */
00052
00053 struct global_config
00054 {
00055 /*! \brief Some SQL functions requires a security delay. This delay assures that the operation has enough
00056 time to complete. This value represents the security delay for all SQL functions that requires
00057 this security. Functions are:
00058 <UL>
00059 <LI>try_reserve_ip_from_pool
00060 </UL>
00061 */
00062
00063 unsigned long int sql_expiration_security_delay;
00064
00065 /*! \brief Path to the server's main log file.
00066 */
00067
00068 char log_file[FILE_NAME_SIZE];
00069
00070 /*! \brief Path to the server's CSV file.
00071 */
00072
00073 char csv_file[FILE_NAME_SIZE];
00074
00075 /*! \brief Path to the file used by the server to log incoming and outcomming DHCP packets.
00076 Only welle formated packets are logged.
00077 */
00078
00079 char debug_file[FILE_NAME_SIZE];
00080
00081 /*! \brief Path to the file used to synchronize access to the dump file.
00082 */
00083
00084 char sync_dump[FILE_NAME_SIZE];
00085
00086 /*! \brief This flag represents the verbosity level.
00087 */
00088
00089 int debug;
00090
00091 /*! \brief Path to the process' working directory.
00092 */
00093
00094 char working_dir[FILE_NAME_SIZE];
00095
00096 /*! \brief Host name (or IP address) associated to the network interface used by the DHCP server.
00097 */
00098
00099 char dhcp_bind_ip[HOST_NAME_MAX_SIZE];
00100
00101 /*! \brief Path to the process' PID file.
00102 */
00103
00104 char pid_file[FILE_NAME_SIZE];
00105
00106 /*! \brief Flag that tells the server wether it should log incoming and outcoming DHCP packets.
00107 Values could be:
00108 <UL>
00109 <LI>0: Do not log any packets.
00110 <LI>1: Log all incoming and outcoming DHCP packets.
00111 <LI>2: High verbosity debug.
00112 </UL>
00113 */
00114
00115 int dumper_mode;
00116
00117 /*! \brief IP address of the DHCP server, as seen by the client.
00118 */
00119
00120 char server_ip_seen_by_client[MAX_IP_ADDRESS_STR_SIZE];
00121
00122 /*! \brief This flag defines whether the server uses broadcats for responses.
00123 <UL>
00124 <LI>0: The server does not use broadcasts (always unicats).
00125 <LI>1: The server always yse broadcats.
00126 </UL>
00127 */
00128
00129 int broadcast_mode;
00130
00131 /*! \brief Deamon's user ID.
00132 */
00133
00134 char deamon_user_id[MAX_UID_SIZE];
00135
00136 /*! \brief Deamon's group ID.
00137 */
00138
00139 char deamon_group_id[MAX_GID_SIZE];
00140
00141 /*! \brief IP address sent to the client whenever the DHCP can not respond.
00142 */
00143
00144 char dummy_ip[MAX_IP_ADDRESS_STR_SIZE];
00145
00146 /*! \brief This flag defines wether the server must manage the size of the log file.
00147 */
00148
00149 int log_size_management;
00150 };
00151
00152
00153 int configuration_load (char *path, char **error);
00154
00155 #endif
00156
00157 #ifdef __cplusplus
00158 }
00159 #endif
1.2.15