Commit e7feac88 by Őry Máté

network: show OUI registrators for MAC addresses

parent 0dce6c0d
......@@ -2,7 +2,7 @@
from itertools import islice
import logging
from netaddr import IPSet
from netaddr import IPSet, EUI
from django.contrib.auth.models import User
from django.db import models
......@@ -691,6 +691,17 @@ class Host(models.Model):
def get_absolute_url(self):
return ('', None, {'pk':})
def eui(self):
return EUI(self.mac)
def hw_vendor(self):
return self.eui.oui.registration().org
return None
class Firewall(models.Model):
name = models.CharField(max_length=20, unique=True,
......@@ -36,6 +36,9 @@ class GroupTable(Table):
class HostTable(Table):
hostname = LinkColumn('', args=[A('pk')])
mac = TemplateColumn(
class Meta:
model = Host
{% load i18n %}
<span title="{% blocktrans with vendor=record.hw_vendor|default:"n/a" %}Vendor: {{vendor}}{% endblocktrans %}">{{ record.mac }}</span>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment