dnspython  1.16.0
About: dnspython is a DNS toolkit (for Python 2.x) that supports almost all record types.
  Fossies Dox: dnspython-1.16.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

dns.rdatatype Namespace Reference

Classes

class  UnknownRdatatype
 

Functions

def from_text (text)
 
def to_text (value)
 
def is_metatype (rdtype)
 
def is_singleton (rdtype)
 
def register_type (rdtype, rdtype_text, is_singleton=False)
 

Variables

int NONE = 0
 
int A = 1
 
int NS = 2
 
int MD = 3
 
int MF = 4
 
int CNAME = 5
 
int SOA = 6
 
int MB = 7
 
int MG = 8
 
int MR = 9
 
int NULL = 10
 
int WKS = 11
 
int PTR = 12
 
int HINFO = 13
 
int MINFO = 14
 
int MX = 15
 
int TXT = 16
 
int RP = 17
 
int AFSDB = 18
 
int X25 = 19
 
int ISDN = 20
 
int RT = 21
 
int NSAP = 22
 
int NSAP_PTR = 23
 
int SIG = 24
 
int KEY = 25
 
int PX = 26
 
int GPOS = 27
 
int AAAA = 28
 
int LOC = 29
 
int NXT = 30
 
int SRV = 33
 
int NAPTR = 35
 
int KX = 36
 
int CERT = 37
 
int A6 = 38
 
int DNAME = 39
 
int OPT = 41
 
int APL = 42
 
int DS = 43
 
int SSHFP = 44
 
int IPSECKEY = 45
 
int RRSIG = 46
 
int NSEC = 47
 
int DNSKEY = 48
 
int DHCID = 49
 
int NSEC3 = 50
 
int NSEC3PARAM = 51
 
int TLSA = 52
 
int HIP = 55
 
int CDS = 59
 
int CDNSKEY = 60
 
int OPENPGPKEY = 61
 
int CSYNC = 62
 
int SPF = 99
 
int UNSPEC = 103
 
int EUI48 = 108
 
int EUI64 = 109
 
int TKEY = 249
 
int TSIG = 250
 
int IXFR = 251
 
int AXFR = 252
 
int MAILB = 253
 
int MAILA = 254
 
int ANY = 255
 
int URI = 256
 
int CAA = 257
 
int AVC = 258
 
int TA = 32768
 
int DLV = 32769
 
dictionary _by_text
 
dictionary _by_value = {y: x for x, y in _by_text.items()}
 
dictionary _metatypes
 
dictionary _singletons
 
 _unknown_type_pattern = re.compile('TYPE([0-9]+)$', re.I)
 

Function Documentation

◆ from_text()

def dns.rdatatype.from_text (   text)

◆ is_metatype()

def dns.rdatatype.is_metatype (   rdtype)
True if the specified type is a metatype.

*rdtype* is an ``int``.

The currently defined metatypes are TKEY, TSIG, IXFR, AXFR, MAILA,
MAILB, ANY, and OPT.

Returns a ``bool``.

Definition at line 238 of file rdatatype.py.

Referenced by dns.resolver.Resolver.query().

◆ is_singleton()

def dns.rdatatype.is_singleton (   rdtype)
Is the specified type a singleton type?

Singleton types can only have a single rdata in an rdataset, or a single
RR in an RRset.

The currently defined singleton types are CNAME, DNAME, NSEC, NXT, and
SOA.

*rdtype* is an ``int``.

Returns a ``bool``.

Definition at line 254 of file rdatatype.py.

Referenced by dns.rdataset.Rdataset.add().

◆ register_type()

def dns.rdatatype.register_type (   rdtype,
  rdtype_text,
  is_singleton = False 
)
Dynamically register an rdatatype.

*rdtype*, an ``int``, the rdatatype to register.

*rdtype_text*, a ``text``, the textual form of the rdatatype.

*is_singleton*, a ``bool``, indicating if the type is a singleton (i.e.
RRsets of the type can have only one member.)

Definition at line 273 of file rdatatype.py.

Referenced by dns.rdata.register_type().

◆ to_text()

def dns.rdatatype.to_text (   value)
Convert a DNS rdata type value to text.

If the value has a known mnemonic, it will be used, otherwise the
DNS generic type syntax will be used.

Raises ``ValueError`` if the rdata type value is not >= 0 and <= 65535.

Returns a ``str``.

Definition at line 219 of file rdatatype.py.

Referenced by dns.rdataset.Rdataset.__repr__(), dns.rdata.Rdata.__repr__(), dns.rdata.get_rdata_class(), dns.rdtypes.ANY.NSEC.NSEC.to_text(), dns.rdtypes.ANY.CSYNC.CSYNC.to_text(), dns.rdtypes.ANY.NSEC3.NSEC3.to_text(), dns.rdtypes.ANY.RRSIG.RRSIG.to_text(), and dns.rdataset.Rdataset.to_text().

Variable Documentation

◆ _by_text

dictionary dns.rdatatype._by_text
private

Definition at line 95 of file rdatatype.py.

◆ _by_value

dictionary dns.rdatatype._by_value = {y: x for x, y in _by_text.items()}
private

Definition at line 172 of file rdatatype.py.

◆ _metatypes

dictionary dns.rdatatype._metatypes
private
Initial value:
1 = {
2  OPT: True
3 }

Definition at line 174 of file rdatatype.py.

◆ _singletons

dictionary dns.rdatatype._singletons
private
Initial value:
1 = {
2  SOA: True,
3  NXT: True,
4  DNAME: True,
5  NSEC: True,
6  CNAME: True,
7 }

Definition at line 178 of file rdatatype.py.

◆ _unknown_type_pattern

dns.rdatatype._unknown_type_pattern = re.compile('TYPE([0-9]+)$', re.I)
private

Definition at line 186 of file rdatatype.py.

◆ A

int dns.rdatatype.A = 1

Definition at line 25 of file rdatatype.py.

◆ A6

int dns.rdatatype.A6 = 38

Definition at line 59 of file rdatatype.py.

◆ AAAA

int dns.rdatatype.AAAA = 28

Definition at line 52 of file rdatatype.py.

◆ AFSDB

int dns.rdatatype.AFSDB = 18

Definition at line 42 of file rdatatype.py.

◆ ANY

int dns.rdatatype.ANY = 255

Definition at line 88 of file rdatatype.py.

◆ APL

int dns.rdatatype.APL = 42

Definition at line 62 of file rdatatype.py.

◆ AVC

int dns.rdatatype.AVC = 258

Definition at line 91 of file rdatatype.py.

◆ AXFR

int dns.rdatatype.AXFR = 252

Definition at line 85 of file rdatatype.py.

◆ CAA

int dns.rdatatype.CAA = 257

Definition at line 90 of file rdatatype.py.

◆ CDNSKEY

int dns.rdatatype.CDNSKEY = 60

Definition at line 75 of file rdatatype.py.

◆ CDS

int dns.rdatatype.CDS = 59

Definition at line 74 of file rdatatype.py.

◆ CERT

int dns.rdatatype.CERT = 37

Definition at line 58 of file rdatatype.py.

◆ CNAME

int dns.rdatatype.CNAME = 5

Definition at line 29 of file rdatatype.py.

◆ CSYNC

int dns.rdatatype.CSYNC = 62

Definition at line 77 of file rdatatype.py.

◆ DHCID

int dns.rdatatype.DHCID = 49

Definition at line 69 of file rdatatype.py.

◆ DLV

int dns.rdatatype.DLV = 32769

Definition at line 93 of file rdatatype.py.

◆ DNAME

int dns.rdatatype.DNAME = 39

Definition at line 60 of file rdatatype.py.

◆ DNSKEY

int dns.rdatatype.DNSKEY = 48

Definition at line 68 of file rdatatype.py.

◆ DS

int dns.rdatatype.DS = 43

Definition at line 63 of file rdatatype.py.

◆ EUI48

int dns.rdatatype.EUI48 = 108

Definition at line 80 of file rdatatype.py.

◆ EUI64

int dns.rdatatype.EUI64 = 109

Definition at line 81 of file rdatatype.py.

◆ GPOS

int dns.rdatatype.GPOS = 27

Definition at line 51 of file rdatatype.py.

◆ HINFO

int dns.rdatatype.HINFO = 13

Definition at line 37 of file rdatatype.py.

◆ HIP

int dns.rdatatype.HIP = 55

Definition at line 73 of file rdatatype.py.

◆ IPSECKEY

int dns.rdatatype.IPSECKEY = 45

Definition at line 65 of file rdatatype.py.

◆ ISDN

int dns.rdatatype.ISDN = 20

Definition at line 44 of file rdatatype.py.

◆ IXFR

int dns.rdatatype.IXFR = 251

Definition at line 84 of file rdatatype.py.

◆ KEY

int dns.rdatatype.KEY = 25

Definition at line 49 of file rdatatype.py.

◆ KX

int dns.rdatatype.KX = 36

Definition at line 57 of file rdatatype.py.

