rssfeeds: D: flush - Will erase the cache file. (Must be chattr +o)
rssfeeds: D: update - Force a manual update of the feeds. (Must be chattr +o)
+hex2ip: D: Convert Hex idents for some gateways to an IP address
+hex2ip: U: ## <8 char hex value>
+hex2ip: E: ## AabBcC12
+
# vim:ts=4:sw=4:expandtab:tw=80
&addCmdHook('factinfo', ('CODEREF' => 'factinfo', 'Cmdstats' => 'Factoid Info', Module => 'Factoids', ) );
&addCmdHook('factstats?', ('CODEREF' => 'factstats', 'Cmdstats' => 'Factoid Stats', Help => 'factstats', Forker => 1, 'Identifier' => 'Factoids', ) );
&addCmdHook('help', ('CODEREF' => 'help', 'Cmdstats' => 'Help', ) );
+&addCmdHook('hex2ip', ('CODEREF' => 'hex2ip::query', 'Forker' => 1, 'Identifier' => 'hex2ip', 'Cmdstats' => 'hex2ip', 'Help' => 'hex2ip') );
&addCmdHook('HTTPDtype', ('CODEREF' => 'HTTPDtype::HTTPDtype', 'Identifier' => 'HTTPDtype', 'Cmdstats' => 'HTTPDtype', 'Forker' => 1) );
&addCmdHook('[ia]?spell', ('CODEREF' => 'spell::query', 'Identifier' => 'spell', 'Cmdstats' => 'spell', 'Forker' => 1, 'Help' => 'spell') );
&addCmdHook('insult', ('CODEREF' => 'Insult::Insult', 'Forker' => 1, 'Identifier' => 'insult', 'Help' => 'insult' ) );
--- /dev/null
+#
+# hex2ip.pl: Convert hex gateway idents to an IP (eg:ABCDEF12)
+# Author: Dan McGrath <djmcgrath@users.sourceforget.net>
+# Licensing: Artistic License (as perl itself)
+# Version: v0.1
+#
+# Copyright (c) 2007 Dan McGrath
+#
+
+package hex2ip;
+
+use strict;
+
+sub hex2ip::convert {
+ my $hexstr = shift;
+ my $result;
+
+ &::VERB("hex2ip: Converting Hex address $hexstr to IP");
+
+ if ( $hexstr =~ /^([a-fA-F0-9]{2}){4}$/ ) {
+ my @conv;
+ $hexstr =~ /(..)(..)(..)(..)/;
+
+ push @conv, hex($1);
+ push @conv, hex($2);
+ push @conv, hex($3);
+ push @conv, hex($4);
+
+ $result = uc "$hexstr = " . join(".", @conv);
+ } else {
+ $result = "Invalid string: $hexstr";
+ }
+
+ return($result);
+}
+
+sub hex2ip::query {
+ &::performStrictReply(&convert(@_));
+ return;
+}
+
+1;
+
+# vim:ts=4:sw=4:expandtab:tw=80