Skip to content
Snippets Groups Projects
Commit 73f352f9 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Removed more functions & added VERSION to globals

parent 33120b6f
No related branches found
No related tags found
No related merge requests found
......@@ -233,6 +233,7 @@ sub init
# Certain things we need
$globals->{'users'} = { };
$globals->{'logger'} = $logger;
$globals->{'version'} = VERSION;
# Load dictionaries
$logger->log(LOG_INFO,"[MAIN] Initializing dictionaries...");
......@@ -288,31 +289,4 @@ sub plugin_register {
return 0;
}
# Simple function to reduce everything to kbit
sub getKbit
{
my ($counter,$quantifier) = @_;
# If there is no counter, return 0
return 0 if (!defined($counter));
# We need a quantifier
return undef if (!defined($quantifier));
# Initialize counter
my $newCounter = $counter;
if ($quantifier =~ /^m$/i) {
$newCounter = $counter * 1024;
} elsif ($quantifier =~ /^k$/i) {
$newCounter = $counter * 1;
} else {
return undef;
}
return $newCounter;
}
# vim: ts=4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment