Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e7feac88
authored
Mar 01, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: show OUI registrators for MAC addresses
parent
0dce6c0d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletions
+18
-1
circle/firewall/models.py
+12
-1
circle/network/tables.py
+3
-0
circle/network/templates/network/columns/mac.html
+3
-0
No files found.
circle/firewall/models.py
View file @
e7feac88
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
from
itertools
import
islice
from
itertools
import
islice
import
logging
import
logging
from
netaddr
import
IPSet
from
netaddr
import
IPSet
,
EUI
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.db
import
models
from
django.db
import
models
...
@@ -691,6 +691,17 @@ class Host(models.Model):
...
@@ -691,6 +691,17 @@ class Host(models.Model):
def
get_absolute_url
(
self
):
def
get_absolute_url
(
self
):
return
(
'network.host'
,
None
,
{
'pk'
:
self
.
pk
})
return
(
'network.host'
,
None
,
{
'pk'
:
self
.
pk
})
@property
def
eui
(
self
):
return
EUI
(
self
.
mac
)
@property
def
hw_vendor
(
self
):
try
:
return
self
.
eui
.
oui
.
registration
()
.
org
except
:
return
None
class
Firewall
(
models
.
Model
):
class
Firewall
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
,
name
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
,
...
...
circle/network/tables.py
View file @
e7feac88
...
@@ -36,6 +36,9 @@ class GroupTable(Table):
...
@@ -36,6 +36,9 @@ class GroupTable(Table):
class
HostTable
(
Table
):
class
HostTable
(
Table
):
hostname
=
LinkColumn
(
'network.host'
,
args
=
[
A
(
'pk'
)])
hostname
=
LinkColumn
(
'network.host'
,
args
=
[
A
(
'pk'
)])
mac
=
TemplateColumn
(
template_name
=
"network/columns/mac.html"
)
class
Meta
:
class
Meta
:
model
=
Host
model
=
Host
...
...
circle/network/templates/network/columns/mac.html
0 → 100644
View file @
e7feac88
{% load i18n %}
<span
title=
"{% blocktrans with vendor=record.hw_vendor|default:"
n
/
a
"
%}
Vendor:
{{
vendor
}}{%
endblocktrans
%}"
>
{{ record.mac }}
</span>
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