aboutsummaryrefslogtreecommitdiff
path: root/src/property/network.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-06-25 09:08:43 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-06-25 16:10:57 -0700
commit4d7fd7511109d004a515af618867a151ec3be1f2 (patch)
tree45b714c739914fa5d576ca44113f952e3d19a075 /src/property/network.lisp
parent7dd46c56b01355e506d6054ecc73fe2e388773aa (diff)
downloadconsfigurator-4d7fd7511109d004a515af618867a151ec3be1f2.tar.gz
add NETWORK:{ALIASES,IPV4,IPV6}
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/network.lisp')
-rw-r--r--src/property/network.lisp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/property/network.lisp b/src/property/network.lisp
index 59d34b0..7a909ff 100644
--- a/src/property/network.lisp
+++ b/src/property/network.lisp
@@ -18,6 +18,25 @@
(in-package :consfigurator.property.network)
(named-readtables:in-readtable :consfigurator)
+(defprop aliases :posix (&rest aliases)
+ "Record other DNS names by which the host is known. For example, a mail
+server might have aliases like imap.example.org and smtp.example.org, even
+though its hostname is neither 'imap' nor 'smtp'."
+ (:desc (format nil "Has alias~1{~#[es~;~;es~]~} ~:*~{~A~^, ~}" aliases))
+ (:hostattrs (apply #'pushnew-hostattrs
+ :aliases (delete (get-hostname) (flatten aliases)
+ :test #'string=))))
+
+(defprop ipv4 :posix (&rest addresses)
+ "Record the host's IPv4 addresses."
+ (:desc (format nil "Has IPv4 ~{~A~^, ~}" addresses))
+ (:hostattrs (apply #'pushnew-hostattrs :ipv4 (flatten addresses))))
+
+(defprop ipv6 :posix (&rest addresses)
+ "Record the host's IPv6 addresses."
+ (:desc (format nil "Has IPv6 ~{~A~^, ~}" addresses))
+ (:hostattrs (apply #'pushnew-hostattrs :ipv6 (flatten addresses))))
+
(defprop static :posix (interface address &optional gateway &rest options)
"Configures an interface with a static IP address.
OPTIONS is a list of even length of alternating keys and values."