__init__.py 897 Bytes
Newer Older
1
2
3
4
5
6
7
from flask import Blueprint
from net_suite import app, get_git_version, ModMetaData
import requests


# we are assuming, that at the time of loading the app is initializes and the config is loaded
bb_name = 'macfinder'
janis.streib's avatar
fixup    
janis.streib committed
8
macfinder = Blueprint(bb_name, __name__, template_folder='templates')
9
10
11
12
app.logger.info('Loading OUI databse...')
ouis = requests.get('http://standards-oui.ieee.org/oui.txt').text.split('\n')
OUI_DB = dict()
for line in ouis:
janis.streib's avatar
janis.streib committed
13
    if '(hex)' not in line:
14
15
16
17
18
19
        continue
    parts = line.split('(hex)')
    OUI_DB[parts[0].strip().lower().replace('-', ':')] = parts[1].strip()

METADATA = ModMetaData(name=bb_name, mod_path=__name__, gitlab_url='https://git.scc.kit.edu/scc-net/net-suite/net-suite-macfinder',
                       printable_name='MACFinder', version=get_git_version(__file__),
janis.streib's avatar
janis.streib committed
20
                       contact_email='dns-betrieb@scc.kit.edu')
21
from . import views