58 lines
1.2 KiB
Text
58 lines
1.2 KiB
Text
info["owner"] = "root"
|
|
info["group"] = "root"
|
|
info["mode"] = 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
|
|
|
|
out("""<?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):
|
|
out(" <entry>%s</entry>" % (mac,))
|
|
|
|
printmac(mac_du_routeur)
|
|
printmac(mac_komaz)
|
|
printmac(mac_titanic)
|
|
out("""
|
|
</mac-list>
|
|
""")
|
|
|
|
def prefi(pref):
|
|
out("""
|
|
<rule mac="router" prefix="%s">
|
|
<!-- do nothing -->
|
|
</rule>
|
|
""" % (pref,))
|
|
|
|
prefi(prefix['fil'][0])
|
|
|
|
prefi(prefix['wifi'][0])
|
|
|
|
prefi(prefix['evenementiel'][0])
|
|
|
|
prefi(prefix['v6only'][0])
|
|
|
|
prefi(int_prefix['manage_ap'])
|
|
|
|
out("""
|
|
<!-- 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>""")
|