[firewallv4] Duck tape pour ajouter à ipset un couple mac_ip
* Il y a bien une méthode, mais elle régénère TOUT l'ipset * Il y en a bien une autre, mais elle REFAIT des requêtes LDAP, et elle n'est pas utilisée.
This commit is contained in:
parent
1c9cd2a589
commit
e7ad7ae63f
1 changed files with 4 additions and 0 deletions
|
@ -125,6 +125,10 @@ class firewall(utils.firewall_tools) :
|
||||||
self.apply(table, chain)
|
self.apply(table, chain)
|
||||||
return chain
|
return chain
|
||||||
|
|
||||||
|
def mac_ip_append(self, mac, ip):
|
||||||
|
machine = {'macAddress':[mac], 'ipHostNumber': [ip]}
|
||||||
|
self.test_mac_ip_dispatch(lambda set, data: self.ipset['mac_ip'][set].add(data), machine)
|
||||||
|
|
||||||
def test_mac_ip_dispatch(self, func, machine):
|
def test_mac_ip_dispatch(self, func, machine):
|
||||||
"""Détermine à quel set de mac-ip appliquer la fonction ``func`` (add, delete, append, ...)"""
|
"""Détermine à quel set de mac-ip appliquer la fonction ``func`` (add, delete, append, ...)"""
|
||||||
ips = machine['ipHostNumber']
|
ips = machine['ipHostNumber']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue