aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/ip.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/ip.lua b/util/ip.lua
index 894fe2fb..7c438593 100644
--- a/util/ip.lua
+++ b/util/ip.lua
@@ -52,6 +52,10 @@ local function new_ip(ipStr, proto)
return setmetatable({ addr = ipStr, packed = packed, proto = proto, zone = zone }, ip_mt);
end
+function ip_methods:normal()
+ return net.ntop(self.packed);
+end
+
function ip_methods.bits(ip)
return hex.to(ip.packed):upper():gsub(".", hex2bits);
end