netaddr.eui.ieee.OUIIndexParser

Package netaddr :: Package eui :: Module ieee :: Class OUIIndexParser |
[hide private]
[frames] | no frames]

# Class OUIIndexParser

        object --+
                 |
    core.Publisher --+
                     |
                    OUIIndexParser

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

Instance Methods | [hide private]
__init__(self, ieee_file) Constructor. |
parse(self) Starts the parsing process which detects records and notifies registered subscribers as it finds each OUI record. |
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`
Inherited from core.Publisher
attach(self, subscriber) Add a new subscriber. |
detach(self, subscriber) Remove an existing subscriber. |
notify(self, data) Send update data to to all registered Subscribers. |

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, ieee_file) (Constructor) |
Constructor. Parameters: `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. Overrides: object.__init__