diff --git a/firewall/iptables.py b/firewall/iptables.py index c06a2dd3..9983c27a 100644 --- a/firewall/iptables.py +++ b/firewall/iptables.py @@ -27,11 +27,22 @@ __license__ = "GPL" from firewall import Firewall class Iptables(Firewall): + """ This class contains specific methods and variables for the + iptables firewall. Must implements the 'abstracts' methods + banIP(ip) and unBanIP(ip). + + Must adds abstract methods definition: + http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/266468 + """ def banIP(self, ip): + """ Returns query to ban IP. + """ query = "iptables -I INPUT 1 -i eth0 -s "+ip+" -j DROP" return query def unBanIP(self, ip): + """ Returns query to unban IP. + """ query = "iptables -D INPUT -i eth0 -s "+ip+" -j DROP" return query