extern void config_load(const char *);
-/* structs to hold data */
-
struct IRCConf
{
- char *nick;
- char *username;
- char *realname;
-
- char *server;
- int port;
- char *password;
-
- char *vhost;
-
- char *nickserv;
- char *oper;
- char *mode;
- char *away;
-
- char *connregex;
- char *kline;
-
- list_t *channels; /* List of ChannelConf */
- list_t *performs; /* List of char * */
+ char *nick;
+ char *username;
+ char *realname;
+ char *server;
+ int port;
+ char *password;
+ char *vhost;
+ char *nickserv;
+ char *oper;
+ char *mode;
+ char *away;
+ char *connregex;
+ char *kline;
+ list_t *channels; /* List of ChannelConf */
+ list_t *performs; /* List of char * */
};
struct ChannelConf
{
- char *name;
- char *key;
- char *invite;
+ char *name;
+ char *key;
+ char *invite;
};
struct OptionsConf
{
- int negcache;
- unsigned int dns_fdlimit;
- char *pidfile;
- char *scanlog;
+ int negcache;
+ unsigned int dns_fdlimit;
+ char *pidfile;
+ char *scanlog;
};
struct UserConf
{
- list_t *masks; /* List of char * */
- list_t *scanners; /* List of char * */
+ list_t *masks; /* List of char * */
+ list_t *scanners; /* List of char * */
};
struct ScannerConf
{
- char *name;
-
- list_t *protocols;
- char *vhost;
-
- int fd;
-
- char *target_ip;
- int target_port;
-
- int timeout;
- int max_read;
-
- list_t *target_string;
- int target_string_created;
+ char *name;
+ list_t *protocols;
+ char *vhost;
+ int fd;
+ char *target_ip;
+ int target_port;
+ int timeout;
+ int max_read;
+ list_t *target_string;
+ int target_string_created;
};
struct ProtocolConf
{
- int type;
- unsigned int port;
+ int type;
+ unsigned int port;
};
struct OpmConf
{
- list_t *blacklists;
- char *dnsbl_from;
- char *dnsbl_to;
- char *sendmail;
+ list_t *blacklists;
+ char *dnsbl_from;
+ char *dnsbl_to;
+ char *sendmail;
};
-enum BlacklistType {
+enum BlacklistType
+{
A_BITMASK = 1,
A_REPLY
};
struct BlacklistConf
{
- char *name;
- char *kline;
- enum BlacklistType type;
- int ban_unknown;
- list_t *reply;
- unsigned int stats_recv;
+ char *name;
+ char *kline;
+ enum BlacklistType type;
+ int ban_unknown;
+ list_t *reply;
+ unsigned int stats_recv;
};
struct BlacklistReplyConf
{
- char number;
- char *type;
+ char number;
+ char *type;
};
struct ExemptConf
{
- list_t *masks;
+ list_t *masks;
};
#include "firedns.h"
#include "scan.h"
-extern void dnsbl_add(struct scan_struct *);
-extern void dnsbl_result(struct firedns_result *);
-extern void dnsbl_cycle(void);
-extern void dnsbl_report(struct scan_struct *ss);
-
-struct dnsbl_scan {
- struct scan_struct *ss;
- struct BlacklistConf *bl;
+struct dnsbl_scan
+{
+ struct scan_struct *ss;
+ struct BlacklistConf *bl;
};
+extern void dnsbl_add(struct scan_struct *);
+extern void dnsbl_result(struct firedns_result *);
+extern void dnsbl_cycle(void);
+extern void dnsbl_report(struct scan_struct *);
#endif
struct bopm_sockaddr
{
- struct sockaddr_in sa4;
+ struct sockaddr_in sa4;
};
-
struct bopm_ircaddr
{
- struct in_addr in4;
+ struct in_addr in4;
};
-
struct UserInfo
{
- char *irc_nick;
- char *irc_username;
- char *irc_hostname;
+ char *irc_nick;
+ char *irc_username;
+ char *irc_hostname;
};
typedef void (*irc_command) (char **, unsigned int, char *, struct UserInfo *);
struct CommandHash
{
- const char *command;
- irc_command handler;
+ const char *command;
+ irc_command handler;
};
-
extern void irc_send(const char *, ...);
extern void irc_send_channels(const char *, ...);
extern void irc_cycle(void);
#ifndef LOG_H
#define LOG_H
-extern void log_open(char *filename);
+extern void log_open(char *);
extern void log_close(void);
-extern void scanlog_open(char *filename);
+extern void scanlog_open(char *);
extern void scanlog_close(void);
#ifdef __GNUC__
extern void log_printf(const char *data, ...) __attribute__((format(printf,1,2)));
#else
extern void log_printf(const char *data, ...);
#endif
-
#endif
-
#define MAIN_H
extern void main_restart(void);
-
#endif /* MAIN_H */
extern char *dissect_time(time_t);
extern char *clean(char *);
-
#endif
struct cnode
{
- unsigned long ip; /* IP address, network byte order. */
- time_t seen; /* When it was last seen. */
- unsigned int b; /* Index of bit to be tested. */
- struct cnode *l; /* Node to the left. */
- struct cnode *r; /* Node to the right. */
+ unsigned long ip; /* IP address, network byte order. */
+ time_t seen; /* When it was last seen. */
+ unsigned int b; /* Index of bit to be tested. */
+ struct cnode *l; /* Node to the left. */
+ struct cnode *r; /* Node to the right. */
};
extern void nc_init(struct cnode **);
extern struct cnode *check_neg_cache(const unsigned long);
extern void negcache_insert(const char *);
extern void negcache_rebuild(void);
-
#endif
struct Command
{
- /* Index of command in COMMAND_TABLE in opercmd.c */
- unsigned short type;
-
- /* Command parameter.
- * <erik> but i cant think of any commands bopm will ever have that is
- * multiple parameters
- *
- * I still havn't -Erik 12/11/02
- */
- char *param;
-
- /* Who ordered it. */
- char *irc_nick;
-
- /* Where the reply is to be sent. */
- struct ChannelConf *target;
-
- /*
- * When it was added, because we might need to remove it if it does
- * not get executed.
- */
- time_t added;
+ /* Index of command in COMMAND_TABLE in opercmd.c */
+ unsigned short type;
+
+ /* Command parameter.
+ * <erik> but i cant think of any commands bopm will ever have that is
+ * multiple parameters
+ *
+ * I still havn't -Erik 12/11/02
+ */
+ char *param;
+
+ /* Who ordered it. */
+ char *irc_nick;
+
+ /* Where the reply is to be sent. */
+ struct ChannelConf *target;
+
+ /*
+ * When it was added, because we might need to remove it if it does
+ * not get executed.
+ */
+ time_t added;
};
struct OperCommandHash
{
- const char *command;
- void (*handler)(char *, char*, struct ChannelConf *);
+ const char *command;
+ void (*handler)(char *, char*, struct ChannelConf *);
};
extern void command_init(void);
extern void command_userhost(char *);
extern void command_timer(void);
-extern void command_parse(char *, char *, struct ChannelConf *,
- struct UserInfo *);
+extern void command_parse(char *, char *, struct ChannelConf *, struct UserInfo *);
#endif
struct scan_struct
{
- char *irc_nick;
- char *irc_username;
- char *irc_hostname;
+ char *irc_nick;
+ char *irc_username;
+ char *irc_hostname;
- char *ip;
- char *proof;
- OPM_REMOTE_T *remote;
+ char *ip;
+ char *proof;
+ OPM_REMOTE_T *remote;
- unsigned int scans;
- unsigned int positive;
+ unsigned int scans;
+ unsigned int positive;
- struct ChannelConf *manual_target;
+ struct ChannelConf *manual_target;
};
struct scanner_struct
{
- char *name;
- OPM_T *scanner;
- list_t *masks;
+ char *name;
+ OPM_T *scanner;
+ list_t *masks;
};
struct protocol_assoc
{
- int type;
- const char *name;
+ int type;
+ const char *name;
};
extern void scan_init(void);
struct kline_format_assoc
{
- char key;
- const void *data;
- int type;
+ char key;
+ const void *data;
+ int type;
};
#define FORMATTYPE_STRING 1
struct StatsHash
{
- int type;
- unsigned int count;
- const char *name;
+ int type;
+ unsigned int count;
+ const char *name;
};
extern void stats_init(void);
extern void stats_dnsblrecv(struct BlacklistConf *);
extern void stats_dnsblsend(void);
extern void stats_output(char *);
-
extern void fdstats_output(char *);
#endif /* STATS_H */