diff options
Diffstat (limited to 'rpkid/rpki/xml_utils.py')
-rw-r--r-- | rpkid/rpki/xml_utils.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/rpkid/rpki/xml_utils.py b/rpkid/rpki/xml_utils.py index be2b9510..9e4aa265 100644 --- a/rpkid/rpki/xml_utils.py +++ b/rpkid/rpki/xml_utils.py @@ -415,3 +415,17 @@ class msg(list): elt = lxml.etree.Element("{%s}msg" % (self.xmlns), nsmap = self.nsmap, version = str(self.version), type = self.type) elt.extend([i.toXML() for i in self]) return elt + + @classmethod + def query(cls, *args): + """Create a query PDU.""" + self = cls(*args) + self.type = "query" + return self + + @classmethod + def reply(cls, *args): + """Create a reply PDU.""" + self = cls(*args) + self.type = "reply" + return self |