- Code comments

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@29 a942ae1a-1317-0410-a47c-b1dcaea8d605
0.6
Cyril Jaquier 2004-10-14 10:31:53 +00:00
parent 3331c9dccb
commit 1070273151
1 changed files with 11 additions and 0 deletions

View File

@ -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