The :svc record type inserts an A record into the zone without inserting
a matching PTR record into the reverse zone(s). This is useful for
service role addresses.
To make this work, we add a new slot make-ptr-p to zone records which is
used to label those A records which are eligible to be turned into
PTRs. This mechanism is, I hope, considerably simpler than the old
defsubp system.
(name '<unnamed>)
ttl
type
(name '<unnamed>)
ttl
type
data)
(defstruct (zone-subdomain (:conc-name zs-))
data)
(defstruct (zone-subdomain (:conc-name zs-))
The LIST argument names a function to be bound in the body to add a new
low-level record to the zone. It has the prototype
The LIST argument names a function to be bound in the body to add a new
low-level record to the zone. It has the prototype
- (LIST &key :name :type :data :ttl)
+ (LIST &key :name :type :data :ttl :make-ptr-p)
- These default to the above arguments (even if you didn't accept the
- arguments)."
+ These (except MAKE-PTR-P, which defaults to nil) default to the above
+ arguments (even if you didn't accept the arguments)."
(setf types (listify types))
(let* ((type (car types))
(func (intern (format nil "ZONE-PARSE/~:@(~A~)" type))))
(with-parsed-body (body decls doc) body
(setf types (listify types))
(let* ((type (car types))
(func (intern (format nil "ZONE-PARSE/~:@(~A~)" type))))
(with-parsed-body (body decls doc) body
- (with-gensyms (col tname ttype tttl tdata i)
+ (with-gensyms (col tname ttype tttl tdata tmakeptrp i)
`(progn
(dolist (,i ',types)
(setf (get ,i 'zone-parse) ',func))
`(progn
(dolist (,i ',types)
(setf (get ,i 'zone-parse) ',func))
(flet ((,list (&key ((:name ,tname) ,name)
((:type ,ttype) ,type)
((:data ,tdata) ,data)
(flet ((,list (&key ((:name ,tname) ,name)
((:type ,ttype) ,type)
((:data ,tdata) ,data)
+ ((:ttl ,tttl) ,ttl)
+ ((:make-ptr-p ,tmakeptrp) nil))
(collect (make-zone-record :name ,tname
:type ,ttype
:data ,tdata
(collect (make-zone-record :name ,tname
:type ,ttype
:data ,tdata
+ :ttl ,tttl
+ :make-ptr-p ,tmakeptrp)
,col)))
,@body)))
',type)))))
,col)))
,@body)))
',type)))))
(defzoneparse :a (name data rec)
":a IPADDR"
(defzoneparse :a (name data rec)
":a IPADDR"
- (rec :data (parse-ipaddr data)))
+ (rec :data (parse-ipaddr data) :make-ptr-p t))
+
+(defzoneparse :svc (name data rec)
+ ":svc IPADDR"
+ (rec :type :a :data (parse-ipaddr data)))
(defzoneparse :ptr (name data rec :zname zname)
":ptr HOST"
(defzoneparse :ptr (name data rec :zname zname)
":ptr HOST"
(hash-table-keys *zones*)))
(dolist (zr (zone-records (zone-find z)))
(when (and (eq (zr-type zr) :a)
(hash-table-keys *zones*)))
(dolist (zr (zone-records (zone-find z)))
(when (and (eq (zr-type zr) :a)
(ipaddr-networkp (zr-data zr) net))
(let ((name (string-downcase
(join-strings
(ipaddr-networkp (zr-data zr) net))
(let ((name (string-downcase
(join-strings