-- Noteworthy changes in version 1.0.4 (2015-??-??)
o) Log timestamp format is ISO8601 now
+o) Added 'protocols' command which dumps a list of configured scanners
+ and their associated protocols/ports to a channel
-- Noteworthy changes in version 1.0.3 (2015-01-28)
botnick stats -- Output scan stats, uptime and client connection count.
-botnick fdstat -- Output some into about file descriptors in use.
+botnick fdstat -- Output some info about file descriptors in use.
+
+botnick protocols -- Output configured scanners and their associated protocols/ports.
Also if several HOPMs are present in one channel they will all respond to !all,
for example !all stats.
static void cmd_check(char *, const struct ChannelConf *);
static void cmd_stat(char *, const struct ChannelConf *);
static void cmd_fdstat(char *, const struct ChannelConf *);
+static void cmd_protocols(char *, const struct ChannelConf *);
static const struct OperCommandHash COMMAND_TABLE[] =
{
- { "CHECK", cmd_check },
- { "SCAN", cmd_check },
- { "STAT", cmd_stat },
- { "STATS", cmd_stat },
- { "STATUS", cmd_stat },
- { "FDSTAT", cmd_fdstat },
- { NULL, NULL }
+ { "CHECK", cmd_check },
+ { "SCAN", cmd_check },
+ { "STAT", cmd_stat },
+ { "STATS", cmd_stat },
+ { "STATUS", cmd_stat },
+ { "FDSTAT", cmd_fdstat },
+ { "PROTOCOLS", cmd_fdstat },
+ { NULL, NULL }
};
{
fdstats_output(target->name);
}
+
+static void
+cmd_protocols(char *param, const struct ChannelConf *target)
+{
+ node_t *node, *node2;
+
+ LIST_FOREACH(node, ScannerItemList->head)
+ {
+ const struct ScannerConf *sc = node->data;
+ irc_send("PRIVMSG %s :Scanner: '%s'", target->name, sc->name);
+
+ LIST_FOREACH(node2, sc->protocols->head)
+ {
+ const struct ProtocolConf *proto = node2->data;
+ irc_send("PRIVMSG %s : %s:%d", target->name, scan_gettype(proto->type), proto->port);
+ }
+ }
+}