diff options
Diffstat (limited to 'dns/edns.py')
-rw-r--r-- | dns/edns.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dns/edns.py b/dns/edns.py index 28718d5..05f76e6 100644 --- a/dns/edns.py +++ b/dns/edns.py @@ -342,3 +342,13 @@ def option_from_wire(otype, wire, current, olen): parser = dns.wire.Parser(wire, current) with parser.restrict_to(olen): return option_from_wire_parser(otype, parser) + +def register_type(implementation, otype): + """Register the implementation of an option type. + + *implementation*, a ``class``, is a subclass of ``dns.edns.Option``. + + *otype*, an ``int``, is the option type. + """ + + _type_to_class[otype] = implementation |