◆ LOC

int dns.rdatatype.LOC = 29

Definition at line 53 of file rdatatype.py.

◆ MAILA

int dns.rdatatype.MAILA = 254

Definition at line 87 of file rdatatype.py.

◆ MAILB

int dns.rdatatype.MAILB = 253

Definition at line 86 of file rdatatype.py.

◆ MB

int dns.rdatatype.MB = 7

Definition at line 31 of file rdatatype.py.

◆ MD

int dns.rdatatype.MD = 3

Definition at line 27 of file rdatatype.py.

◆ MF

int dns.rdatatype.MF = 4

Definition at line 28 of file rdatatype.py.

◆ MG

int dns.rdatatype.MG = 8

Definition at line 32 of file rdatatype.py.

◆ MINFO

int dns.rdatatype.MINFO = 14

Definition at line 38 of file rdatatype.py.

◆ MR

int dns.rdatatype.MR = 9

Definition at line 33 of file rdatatype.py.

◆ MX

int dns.rdatatype.MX = 15

Definition at line 39 of file rdatatype.py.

◆ NAPTR

int dns.rdatatype.NAPTR = 35

Definition at line 56 of file rdatatype.py.

◆ NONE

int dns.rdatatype.NONE = 0

Definition at line 24 of file rdatatype.py.

◆ NS

int dns.rdatatype.NS = 2

Definition at line 26 of file rdatatype.py.

◆ NSAP

int dns.rdatatype.NSAP = 22

Definition at line 46 of file rdatatype.py.

◆ NSAP_PTR

int dns.rdatatype.NSAP_PTR = 23

Definition at line 47 of file rdatatype.py.

◆ NSEC

int dns.rdatatype.NSEC = 47

Definition at line 67 of file rdatatype.py.

◆ NSEC3

int dns.rdatatype.NSEC3 = 50

Definition at line 70 of file rdatatype.py.

◆ NSEC3PARAM

int dns.rdatatype.NSEC3PARAM = 51

Definition at line 71 of file rdatatype.py.

◆ NULL

int dns.rdatatype.NULL = 10

Definition at line 34 of file rdatatype.py.

◆ NXT

int dns.rdatatype.NXT = 30

Definition at line 54 of file rdatatype.py.

◆ OPENPGPKEY

int dns.rdatatype.OPENPGPKEY = 61

Definition at line 76 of file rdatatype.py.

◆ OPT

int dns.rdatatype.OPT = 41

Definition at line 61 of file rdatatype.py.

◆ PTR

int dns.rdatatype.PTR = 12

Definition at line 36 of file rdatatype.py.

◆ PX

int dns.rdatatype.PX = 26

Definition at line 50 of file rdatatype.py.

◆ RP

int dns.rdatatype.RP = 17

Definition at line 41 of file rdatatype.py.

◆ RRSIG

int dns.rdatatype.RRSIG = 46

Definition at line 66 of file rdatatype.py.

◆ RT

int dns.rdatatype.RT = 21

Definition at line 45 of file rdatatype.py.

◆ SIG

int dns.rdatatype.SIG = 24

Definition at line 48 of file rdatatype.py.

◆ SOA

int dns.rdatatype.SOA = 6

Definition at line 30 of file rdatatype.py.

◆ SPF

int dns.rdatatype.SPF = 99

Definition at line 78 of file rdatatype.py.

◆ SRV

int dns.rdatatype.SRV = 33

Definition at line 55 of file rdatatype.py.

◆ SSHFP

int dns.rdatatype.SSHFP = 44

Definition at line 64 of file rdatatype.py.

◆ TA

int dns.rdatatype.TA = 32768

Definition at line 92 of file rdatatype.py.

◆ TKEY

int dns.rdatatype.TKEY = 249

Definition at line 82 of file rdatatype.py.

◆ TLSA

int dns.rdatatype.TLSA = 52

Definition at line 72 of file rdatatype.py.

◆ TSIG

int dns.rdatatype.TSIG = 250

Definition at line 83 of file rdatatype.py.

◆ TXT

int dns.rdatatype.TXT = 16

Definition at line 40 of file rdatatype.py.

◆ UNSPEC

int dns.rdatatype.UNSPEC = 103

Definition at line 79 of file rdatatype.py.

◆ URI

int dns.rdatatype.URI = 256

Definition at line 89 of file rdatatype.py.

◆ WKS

int dns.rdatatype.WKS = 11

Definition at line 35 of file rdatatype.py.

◆ X25

int dns.rdatatype.X25 = 19

Definition at line 43 of file rdatatype.py.