2 ctrlproxy: A modular IRC proxy
3 (c) 2002-2005 Jelmer Vernooij <jelmer@nl.linux.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __INTERNALS_H__
21 #define __INTERNALS_H__
23 #define CTRLPROXY_CORE_BUILD
32 #include <sys/socket.h>
33 #include <sys/types.h>
37 #include <sys/types.h>
43 #include "ctrlproxy.h"
45 #define DEFAULT_RECONNECT_INTERVAL 60
46 #define MAXHOSTNAMELEN 4096
49 void fini_networks(struct global *);
50 void kill_pending_clients(const char *reason);
51 void network_set_iochannel(struct network *s, GIOChannel *ioc);
54 void free_channels(struct network *s);
55 void network_nick_set_data(struct network_nick *n, const char *nick, const char *username, const char *host);
58 gboolean init_plugins(const char *dir);
61 char **get_motd_lines(struct client *);
64 void server_disconnected_hook_execute(struct network *);
65 void server_connected_hook_execute(struct network *);
66 gboolean new_client_hook_execute(struct client *c);
67 void lose_client_hook_execute(struct client *c);
68 gboolean run_client_filter(struct client *c, const struct line *l, enum data_direction dir);
69 gboolean run_server_filter(struct network *s, const struct line *l, enum data_direction dir);
70 gboolean run_log_filter(struct network *s, const struct line *l, enum data_direction dir);
71 gboolean run_replication_filter(struct network *s, const struct line *l, enum data_direction dir);
74 gboolean init_log(const char *file);
75 void log_network_line(const struct network *n, const struct line *l, gboolean incoming);
76 void log_client_line(const struct client *c, const struct line *l, gboolean incoming);
79 void redirect_record(const struct network *n, const struct client *c, const struct line *l);
80 void redirect_response(struct network *n, struct line *l);
81 void redirect_clear(const struct network *n);
84 gboolean client_try_cache(struct client *c, struct line *l);
87 void init_linestack(struct ctrlproxy_config *);
90 void network_update_config(struct network_state *ns, struct network_config *nc);
91 void channel_update_config(struct channel_state *ns, struct channel_config *nc);
92 void global_update_config(struct global *my_global);
95 void client_replicate(struct client *);
96 char *mode2string(char modes[255]);
97 void string2mode(char *modes, char ar[255]);
100 void free_global(struct global *);
101 void config_load_notify(struct global *global);
102 void config_save_notify(struct global *global, const char *);
103 struct global *new_global(const char *config_dir);
106 void init_nickserv(void);
107 gboolean nickserv_load(struct global *global);
108 gboolean nickserv_save(struct global *global, const char *dir);
109 void nickserv_identify_me(struct network *network, char *nick);
112 void init_admin(void);
113 gboolean admin_process_command(struct client *c, struct line *l, int cmdoffset);
114 void admin_log(const char *module, enum log_level level, const struct network *n, const struct client *c, const char *data);
117 gboolean create_configuration(const char *config_dir);
120 gboolean start_unix_socket(struct global *);
121 gboolean stop_unix_socket(struct global *);
122 #endif /* __INTERNALS_H__ */