aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/resource_set.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-11-01 17:09:05 +0000
committerRob Austein <sra@hactrn.net>2013-11-01 17:09:05 +0000
commitcc9751ae01bc2fda652539de6a3effc1a0b7962a (patch)
tree1b8c7770879855ae85e73e8088196891bd4b7b75 /rpkid/rpki/resource_set.py
parent79c4aaee5b23979d1bb68c5eecf9464975d02d88 (diff)
Allow iteration over all the resource_ranges in a resource_bag.
svn path=/trunk/; revision=5577
Diffstat (limited to 'rpkid/rpki/resource_set.py')
-rw-r--r--rpkid/rpki/resource_set.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/rpkid/rpki/resource_set.py b/rpkid/rpki/resource_set.py
index b5da7ef0..b3260a9d 100644
--- a/rpkid/rpki/resource_set.py
+++ b/rpkid/rpki/resource_set.py
@@ -788,6 +788,14 @@ class resource_bag(object):
s += "V6: %s" % self.v6
return s
+ def __iter__(self):
+ for r in self.asn:
+ yield r
+ for r in self.v4:
+ yield r
+ for r in self.v6:
+ yield r
+
# Sadly, there are enough differences between RFC 3779 and the data
# structures in the latest proposed ROA format that we can't just use
# the RFC 3779 code for ROAs. So we need a separate set of classes