Hacks to avoid unused variable warnings.
config.c:
Code cleanups.
extern.h:
Code cleanups.
irc.c:
Code cleanups.
main.c:
Merged singal handlers into one function, code cleanups.
misc.c:
Code cleanups.
opercmd.c, opercmd.h:
2nd parameter of checkoper was never used.
scan.c:
Code cleanups.
stats.c:
Code cleanups.
void irc_kline(char *addr, char *ip)
{
+ /* Just enough to shut gcc up */
+ if (addr || ip)
+ return;
}
void dnsbl_report(struct scan_struct *ss)
{
+ if (ss)
+ return;
}
void irc_send(char *data, ...)
{
+ if (data)
+ return;
}
int dnsbl_check(const char *addr, const char *irc_nick,
const char *irc_user, char *irc_addr)
{
+ if (addr || irc_nick || irc_user || irc_addr)
+ return(0);
return(0);
}
char *CONF_TARGET_STRING = 0;
string_list *CONF_EXCLUDE = 0;
-int CONF_SCANPORT = 0;
-int CONF_PORT = 0;
-int CONF_FDLIMIT = 0;
+unsigned int CONF_SCANPORT = 0;
+unsigned int CONF_PORT = 0;
+unsigned int CONF_FDLIMIT = 0;
/* Configuration Hash , Hashes Config Params to their Function Handlers*/
/* NAME , TYPE , REQ, REQMET, PTR TO VAR */
string_list *list, *oldlist, *nextlist;
- int i;
+ size_t i;
if(!(in = fopen(filename, "r")))
{
void config_checkreq()
{
- int i;
+ size_t i;
int errfnd = 0;
string_list *list;
extern char *CONF_TARGET_STRING;
extern string_list *CONF_EXCLUDE;
- extern int CONF_PORT;
- extern int CONF_SCANPORT;
- extern int CONF_FDLIMIT;
+ extern unsigned int CONF_PORT;
+ extern unsigned int CONF_SCANPORT;
+ extern unsigned int CONF_FDLIMIT;
- extern int OPT_DEBUG;
+ extern unsigned int OPT_DEBUG;
- extern time_t STAT_START_TIME;
- extern int STAT_NUM_CONNECTS;
+ extern time_t STAT_START_TIME;
+ extern unsigned int STAT_NUM_CONNECTS;
#endif
char *token[32];
int tokens = 0;
- int i, h, len;
time_t present;
char *key;
+ size_t i, h, len;
time(&IRC_LAST); /* Update timeout tracking */
char *irc_nick;
char conn_notice[MSGLENMAX];
+ /* Paranoia. */
+ if (tokens < 11)
+ return;
+
STAT_NUM_CONNECTS++;
/* take a copy of the original connect notice now in case we need it
char *irc_nick;
char conn_notice[MSGLENMAX];
+ /* Paranoia. */
+ if (tokens < 9)
+ return;
+
STAT_NUM_CONNECTS++;
/* take a copy of the original connect notice now in case we need it
char *irc_nick;
char conn_notice[MSGLENMAX];
+ /* Paranoia. */
+ if (tokens < 17)
+ return;
+
STAT_NUM_CONNECTS++;
/* take a copy of the original connect notice now in case we need it
char *irc_nick;
char conn_notice[MSGLENMAX];
+ /* Paranoia. */
+ if (tokens < 11)
+ return;
+
STAT_NUM_CONNECTS++;
/* take a copy of the original connect notice now in case we need
*/
static char *get_chan_key(const char *channel)
{
- size_t len;
- int i, h, ci, ki;
+ int ci, ki;
char *kp;
+ size_t i, h, len;
ci = 0;
#include "options.h"
#include "version.h"
-RETSIGTYPE do_alarm(int);
-RETSIGTYPE do_int(int);
+RETSIGTYPE do_signal(int signum);
int ALARMED = 0;
-int OPT_DEBUG = 0;
+unsigned int OPT_DEBUG = 0;
char *CONFNAME = DEFAULTNAME;
char *CONFDIR = VARDIR;
/* Setup alarm & int handlers */
- ALARMACTION.sa_handler = &(do_alarm);
+ ALARMACTION.sa_handler = &(do_signal);
ALARMACTION.sa_flags = SA_RESTART;
- INTACTION.sa_handler = &(do_int);
+ INTACTION.sa_handler = &(do_signal);
sigaction(SIGALRM, &ALARMACTION, 0);
sigaction(SIGINT, &INTACTION, 0);
return 0;
}
-
-void do_alarm(int notused)
+void do_signal(int signum)
{
- ALARMED = 1;
- alarm(1);
-}
-
-void do_int(int notused)
-{
- log("MAIN -> Caught SIGINT, bye!");
- exit(0);
+ switch (signum) {
+ case SIGALRM:
+ ALARMED = 1;
+ alarm(1);
+ break;
+ case SIGINT:
+ log("MAIN -> Caught SIGINT, bye!");
+ exit(0);
+ break;
+ }
}
char *clean(char *str)
{
- int i;
+ size_t i;
int lastnon; /* Position of last non space */
int firstnon; /* Position of first non space */
"checking, yo.", target, nick);
return;
}
- checkoper(nick, cmd, param, target, CMD_CHECK);
+ checkoper(nick, param, target, CMD_CHECK);
}
else
{
return;
}
-void checkoper(const char *nick, const char *cmd, const char *param,
- const char *target, unsigned int cmd_type)
+void checkoper(const char *nick, const char *param, const char *target,
+ unsigned int cmd_type)
{
int i;
void do_oper_cmd(const char *nick, const char *cmd,
const char *param, const char *target);
- void checkoper(const char *nick, const char *cmd,
- const char *param, const char *target,
- unsigned int cmd_type);
+ void checkoper(const char *nick, const char *param,
+ const char *target, unsigned int cmd_type);
void check_userhost(const char *userhost);
void delete_command(unsigned int index);
void reap_commands(time_t present);
char *irc_user, int verbose, char *conn_notice)
{
- int i;
+ size_t i;
scan_struct *newconn;
if(OPT_DEBUG)
#ifdef HAVE_SYS_POLL_H
static struct pollfd ufds[MAX_POLL]; /* MAX_POLL is defined in options.h */
- int i;
- unsigned long size;
+ unsigned long size, i;
#else /* select() */
fd_set w_fdset;
fd_set r_fdset;
#include "stats.h"
time_t STAT_START_TIME;
-int STAT_NUM_CONNECTS;
+unsigned int STAT_NUM_CONNECTS;
unsigned int STAT_DNSBL_MATCHES;
extern protocol_hash SCAN_PROTOCOLS[];
void do_stats(const char *target)
{
- int i;
+ size_t i;
time_t now = time(NULL);
time_t uptime = now - STAT_START_TIME;