Ñò î¡ßNc @ sT d Z d d k Z d d k Z d d k i Z d d k Z d d k l Z l Z l Z e i e i e ƒ d ƒ Z e i e i e ƒ d ƒ Z h Z e i e i e ƒ d ƒ Z e i e i e ƒ d ƒ Z h Z d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d „ Z d „ Z d „ Z e d j o e ƒ e ƒ n e ƒ d S( s 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 - U{http://www.ieee.org/} - Registration Authority Home Page - U{http://standards.ieee.org/regauth/} iÿÿÿÿN( t Subscribert Publishert dos2unixs oui.txts oui.idxs iab.txts iab.idxt FileIndexerc B s e Z d Z d „ Z d „ Z RS( sš 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 C s^ t | d ƒ o t | d ƒ o | | _ n t | d ƒ | _ t i | i d d ƒ| _ d S( s” Constructor. @param index_file: a file-like object or name of index file where index records will be written. t readlinet tellt wt lineterminators N( t hasattrt fht opent _csvt writer( t selft index_file( ( s4 /usr/lib/python2.6/site-packages/netaddr/eui/ieee.pyt __init__B s c C s | i i | ƒ d S( s‡ Receives and writes index data to a CSV data file. @param data: record containing offset record information. N( R t writerow( R t data( ( s4 /usr/lib/python2.6/site-packages/netaddr/eui/ieee.pyt updateP s ( t __name__t __module__t __doc__R R ( ( ( s4 /usr/lib/python2.6/site-packages/netaddr/eui/ieee.pyR = s t OUIIndexParserc B s e Z d Z d „ Z d „ Z RS( sá 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 :- - U{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 C sS t t | ƒ i ƒ t | d ƒ o t | d ƒ o | | _ n t | ƒ | _ d S( só 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 N( t superR R R R R ( R t ieee_file( ( s4 /usr/lib/python2.6/site-packages/netaddr/eui/ieee.pyR n s c C s. t } d } d } xû t oó | i i ƒ } | p Pn | o d | j o t } n | o q n d | j o‹ | d j o | i | ƒ | i | ƒ n t | ƒ } | i i ƒ t | ƒ } | i ƒ d } t | i d d ƒ d ƒ } | | g } q | t | ƒ 7} q W| i | ƒ | i | ƒ d S( s‹ Starts the parsing process which detects records and notifies registered subscribers as it finds each OUI record. i s (hex)t -t i N( t Truet NoneR R t Falset appendt notifyt lenR t splitt intt replace( R t skip_headert recordt sizet linet offsett ouit index( ( s4 /usr/lib/python2.6/site-packages/netaddr/eui/ieee.pyt parse} s0 ( R R R R R+ ( ( ( s4 /usr/lib/python2.6/site-packages/netaddr/eui/ieee.pyR Y s t IABIndexParserc B s e Z d Z d „ Z d „ Z RS( sÞ 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 :- - U{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 C sS t t | ƒ i ƒ t | d ƒ o t | d ƒ o | | _ n t | ƒ | _ d S( só 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 N( R R, R R R R ( R R ( ( s4 /usr/lib/python2.6/site-packages/netaddr/eui/ieee.pyR ½ s c C sŽ t } d } d } x[t oS| i i ƒ } | p Pn | o d | j o t } n | o q n d | j ov | d j o | i | ƒ | i | ƒ n | i i ƒ t | ƒ } | i ƒ d } | } | | g } t | ƒ } q d | j oh | t | ƒ 7} | d i d d ƒ } | i ƒ d } | i d ƒ d } t | | d ƒ d ?| d