a
Mew1 @ s d Z ddlZddlZddlmZmZmZ ddlZddl Zddl
ZddlZddlZddl
ZddlZejjhZejjejjejjhZdd ZejG dd dejZG dd d ZejjG d
d deZdS )z)DNS nodes. A node is a set of rdatasets. N)AnyDictOptionalc C s || v p|t jjko|| v S N)dns rdatatypeZRRSIG)Zrdtypesrdtypecovers r
,/usr/lib/python3.9/site-packages/dns/node.py_matches_type_or_its_signature, s r c @ sR e Zd ZdZdZdZdZeej j
ej j
d dddZeejj
d dd d
ZdS )NodeKindzRdatasets in nodesr )r r returnc C s. t t||rtjS t t||r$tjS tjS d S r )r _cname_typesr
CNAME_neutral_typesNEUTRALREGULAR)clsr r r
r
r classify8 s
zNodeKind.classify)rdatasetr c C s | |j|jS r )r r r )r r r
r
r classify_rdatasetC s zNodeKind.classify_rdatasetN)__name__
__module____qualname____doc__r r r classmethodr r RdataTyper r Rdatasetr r
r
r
r r
0 s
r
c @ s( e Zd ZdZdgZdd Zejje e
ef e
dddZdd Z
d
d Zdd
Zdd Zdd Zdd ZejjdfejjejjejjeejjdddZejjdfejjejjejjeeejj dddZejjfejjejjejjddddZejjdddd Ze d!d"d#Z!ed!d$d%Z"dS )&Nodea A Node is a set of rdatasets.
A node is either a CNAME node or an "other data" node. A CNAME
node contains only CNAME, KEY, NSEC, and NSEC3 rdatasets along with their
covering RRSIG rdatasets. An "other data" node contains any
rdataset other than a CNAME or RRSIG(CNAME) rdataset. When
changes are made to a node, the CNAME or "other data" state is
always consistent with the update, i.e. the most recent change
wins. For example, if you have a node which contains a CNAME
rdataset, and then add an MX rdataset to it, then the CNAME
rdataset will be deleted. Likewise if you have a node containing
an MX rdataset and add a CNAME rdataset, the MX rdataset will be
deleted.
rdatasetsc C s
g | _ d S r r" selfr
r
r __init__Z s z
Node.__init__)namekwr c K sR t }| jD ]2}t|dkr||j|fi | |d q| dd S )a" Convert a node to text format.
Each rdataset at the node is printed. Any keyword arguments
to this method are passed on to the rdataset's to_text() method.
*name*, a ``dns.name.Name``, the owner name of the
rdatasets.
Returns a ``str``.
r
N)ioStringIOr" lenwriteto_textgetvalue)r% r' r( srdsr
r
r r/ ^ s
zNode.to_textc C s dt t| d S )Nz