00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CTRLPROXY_SETTINGS_H__
00021 #define __CTRLPROXY_SETTINGS_H__
00022
00028 #define DEFAULT_CLIENT_CHARSET NULL
00029
00033 struct channel_config {
00034 char *name;
00035 char *key;
00036 gboolean autojoin;
00037 };
00038
00042 struct tcp_server_config {
00044 char *host;
00045
00047 char *port;
00048
00050 char *bind_address;
00051
00053 gboolean ssl;
00054
00056 char *password;
00057 };
00058
00062 struct network_config
00063 {
00064 GKeyFile *keyfile;
00066 char *name;
00067 char *nick;
00068 char *fullname;
00069 char *username;
00070 char *password;
00071
00073 int implicit:1;
00074
00076 int autoconnect:1;
00077
00079 int ignore_first_nick:1;
00080
00082 int disable_cache:1;
00083
00085 int queue_speed;
00086
00088 guint reconnect_interval;
00089
00091 GList *channels;
00092
00093 enum {
00094 NETWORK_TCP,
00095 NETWORK_PROGRAM,
00096 NETWORK_VIRTUAL,
00097 NETWORK_IOCHANNEL
00098 } type;
00099
00100 union {
00101 char *virtual_type;
00102 char *program_location;
00103 struct {
00104 char *default_bind_address;
00105 GList *servers;
00106 } tcp;
00107 } type_settings;
00108
00110 char **autocmd;
00111 };
00112
00118 struct log_file_config {
00119 gboolean logbasedir_is_default;
00120 const char *logbasedir;
00121 const char *logfilename;
00122 gboolean is_irssi;
00123 const char *nickchange;
00124 const char *join;
00125 const char *part;
00126 const char *topic;
00127 const char *notopic;
00128 const char *msg;
00129 const char *action;
00130 const char *kick;
00131 const char *mode;
00132 const char *quit;
00133 const char *notice;
00134 };
00135
00139 struct allow_rule {
00140 char *username;
00141 char *password;
00142 };
00143
00147 struct listener_config {
00149 gboolean ssl;
00150 gpointer ssl_credentials;
00151
00153 char *password;
00154
00156 char *address;
00157
00159 char *port;
00160
00162 char *network;
00163 GList *allow_rules;
00164
00166 gboolean is_default;
00167 };
00168
00172 struct ctrlproxy_config {
00173 char *config_dir;
00174 GList *networks;
00175 gboolean autosave;
00176 char *motd_file;
00177 char *network_socket;
00178 char *admin_socket;
00179
00181 char *replication;
00182
00184 char *linestack_backend;
00185
00186 char *client_charset;
00187 gboolean admin_log;
00188 char *admin_user;
00189 enum {
00190 REPORT_TIME_ALWAYS,
00191 REPORT_TIME_NEVER,
00192 REPORT_TIME_REPLICATION
00193 } report_time;
00194 int report_time_offset;
00195 int max_who_age;
00196 GKeyFile *keyfile;
00197 GList *listeners;
00198 gboolean auto_listener;
00199 int listener_autoport;
00200 gboolean learn_nickserv;
00201 gboolean learn_network_name;
00205 struct auto_away_config {
00207 int max_idle_time;
00208 gint client_limit;
00209
00210 gboolean enabled;
00211
00213 char *message;
00214
00216 char *nick;
00217 } auto_away;
00218
00219 struct log_file_config *log_file;
00220 };
00221
00222
00223 G_MODULE_EXPORT struct network_config *network_config_init(struct ctrlproxy_config *cfg);
00224 G_MODULE_EXPORT void save_configuration(struct ctrlproxy_config *cfg, const char *name);
00225 G_MODULE_EXPORT struct ctrlproxy_config *load_configuration(const char *dir);
00226 G_MODULE_EXPORT struct ctrlproxy_config *init_configuration(void);
00227 G_MODULE_EXPORT void free_config(struct ctrlproxy_config *);
00228 G_MODULE_EXPORT void setup_configdir(const char *dir);
00229 G_MODULE_EXPORT gboolean g_key_file_save_to_file(GKeyFile *kf, const gchar *file, GError **error);
00230 G_MODULE_EXPORT void config_del_network(struct ctrlproxy_config *cfg, const char *name);
00231
00232 #endif