+
    ‰4iÆ#  ã                   óÊ   € R t ^ RIHt ^ RIt^ RIHt ^ RIH	t	H
t
 / t/ t ! R R]	4      t ! R R]
4      t ! R R	]
4      tR
 tR tR tR t]R8X  d
   ]! 4        R# ]! 4        R# )zý
Provides access to public OUI and IAB registration data published by the IEEE.

More details can be found at the following URLs :-

    - IEEE Home Page - http://www.ieee.org/
    - Registration Authority Home Page - http://standards.ieee.org/regauth/
N)Ú_open_binary)Ú
SubscriberÚ	Publisherc                   ó0   a € ] tR t^1t o RtR tR tRtV tR# )ÚFileIndexerzŽ
A concrete Subscriber that receives OUI record offset information that is
written to an index data file as a set of comma separated records.
c                óÌ   € \        VR4      '       d   \        VR4      '       d   Wn        M\        VR4      V n        \        P                  ! V P                  RR7      V n        R# )zt
Constructor.

:param index_file: a file-like object or name of index file where
    index records will be written.
ÚreadlineÚtellÚwÚ
)ÚlineterminatorN)ÚhasattrÚfhÚopenÚ_csvÚwriter)ÚselfÚ
index_files   &&Ú2/usr/lib/python3/dist-packages/netaddr/eui/ieee.pyÚ__init__ÚFileIndexer.__init__7   sF   € ô �:˜z×*Ò*¬w°zÀ6×/JÒ/JØ �Gä˜: sÓ+ˆDŒGä—k’k $§'¡'¸$Ô?ˆŽó    c                ó<   € V P                   P                  V4       R# )zo
Receives and writes index data to a CSV data file.

:param data: record containing offset record information.
N)r   Úwriterow)r   Údatas   &&r   ÚupdateÚFileIndexer.updateE   s   € ð 	�‰×Ñ˜TÖ"r   )r   r   N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r   1   s   ø‡ € ñò
@÷#ð #r   r   c                   ó<   a a€ ] tR t^Nt oRtV 3R ltR tRtVtV ;t	# )ÚOUIIndexParsera¦  
A concrete Publisher that parses OUI (Organisationally Unique Identifier)
records from IEEE text-based registration files

It notifies registered Subscribers as each record is encountered, passing
on the record's position relative to the start of the file (offset) and
the size of the record (in bytes).

The file processed by this parser is available online from this URL :-

    - http://standards.ieee.org/regauth/oui/oui.txt

This is a sample of the record structure expected::

    00-CA-FE   (hex)        ACME CORPORATION
    00CAFE     (base 16)        ACME CORPORATION
                    1 MAIN STREET
                    SPRINGFIELD
                    UNITED STATES
c                ó¦   <€ \         \        V `  4        \        VR4      '       d   \        VR4      '       d	   Wn        R# \        VR4      V n        R# )zË
Constructor.

:param ieee_file: a file-like object or name of file containing OUI
    records. When using a file-like object always open it in binary
    mode otherwise offsets will probably misbehave.
r   r	   ÚrbN)Úsuperr&   r   r   r   r   ©r   Ú	ieee_fileÚ	__class__s   &&€r   r   ÚOUIIndexParser.__init__d   ó>   ø€ ô 	Œn˜dÑ,Ô.ä�9˜j×)Ò)¬g°iÀ×.HÒ.HØŽGä˜9 dÓ+ˆDŽGr   c                ó6  € RpRp^ pRpRpRp V P                   P                  4       pV'       g   MÆV'       d	   WG9   d   RpV'       d   K>  WG9   d“   Ve#   VP                  V4       V P                  V4       \	        V4      pV P                   P                  4       \	        V4      ,
          pVP                  4       ^ ,          p	\        V	P                  WV4      ^4      p
W¨.pKÖ  V\	        V4      ,          pKê  VP                  V4       V P                  V4       R# )zs
Starts the parsing process which detects records and notifies
registered subscribers as it finds each OUI record.
TNó   (hex)ó   -r   F)	r   r   ÚappendÚnotifyÚlenr	   ÚsplitÚintÚreplace)r   Úskip_headerÚrecordÚsizeÚmarkerÚhyphenÚempty_stringÚlineÚoffsetÚouiÚindexs   &          r   ÚparseÚOUIIndexParser.parses   sè   € ð
 ˆØˆØˆàˆØˆØˆàØ—7‘7×#Ñ#Ó%ˆDçØç˜vœ~Ø#�çáàŒ~àÒ%à—M‘M $Ô'Ø—K‘K Ô'ä˜4“y�ØŸ™Ÿ™›¬#¨d«)Õ3�Ø—j‘j“l 1•o�Ü˜CŸK™K¨Ó=¸rÓB�Ø˜’ð œ˜D›	Õ!’ð 	�‰�dÔØ�‰�FÖr   ©r   ©
r   r   r   r    r!   r   rB   r"   r#   Ú__classcell__©r,   r$   s   @@r   r&   r&   N   s   ù‡ € ñõ*,÷,ò ,r   r&   c                   ó<   a a€ ] tR t^¢t oRtV 3R ltR tRtVtV ;t	# )ÚIABIndexParsera£  
A concrete Publisher that parses IAB (Individual Address Block) records
from IEEE text-based registration files

It notifies registered Subscribers as each record is encountered, passing
on the record's position relative to the start of the file (offset) and
the size of the record (in bytes).

The file processed by this parser is available online from this URL :-

    - http://standards.ieee.org/regauth/oui/iab.txt

This is a sample of the record structure expected::

    00-50-C2   (hex)        ACME CORPORATION
    ABC000-ABCFFF     (base 16)        ACME CORPORATION
                    1 MAIN STREET
                    SPRINGFIELD
                    UNITED STATES
c                ó¦   <€ \         \        V `  4        \        VR4      '       d   \        VR4      '       d	   Wn        R# \        VR4      V n        R# )zË
Constructor.

