aboutsummaryrefslogtreecommitdiffstats
path: root/include/nms.pm
diff options
context:
space:
mode:
Diffstat (limited to 'include/nms.pm')
-rwxr-xr-xinclude/nms.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/nms.pm b/include/nms.pm
index eff61c3..3133042 100755
--- a/include/nms.pm
+++ b/include/nms.pm
@@ -8,7 +8,7 @@ use JSON;
package nms;
use base 'Exporter';
-our @EXPORT = qw(db_connect convert_mac);
+our @EXPORT = qw(db_connect convert_mac convert_decimal);
BEGIN {
require "config.pm";
@@ -54,6 +54,11 @@ sub convert_addr {
}
}
+# I am not a perl programmer
+sub convert_decimal {
+ return join("",(map { sprintf "%c", $_ } split(/\./,shift)));
+}
+
# Convert raw binary SNMP data to list of bits.
sub convert_bytelist {
return split //, unpack("B*", shift);