3 ¢báWº ã@s°dZddlZddlZdZdZdZdZdZdZ eeeeee dœZ e d d „e j ƒDƒƒZ e jeeed œƒed e d iZejd ejƒZGdd„dejjƒZdd„Zdd„Zdd„ZdS)akDNS Rdata Classes. @var _by_text: The rdata class textual name to value mapping @type _by_text: dict @var _by_value: The rdata class value to textual name mapping @type _by_value: dict @var _metaclasses: If an rdataclass is a metaclass, there will be a mapping whose key is the rdatatype value and whose value is True in this dictionary. @type _metaclasses: dictéNééééþéÿ)Ú RESERVED0ÚINÚCHÚHSÚNONEÚANYccs|]\}}||fVqdS)N©)Ú.0ÚxÚyr r ú /usr/lib/python3.6/rdataclass.pyú 2sr)ZINTERNETZCHAOSZHESIODTzCLASS([0-9]+)$c@seZdZdZdS)ÚUnknownRdataclasszA DNS class is unknown.N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r r r rrEsrcCsVtj|jƒƒ}|dkrRtj|ƒ}|dkr,t‚t|jdƒƒ}|dksJ|dkrRtdƒ‚|S)zúConvert text into a DNS rdata class value. @param text: the text @type text: string @rtype: int @raises dns.rdataclass.UnknownRdataclass: the class is unknown @raises ValueError: the rdata class value is not >= 0 and <= 65535 Nrriÿÿz'class must be between >= 0 and <= 65535) Ú_by_textÚgetÚupperÚ_unknown_class_patternÚmatchrÚintÚgroupÚ ValueError)ÚtextÚvaluerr r rÚ from_textJs  r"cCs:|dks|dkrtdƒ‚tj|ƒ}|dkr6dt|ƒ}|S)z¾Convert a DNS rdata class to text. @param value: the rdata class value @type value: int @rtype: string @raises ValueError: the rdata class value is not >= 0 and <= 65535 riÿÿz'class must be between >= 0 and <= 65535NZCLASS)rÚ _by_valuerÚrepr)r!r r r rÚto_text^s   r%cCs|tkr dSdS)zmTrue if the class is a metaclass. @param rdclass: the rdata class @type rdclass: int @rtype: boolTF)Ú _metaclasses)Zrdclassr r rÚ is_metaclassnsr')rÚreZ dns.exceptionZdnsrrr r r r rÚdictÚitemsr#Úupdater&ÚcompileÚIrZ exceptionZ DNSExceptionrr"r%r'r r r rÚs4