Permalink
Browse files

making the code for pulling rr's out of a zone more friendly

  • Loading branch information...
Bryan Weber
Bryan Weber committed Apr 20, 2012
1 parent aa7e777 commit 657229ebeb4f4ad7cc4697ce5c695ebf67056471
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/clj_dns/core.clj
View
@@ -156,7 +156,7 @@
(.removeRecord placeholder-soa)
(.removeRecord placeholder-ns))))
-(defn empty-zone [] (zone-framgment "."))
+(defn empty-zone [] (zone-fragment "."))
;; zone passed in can be a File or InputStream
(defn parse-master [zone]
@@ -172,10 +172,16 @@
(defn add-rrs [zone & rrs]
(doseq [] (map #(.addRecord zone %) rrs)))
-; Get the resource records from a zone.
-(defn rrs-from-zone [zone]
+(defn rrsets-from-zone [zone]
(iterator-seq (.iterator zone)))
+(defn rrs-from-rrset [rrset]
+ (iterator-seq (.rrs rrset)))
+
+;; Get the resource records from a zone.
+(defn rrs-from-zone [zone]
+ (doseq [] (map rrs-from-rrset (rrsets-from-zone zone))))
+
;; merge resource records from b into a
(defn rrs-into [a b]
(add-rrs a (rrs-from-zone b)))

0 comments on commit 657229e

Please sign in to comment.