diff options
author | Rob Austein <sra@hactrn.net> | 2014-01-07 02:17:16 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2014-01-07 02:17:16 +0000 |
commit | 8851e2a4af52fe6df2b805f5f8666bec728b338b (patch) | |
tree | f9b1b59d07b9a859c61214f01d48a5dbeec33e75 | |
parent | 941ea91a5d991608f9f01779839432996b564004 (diff) |
Add show_received_resources and show_published_objects. See #663.
svn path=/trunk/; revision=5616
-rw-r--r-- | rpkid/rpki/rpkic.py | 51 |
1 files changed, 46 insertions, 5 deletions
diff --git a/rpkid/rpki/rpkic.py b/rpkid/rpki/rpkic.py index 2ac7c9d3..02e6922d 100644 --- a/rpkid/rpki/rpkic.py +++ b/rpkid/rpki/rpkic.py @@ -624,11 +624,52 @@ class main(Cmd): print ghostbuster_request.vcard - # Other "show_" commands we should have. - # - # Ask rpkid: - # show_received_resources - # show_published_objects + def do_show_received_resources(self, arg): + """ + Show resources received by this entity from its parent(s). + """ + + if arg: + raise BadCommandSyntax("This command takes no arguments") + + for pdu in self.zoo.call_rpkid( + rpki.left_right.list_received_resources_elt.make_pdu(self_handle = self.zoo.handle)): + + print "Parent: ", pdu.parent_handle + print " notBefore:", pdu.notBefore + print " notAfter: ", pdu.notAfter + print " URI: ", pdu.uri + print " SIA URI: ", pdu.sia_uri + print " AIA URI: ", pdu.aia_uri + print " ASN: ", pdu.asn + print " IPv4: ", pdu.ipv4 + print " IPv6: ", pdu.ipv6 + + + def do_show_published_objects(self, arg): + """ + Show published objects. + """ + + # At least for now, we don't show the object itself, as this could + # be quite large and would require some pretty-printing code that + # we've not yet written. + + if arg: + raise BadCommandSyntax("This command takes no arguments") + + for pdu in self.zoo.call_rpkid( + rpki.left_right.list_published_objects_elt.make_pdu(self_handle = self.zoo.handle)): + + child = pdu.child_handle + + print "URI: ", pdu.uri + if child is not None: + print " Child:", child + + # If we were trying to parse the published objects themselves, + # we'd use the filename suffix of pdu.uri to figure out what + # kind of Base64-encoded DER object is lurking in pdu.obj. def do_load_asns(self, arg): |