teal-src/prosody/util/ip.d.tl
changeset 12983 fbbf4f0db8f0
parent 12939 ddb9e330d627
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/teal-src/prosody/util/ip.d.tl	Thu Mar 23 13:36:52 2023 +0100
@@ -0,0 +1,20 @@
+local record iplib
+	enum protocol
+		"IPv6"
+		"IPv4"
+	end
+	record ip_t
+		addr : string
+		packed : string
+		proto : protocol
+		zone : string
+	end
+
+	new_ip : function (string, protocol) : ip_t
+	commonPrefixLength : function (ip_t, ip_t) : integer
+	parse_cidr : function (string) : ip_t, integer
+	match : function (ip_t, ip_t, integer) : boolean
+	is_ip : function (any) : boolean
+	truncate : function (ip_t, integer) : ip_t
+end
+return iplib