8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-25 00:13:45 +00:00

Renvoie la taille du prefix notation cidr

This commit is contained in:
Gabriel Detraz 2018-07-09 00:31:05 +02:00
parent 403d756225
commit ce7ced64e2

View file

@ -386,6 +386,7 @@ class IpType(RevMixin, AclMixin, models.Model):
{ {
'network': str(ip_set.network), 'network': str(ip_set.network),
'netmask': str(ip_set.netmask), 'netmask': str(ip_set.netmask),
'netmask_cidr': str(ip_set.prefixlen),
'broadcast': str(ip_set.broadcast), 'broadcast': str(ip_set.broadcast),
'vlan': str(self.vlan), 'vlan': str(self.vlan),
'vlan_id': self.vlan.vlan_id 'vlan_id': self.vlan.vlan_id
@ -398,6 +399,7 @@ class IpType(RevMixin, AclMixin, models.Model):
return { return {
'network' : str(self.prefix_v6), 'network' : str(self.prefix_v6),
'netmask' : 'ffff:ffff:ffff:ffff::', 'netmask' : 'ffff:ffff:ffff:ffff::',
'netmask_cidr' : '64',
'vlan': str(self.vlan), 'vlan': str(self.vlan),
'vlan_id': str(self.vlan.vlan_id) 'vlan_id': str(self.vlan.vlan_id)
} }