| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
NSEC
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
syntax of a known type.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Refactor common code from _base64ify and _hexify, and also add support
for _hexify to skip word breaks.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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()).
|
| |
|
|
|
| |
GenericRdata or for directly imported types. This fix just computes the
all slots relatively efficiently every __getstate__().
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
remove it.
|
| |
|
|
|
|
|
| |
Classes inherit from object by default; there's no need to explicitly
include this.
Replace super(Foo, self) with super().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
__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
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Rdata.to_wire() writes to the file, and doesn't return anything.
|
| | |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Replace the open-coded import_module() with the one in importlib.
|
| | |
|
| | |
|
| |\
| |
| | |
Immutable rdata
|
| | | |
|
| |/
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|