f&dZddlZddlZddlmZmZddlZddlZejdZ de de fdZ ejdZejd Zejd Zdd ee e fd ede fd ZdZde defdZd ee e fde fdZy)zIPv6 helper functions.N)ListUnionz 0+([0-9a-f]+)addressreturnct|dk7r tdtj|}g}d}t|}||krZ|||dzj }t j |}||jd}|j||dz }||krZd}d}d} d} td D]'}||d k7r| s|} | | z } | |kDr| }| }d} !| r$|} d } )| rd } | | z } | |kDr| }| }|dkDry|dk(rC|d k(s |d k(r9|d dk(r1|d k(rd} nd} | tjj|ddz}|Sdj|d|dzdj|||zdz}|Sdj|}|S)zConvert an IPv6 address in binary form to text form. *address*, a ``bytes``, the IPv6 address in binary form. Raises ``ValueError`` if the address isn't 16 bytes long. Returns a ``str``. z IPv6 addresses are 16 bytes longrNF0Tffffz::z::ffff: :)len ValueErrorbinasciihexlifydecode _leading_zeromatchgroupappendrangednsipv4 inet_ntoajoin)rhexchunksilchunkm best_startbest_lenstart last_was_zeroend current_lenprefixthexs Q/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/dns/ipv6.pyrrs 7|r;<<   7 #C F A CA a%AA%%'    & =GGAJE e Q a%JH EM 1X !9 !Ek )!&J*H % E MEk  !J"H!| ?A Q6!9PVCV1}"CHH..wrs|<r`s$  +, BuBBJRZZ6 7 RZZ)2::i(Z(E#u*%Z(TZ(eZ(z,.u..8uS%Z(8S8r0