Changeset

12935:ddb9e330d627

util.ip: Add Teal interface description
author Kim Alvefur <zash@zash.se>
date Tue, 14 Mar 2023 19:46:46 +0100
parents 12934:c6dffebab2f8
children 12936:b796e08e6376
files teal-src/util/ip.d.tl
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/teal-src/util/ip.d.tl	Tue Mar 14 19:46:46 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