Repository URL to install this package:
|
Version:
1.0.8-1 ▾
|
wlanpi-profiler
/
opt
/
wlanpi-profiler
/
lib
/
python3.7
/
site-packages
/
manuf
/
__pycache__
/
manuf.cpython-37.pyc
|
|---|
B
¼±IÉw@ã @ s d Z ddlmZ ddlmZ ddlZddlZddlZddlZy(ddl m
Z
ddl mZ ddl mZ W n8 e
k
r ddlm
Z
ddlmZ ddlmZ Y nX yddlmZ W n e
k
rÎ ddlmZ Y nX ddlZddlZed d
ddgZG d
d deZdd Zedkre dS )zParser library for Wireshark's OUI database.
Converts MAC addresses into a manufacturer using Wireshark's OUI database.
See README.md.
é )Úprint_function)Ú
namedtupleN)ÚRequest)Úurlopen)ÚURLError)ÚStringIOÚVendorÚmanufÚ
manuf_longÚcommentc @ s e Zd ZdZdZdZd!ddZd"dd Zd#ddZd$ddZ dd Z
dd Zdd Zdd Z
dd Ze d¡Zdd Zedd Zedd ZdS )%Ú MacParsera Class that contains a parser for Wireshark's OUI database.
Optimized for quick lookup performance by reading the entire file into memory on
initialization. Maps ranges of MAC addresses to manufacturers and comments (descriptions).
Contains full support for netmasks and other strange things in the database.
See https://www.wireshark.org/tools/oui-lookup.html
Args:
manuf_name (str): Location of the manuf database file. Defaults to "manuf" in the same
directory.
update (bool): Whether to update the manuf file automatically. Defaults to False.
Raises:
IOError: If manuf file could not be found.
z7https://gitlab.com/wireshark/wireshark/raw/master/manufzKhttps://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob_plain;f=wkaNFc C s( |p
| ¡ | _|r| ¡ n| ¡ d S )N)Úget_packaged_manuf_file_pathÚ_manuf_nameÚupdateÚrefresh)ÚselfÚ
manuf_namer © r ú/build/wlanpi-profiler-koocPu/wlanpi-profiler-1.0.8/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/manuf/manuf.pyÚ__init__C s
zMacParser.__init__c
C sb |s
| j }tj|ddd}t| ¡ }W dQ R X i | _x|D ]}yò| ¡ }|r`|d dkrbw@| dd¡}d d
| d¡D }|d d¡}| |d ¡}|
|¡}| |¡} t|dkrÚd
t
|d }
|
| krÚ|
} t|dkrø|d d¡ ¡ nd}t|dkr|d nd}t|d ||d| j| || ? f<