From 1070273151dd700dd776fa31e186adaf9f199be1 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Thu, 14 Oct 2004 10:31:53 +0000 Subject: [PATCH] - Code comments git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@29 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- firewall/iptables.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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