aboutsummaryrefslogtreecommitdiffstats
path: root/include/nms.pm
diff options
context:
space:
mode:
authorKristian Lyngstøl <kly@kly.no>2017-04-16 01:47:57 +0200
committerKristian Lyngstøl <kly@kly.no>2017-04-16 01:47:57 +0200
commit0b99608227d53c9eebb01fd7f98d1618cbb7a2cf (patch)
treebc7a412d82ced33c10749289228df0cda942e632 /include/nms.pm
parentbb862773d69bc5997bd1628a3f0505827e7cfe5c (diff)
TG17 monster commit
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);