(name '<unnamed>)
ttl
type
+ (make-ptr-p nil)
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
- (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
- (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))
(flet ((,list (&key ((:name ,tname) ,name)
((:type ,ttype) ,type)
((:data ,tdata) ,data)
- ((:ttl ,tttl) ,ttl))
+ ((:ttl ,tttl) ,ttl)
+ ((:make-ptr-p ,tmakeptrp) nil))
(collect (make-zone-record :name ,tname
:type ,ttype
:data ,tdata
- :ttl ,tttl)
+ :ttl ,tttl
+ :make-ptr-p ,tmakeptrp)
,col)))
,@body)))
',type)))))
(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"
(hash-table-keys *zones*)))
(dolist (zr (zone-records (zone-find z)))
(when (and (eq (zr-type zr) :a)
+ (zr-make-ptr-p zr)
(ipaddr-networkp (zr-data zr) net))
(let ((name (string-downcase
(join-strings