Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
scc-net
netvs
netvs-core
Commits
39558f10
Commit
39558f10
authored
Jan 28, 2021
by
Janis Streib
🦉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ADD: oui-lookup
parent
7db5db56
Pipeline
#130319
passed with stages
in 6 minutes and 24 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
middleware/net_suite/modules/macfinder/views.py
middleware/net_suite/modules/macfinder/views.py
+6
-0
No files found.
middleware/net_suite/modules/macfinder/views.py
View file @
39558f10
...
...
@@ -87,6 +87,12 @@ def poll(job_id):
return
jsonify
(
s
[
'macfinder_jobs'
][
job_id
].
poll
(
session
,
db
,
get_db_conn
()))
@
macfinder
.
route
(
'/oui_lookup'
)
def
oui_lookup
():
mac
=
format_mac
(
request
.
args
[
'mac'
])
return
jsonify
({
'mac'
:
mac
,
'vendor'
:
OUI_DB
.
get
(
mac
[:
8
],
None
)})
def
format_mac
(
mac
):
mac
=
mac
.
lower
().
strip
()
mac
=
re
.
sub
(
r
'(.*?)([0-9a-f]+|$|^)'
,
lambda
m
:
(
''
*
len
(
m
.
groups
()[
0
])
+
m
.
groups
()[
1
]),
mac
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment