summaryrefslogtreecommitdiff
path: root/dns/rdata.py
Commit message (Collapse)AuthorAgeFilesLines
* Pass kw from dns.rdata.to_text to _hexify and _base64ifyPeter Thomassen2021-01-051-3/+3
|
* processing order implementationBob Halley2020-09-021-0/+9
|
* _as_ttl was not returning the value if converting from a stringBob Halley2020-09-011-1/+1
|
* replace() can now rely on constructors to validateBob Halley2020-08-271-4/+0
|
* more constructor checking workBob Halley2020-08-261-1/+15
|
* remove _constify() uses; more complete checking of bitmap windows types like ↵Bob Halley2020-08-251-0/+2
| | | | NSEC
* finish type constructor type checkingBob Halley2020-08-221-5/+8
|
* checkpoint rdata constructor checkingBob Halley2020-08-211-4/+105
|
* add as_rdataclass() and as_rdatatype(), and use them in rdata constructorBob Halley2020-08-211-2/+8
|
* Detect and reject attempts to use compressed names in the generic rdataBob Halley2020-08-211-0/+10
| | | | syntax of a known type.
* make name and rdata use the immutable decoratormore-immutBob Halley2020-08-191-11/+9
|
* Add immutable module.Bob Halley2020-08-081-15/+4
|
* the abstract wire parse method for Rdata is now from_wire_parser()Bob Halley2020-07-311-1/+1
|
* Wrap exceptions from rdata from_text() and from_wire().wrapBob Halley2020-07-261-25/+26
|
* ignore coverage on abstract methodsBob Halley2020-07-241-4/+4
|
* a way of doing commentscommentsBob Halley2020-07-201-14/+26
|
* Fix _wordbreak() to always return a str.Brian Wellington2020-07-091-5/+6
|
* Generalize the word breaking code.Brian Wellington2020-07-091-13/+14
| | | | | Refactor common code from _base64ify and _hexify, and also add support for _hexify to skip word breaks.
* Make dns.rdata._base64ify(..., 0) work.Brian Wellington2020-07-091-0/+2
| | | | | | | | | | In some cases, the caller absolutely doesn't want word breaks. This shouldn't be the case for any normal DNS record, but is for records that don't have well-defined text formats, like TSIG and TKEY. Allow them to pass 0 (or None), to indicate that no word breaks should be added. Previously, passing either 0 or None resulted in an exception, as the value was used directly as the step in a slice.
* Rework wire format processing.Bob Halley2020-07-021-9/+36
| | | | | | Wire format data is now done via a dns.wire.Parser, which does all of the bookkeeping and also provides convenience routines (e.g. get_uint16() or get_name()).
* The cached _all_slots technique of the earlier pickle fix didn't work forBob Halley2020-06-221-12/+6
| | | | | GenericRdata or for directly imported types. This fix just computes the all slots relatively efficiently every __getstate__().
* Fix rdata pickling.Bob Halley2020-06-181-2/+24
| | | | | | | | | | | Coverage testing showed that while rdatas would pickle and unpickle apparently successfully, in fact only the slots from the deepest class in the inheritance chain would be restored. So, e.g., a restored A rdata would have an address attribute but no rdclass or rdtype attributes, and so things like rdata comparison would break. This change preserves the whole set of slots, from all ancestors as well as the object, as a dictionary.
* validate rdata replace()Bob Halley2020-06-181-2/+7
|
* Now that rdata are immutable, there is no point to the validate() method, soBob Halley2020-06-171-15/+0
| | | | remove it.
* Minor Python 3 cleanups.Brian Wellington2020-06-031-2/+2
| | | | | | | Classes inherit from object by default; there's no need to explicitly include this. Replace super(Foo, self) with super().
* Improvements to dns.rdata.to_wire().Brian Wellington2020-06-011-10/+16
| | | | | | | | | | | | | | | This does two things. 1) Makes the file parameter optional, removing the requirement that callers create an io.BytesIO object if all they want is the bytes. This is done by renaming all of the rdata subclass to_wire() methods to _to_wire(), and making dns.rdata.to_wire() create the io.BytesIO internally if needed, and then delegate to the subclass. 2) Add canonicalize=False parameter, allowing code reuse for conversion to wire format and conversion to hashable format. This also removes all of the rdata subclass to_digestable routines that are no longer needed, as dns.rdata.to_digestable will work for all rdata types.
* make rdata objects picklable againPetr Špaček2020-05-271-0/+7
| | | | | | | | | | | __getstate__ implementation based on tuple and ordered __slots__ is slightly faster than implementation based on dicts. It also produces smaller blobs. Speed of this implementation is +- few percents the same as it was in dnspython 1.16.0 and it now produces smaller blobs. Fixes: #485
* Remove dns.rdata{type,class}.to_enum.Brian Wellington2020-05-211-4/+4
| | | | | | | These methods (which convert a str/int into an enum/int) shouldn't be commonly used by external code, so don't need to exist at the module level. The make() method on the enum class (renamed from to_enum()) can still be used, and the internal callers have been updated to use it.
* Finish rdatatype conversion.Brian Wellington2020-05-181-1/+6
| | | | | | Add more checking to dns.rdata.register_type, to ensure that an existing type mnemonic isn't overwritten. Use the enum functionality for mapping names to values and values to names, rather than duplicating it.
* Start converting rdatatype/rdataclass to enum.Brian Wellington2020-05-181-0/+4
|
* more documentationBob Halley2020-05-091-0/+1
|
* in doco, text->str, binary->bytesBob Halley2020-05-081-6/+6
|
* Add IDNA codec support to tokenizer and dns.rdata.from_text()Bob Halley2020-05-031-2/+9
|
* do not import BytesIO into rdata namespaceBob Halley2020-05-011-2/+1
|
* Fix documentation.Brian Wellington2020-04-211-1/+1
| | | | Rdata.to_wire() writes to the file, and doesn't return anything.
* Add dns.rdata.Rdata.to_generic()Brian Wellington2020-04-211-0/+10
|
* Add dns.rdata.Rdata.replace()Brian Wellington2020-04-021-0/+34
| | | | | | Now that Rdata instances are immutable, there needs to be a way to make a new Rdata based on an existing one. replace() creates a clone of the current Rdata, overriding fields with the specified parameters.
* Further improve get_rdata_class().Brian Wellington2020-04-021-0/+2
| | | | | | | When we find a class-independent type, cache it for both class ANY and the requested type, to avoid an extra dict lookup the next time. If we don't find anything, cache GenericRdata, to avoid extra module loads the next time.
* Optimize get_rdata_class().Brian Wellington2020-04-021-15/+16
| | | | | | | This replaces the module cache with a class cache, so that the getattr() call to retrieve the class happens only when a new type module is loaded, not in the common case. This also allows avoiding the calls to dns.rdataclass.to_text() and dns.rdatatype.to_text() in the common case.
* Use importlib.import_module.Brian Wellington2020-04-021-15/+1
| | | | Replace the open-coded import_module() with the one in importlib.
* more delintingBob Halley2020-04-021-3/+3
|
* delintBob Halley2020-04-021-1/+1
|
* Merge pull request #434 from bwelling/immutable-rdataBob Halley2020-04-021-3/+26
|\ | | | | Immutable rdata
| * Checkpoint immutable rdata.Brian Wellington2020-03-311-3/+26
| |
* | Remove dns.rdata.choose_relativity().Brian Wellington2020-03-311-5/+0
|/ | | | | | This method changes rdata in place, so prevents rdata from becoming immutable. There are no in-tree users, and if there are out of tree users, they are rate and hard to find.
* Add relativize_to to from_text().Brian Wellington2020-03-181-7/+13
| | | | | | | | | | | | | | | When calling from_text, the zone code needs to apply the current origin (which may or may not be the zone origin, if sub-zone $ORIGIN statements are present), and may also want to relativize the contents to the zone origin. Previously, this was done by explicitly reading records as absolute, and then relativizing them laster. With this change, the work is moved to the tokenizer. This gets rid of the remaining internal uses of dns.rdata.choose_relativity(), which prevents rdata from being immutable.
* remove bytearray() wrapping used for python 2 compatibilityBob Halley2019-01-051-1/+1
|
* Remove _compat module.Bob Halley2018-12-091-4/+3
|
* delintBob Halley2018-12-011-3/+0
|
* update copyrightBob Halley2018-12-011-0/+2
|