remove unused fn

This commit is contained in:
Daniel Barlow 2023-09-08 16:47:55 +01:00
parent 9487cb2567
commit 3e163d4253

View file

@ -13,21 +13,6 @@
(fn write-value-from-env [name] (fn write-value-from-env [name]
(write-value name (os.getenv (string.upper name)))) (write-value name (os.getenv (string.upper name))))
;; Format: <prefix>/<length>,preferred,valid[,excluded=<excluded-prefix>/<length>][,class=<prefix class #>]
;;(parse-prefix "2001:8b0:de3a:40dc::/64,7198,7198")
;;(parse-prefix "2001:8b0:de3a:1001::/64,7198,7188,excluded=1/2,thi=10")
(fn parse-prefix [str]
(fn parse-extra [s]
(let [out {}]
(each [name val (string.gmatch s ",(.-)=([^,]+)")]
(tset out name val))
out))
(let [(prefix len preferred valid extra)
(string.match str "(.-)::/(%d+),(%d+),(%d+)(.*)$")]
(merge {: prefix : len : preferred : valid} (parse-extra extra))))
(fn parse-address [str] (fn parse-address [str]
(fn parse-extra [s] (fn parse-extra [s]
@ -39,7 +24,6 @@
(string.match str "(.-)/(%d+),(%d+),(%d+)(.*)$")] (string.match str "(.-)/(%d+),(%d+),(%d+)(.*)$")]
(merge {: address : len : preferred : valid} (parse-extra extra)))) (merge {: address : len : preferred : valid} (parse-extra extra))))
(fn write-addresses-thing [prefix addresses] (fn write-addresses-thing [prefix addresses]
(each [_ a (ipairs (split " " addresses))] (each [_ a (ipairs (split " " addresses))]
(let [address (parse-address a) (let [address (parse-address a)