3 ¢báWê ã@s†dZddlZdZdZdZdZdZeeeeedœZe dd „ej ƒDƒƒZ Gd d „d ej j ƒZd d „Zdd„Zdd„Zdd„Zdd„ZdS)z DNS Opcodes.éNéééé)ÚQUERYÚIQUERYÚSTATUSÚNOTIFYÚUPDATEccs|]\}}||fVqdS)N©)Ú.0ÚxÚyr r ú/usr/lib/python3.6/opcode.pyú &src@seZdZdZdS)Ú UnknownOpcodezAn DNS opcode is unknown.N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r r r rr)srcCsB|jƒr$t|ƒ}|dkr$|dkr$|Stj|jƒƒ}|dkr>t‚|S)zžConvert text into an opcode. @param text: the textual opcode @type text: string @raises UnknownOpcode: the opcode is unknown @rtype: int réN)ÚisdigitÚintÚ_by_textÚgetÚupperr)ÚtextÚvaluer r rÚ from_text.s rcCs |d@d?S)zUExtract an opcode from DNS message flags. @param flags: int @rtype: int ixé r )Úflagsr r rÚ from_flagsAsr!cCs |d>d@S)z`Convert an opcode to a value suitable for ORing into DNS message flags. @rtype: int rixr )rr r rÚto_flagsKsr"cCstj|ƒ}|dkrt|ƒ}|S)z–Convert an opcode to text. @param value: the opcdoe @type value: int @raises UnknownOpcode: the opcode is unknown @rtype: string N)Ú _by_valuerÚstr)rrr r rÚto_textTs r%cCs t|ƒtkS)znTrue if the opcode in flags is UPDATE. @param flags: DNS flags @type flags: int @rtype: bool )r!r )r r r rÚ is_updatecsr&)rZ dns.exceptionZdnsrrrr r rÚdictÚitemsr#Z exceptionZ DNSExceptionrrr!r"r%r&r r r rÚs$