grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026a àMÒeø ã@sddZddlZddlmZddlZeedœdd„Zeeefedœdd „Z eeefedœd d „Z dS) zIPv4 helper functions.éN)ÚUnion)ÚaddressÚreturncCs4t|ƒdkrtjj‚d|d|d|d|dfS)z�Convert an IPv4 address in binary form to text form. *address*, a ``bytes``, the IPv4 address in binary form. Returns a ``str``. éz %u.%u.%u.%urééé)ÚlenÚdnsÚ exceptionÚ SyntaxError)r©r ú,/usr/lib/python3.9/site-packages/dns/ipv4.pyÚ inet_ntoas r)ÚtextrcCs¶t|tƒs| ¡}n|}| d¡}t|ƒdkr6tjj‚|D]8}| ¡sNtjj‚t|ƒdkr:|dt dƒkr:tjj‚q:z"dd„|Dƒ}t j dg|¢RŽWSt y°tjj‚Yn0d S) zšConvert an IPv4 address in text form to binary form. *text*, a ``str`` or ``bytes``, the IPv4 address in textual form. Returns a ``bytes``. ó.rrrÚ0cSsg|] }t|ƒ‘qSr )Úint)Ú.0Úpartr r rÚ =ózinet_aton..ZBBBBN) Ú isinstanceÚbytesÚencodeÚsplitr r r r ÚisdigitÚordÚstructÚpackÚ Exception)rZbtextÚpartsrÚbr r rÚ inet_aton's       r#cCstj tj |¡¡S)zïVerify that *address* is a valid text form IPv4 address and return its canonical text form. *text*, a ``str`` or ``bytes``, the IPv4 address in textual form. Raises ``dns.exception.SyntaxError`` if the text is not valid. )r Zipv4rr#)rr r rÚ canonicalizeCs r$) Ú__doc__rÚtypingrZ dns.exceptionr rÚstrrr#r$r r r rÚs