f LddlZddlZddlmZmZmZddlZddlZGddZ y)N)IteratorOptionalTupleceZdZddedefdZdefdZdedefdZddedefd Zdefd Z defd Z defd Z defd Z defdZ dedefdZddedddfdZdeddfdZej*dedefdZej*defdZy)Parserwirecurrentc||_d|_t|j|_|r|j |||_yNr)rr lenendseekfurthest)selfrr s Q/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/dns/wire.py__init__zParser.__init__ s5  tyy>  IIg  returnc4|j|jz SN)r r rs r remainingzParser.remainingsxx$,,&&rsizec.|dk\sJ||jkDrtjj|j|j |j |z}|xj |z c_t |j|j |_|Sr )rdns exception FormErrorrr maxr)rroutputs r get_byteszParser.get_bytesssqyy $.." "--)) )4<<$,,*=>  DMM4<<8  r length_sizecntj|j|d}|j|S)Nbigint from_bytesr )rr!lengths rget_counted_byteszParser.get_counted_bytes s*{ ;UC~~f%%rc@|j|jSr)r rrs r get_remainingzParser.get_remaining$s~~dnn.//rcRtjd|jddS)Nz!Brstructunpackr rs r get_uint8zParser.get_uint8'!}}T4>>!#45a88rcRtjd|jddS)Nz!Hrr-rs r get_uint16zParser.get_uint16*r1rcRtjd|jddS)Nz!Irr-rs r get_uint32zParser.get_uint32-r1rcLtj|jddS)Nr#r$rs r get_uint48zParser.get_uint480s~~dnnQ/77rformatcrtj||jtj|Sr)r.r/r calcsize)rr;s r get_structzParser.get_struct3s%}}VT^^FOOF4K%LMMrNoriginz dns.name.Namecjtjj|}|r|j|}|Sr)rnamefrom_wire_parser relativize)rr?rAs rget_namezParser.get_name6s,xx((. ??6*D rwherecn|dks||jkDrtjj||_yr )r rrrr )rrEs rrz Parser.seek<s- 19(--)) ) rc#LK|dk\sJ||jkDrtjj|j} |j |z|_d|j |jk7rtjj ||_y#||_wxYwwr )rrrrr r )rr saved_ends r restrict_tozParser.restrict_toCsqyy $.." "--)) )HH  !||d*DH ||txx'mm---(!DHyDHsAB$A BB$ B!!B$c#dK d|j|_y#|j|_wxYwwr)rr rs rrestore_furthestzParser.restore_furthestTs& )J==DL4==DLs00-0)r)r,r)__name__ __module__ __qualname__bytesr%rrr r(r*r0r4r7r:strrr>rrDr contextlibcontextmanagerrrIrKrrrr s  U S '3'ce&S&&0u09399C99C98C8NNNx8O #$!!!! )())rr) rQr.typingrrr dns.exceptionrdns.namerrSrrrWs% ,,N)N)r