:param ieee_file: a file-like object or name of file containing IAB
    records. When using a file-like object always open it in binary
    mode otherwise offsets will probably misbehave.
r   r	   r(   N)r)   rI   r   r   r   r   r*   s   &&€r   r   ÚIABIndexParser.__init__¸   r.   r   c                ó  € RpRp^ pRpRpRpRp V P                   P                  4       pV'       g   EM,V'       d	   WH9   d   RpV'       d   K?  WH9   dz   Ve#   VP                  V4       V P                  V4       V P                   P	                  4       \        V4      ,
          p	VP                  4       ^ ,          p
T
pW¹.p\        V4      pK¾  WX9   dy   V\        V4      ,          pV^ ,          P                  Wg4      pVP                  4       ^ ,          pVP                  V4      ^ ,          p\        WÍ,           ^4      ^,	          V^ &   EK<  V\        V4      ,          pEKQ  VP                  V4       V P                  V4       R# )zs
Starts the parsing process which detects records and notifies
registered subscribers as it finds each IAB record.
TNr0   s	   (base 16)r1   r   F)	r   r   r2   r3   r	   r4   r5   r7   r6   )r   r8   r9   r:   Ú
hex_markerÚbase16_markerr<   r=   r>   r?   Ú
iab_prefixrA   ÚprefixÚsuffixs   &             r   rB   ÚIABIndexParser.parseÇ   s@  € ð
 ˆØˆØˆàˆ
Ø$ˆØˆØˆàØ—7‘7×#Ñ#Ó%ˆDçÙç˜zÔ1Ø#�çáàÔ!àÒ%Ø—M‘M $Ô'Ø—K‘K Ô'àŸ™Ÿ™›¬#¨d«)Õ3�Ø!ŸZ™Z›\¨!�_�
Ø"�Ø˜�Ü˜4“y’ØÔ&àœ˜D›	Õ!�Ø �×*Ñ*¨6Ó@�ØŸ™› a��ØŸ™ fÓ-¨aÕ0�Ü  ¥°"Ó5¸"Õ<��q”	ð œ˜D›	Õ!“ð 	�‰�dÔØ�‰�FÖr   rD   rE   rG   s   @@r   rI   rI   ¢   s   ù‡ € ñõ*,÷3ò 3r   rI   c                ój   € V! V 4      pVP                  \        V4      4       VP                  4        R# )z4Generate an index files from the IEEE registry file.N)Úattachr   rB   )Úregistry_fhÚ
index_pathÚparserÚ
oui_parsers   &&& r   Úcreate_index_from_registryrY   ý   s+   € á˜Ó$€JØ×Ñ”k *Ó-Ô.Ø×ÑÖr   c                 ó²  € \        \        P                  ! \        P                  ! \        4      R4      \        P                  ! \        P                  ! \        4      R4      \
        4       \        \        P                  ! \        P                  ! \        4      R4      \        P                  ! \        P                  ! \        4      R4      \        4       R# )z1Create indices for OUI and IAB file based lookupszoui.txtúoui.idxziab.txtúiab.idxN)rY   Ú_pathÚjoinÚdirnameÚ__file__r&   rI   © r   r   Úcreate_indicesrb     sv   € äÜ�
Š
”5—=’=¤Ó*¨IÓ6Ü�
Š
”5—=’=¤Ó*¨IÓ6Üôô
 Ü�
Š
”5—=’=¤Ó*¨IÓ6Ü�
Š
”5—=’=¤Ó*¨IÓ6Üör   c                ól  €  \         P                  ! V Uu. uF  q"P                  R4      NK  	  up4       FK  pV Uu. uF  p\        V4      NK  	  upw  rVpV P	                  V. 4       W,          P                  Wg34       KM  	  VP                  4        R# u upi u upi   TP                  4        i ; i)z/Load index from file into index data structure.zUTF-8N)r   ÚreaderÚdecoder6   Ú
setdefaultr2   Úclose)rA   ÚfpÚxÚrowÚ_Úkeyr?   r:   s   &&      r   Ú
load_indexrm     s�   € ðÜ—;’;¹2Ó>¹2°a§¡¨Ö 1¹2Ñ>Ö?ˆCÙ36Ó"7±3¨a¤3 q¦6±3Ñ"7ÑˆS˜$Ø×Ñ˜S "Ô%Ø�J×Ñ˜v˜nÖ-ñ @ð
 	�‰Ž
ùò  ?ùÚ"7øð 	�‰�
ús&   ‚B! –B¯B! ½BÁ4B! Â
B! Â!B3c                 ó~   € \        \        \        \        R4      4       \        \        \        \        R4      4       R# )z+Load OUI and IAB lookup indices into memoryr[   r\   N)rm   Ú	OUI_INDEXr   Ú__package__Ú	IAB_INDEXra   r   r   Úload_indicesrr     s$   € äŒyœ,¤{°IÓ>Ô?ÜŒyœ,¤{°IÓ>Ö?r   Ú__main__)r!   Úos.pathÚpathr]   Úcsvr   Únetaddr.compatr   Únetaddr.corer   r   ro   rq   r   r&   rI   rY   rb   rm   rr   r   ra   r   r   Ú<module>ry      s|   ðñ4õ Û å 'ß .ð €	ð €	ô#�*ô #ô:Q�Yô QôhX�Yô Xòvòòò@ð ˆzÔáÖñ †Nr   