59 lines
1.2 KiB
Text
59 lines
1.2 KiB
Text
info["owner"] = "root"
|
|
info["group"] = "root"
|
|
info["perms"] = 0644
|
|
|
|
import sys
|
|
sys.path.append('/usr/scripts/gestion')
|
|
|
|
from gestion.config import mac_komaz
|
|
from gestion.config import mac_titanic
|
|
from gestion.config import mac_du_routeur
|
|
from gestion.config import prefix
|
|
from gestion.config import int_prefix
|
|
|
|
print """<?xml version="1.0" encoding="ISO-8859-15"?>
|
|
<!DOCTYPE ramond SYSTEM "ramond.conf.dtd">
|
|
<ramond logfile="/var/log/ramond.log">
|
|
|
|
<mac-list name="router">"""
|
|
def printmac(mac):
|
|
print """
|
|
<entry>""" + mac + """</entry>"""
|
|
|
|
printmac(mac_du_routeur)
|
|
printmac(mac_komaz)
|
|
printmac(mac_titanic)
|
|
print """
|
|
</mac-list>
|
|
"""
|
|
|
|
def prefi(pref):
|
|
print """
|
|
<rule mac="router" prefix=\"""" + pref + """\">
|
|
<!-- do nothing -->
|
|
</rule>
|
|
"""
|
|
|
|
prefi(prefix['fil'][0])
|
|
|
|
prefi(prefix['wifi'][0])
|
|
|
|
prefi(prefix['evenementiel'][0])
|
|
|
|
prefi(prefix['v6only'][0])
|
|
|
|
prefi(int_prefix['manage_ap'])
|
|
|
|
print """
|
|
<!-- UNKNOWN PREFIX -->
|
|
<!-- this matches every advertised _prefix_-->
|
|
<rule prefix="::/0">
|
|
<execute>/usr/scripts/surveillance/ra2.py</execute>
|
|
</rule>
|
|
<!-- this matches everything, including ras without advertised prefixes-->
|
|
<rule>
|
|
<execute>/usr/scripts/surveillance/ra2.py</execute>
|
|
</rule>
|
|
|
|
|
|
</ramond>"""
|