ticket.py
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 __author__ = "Cyril Jaquier"
00022 __version__ = "$Revision: 686 $"
00023 __date__ = "$Date: 2008-04-13 19:48:52 +0200 (Sun, 13 Apr 2008) $"
00024 __copyright__ = "Copyright (c) 2004 Cyril Jaquier"
00025 __license__ = "GPL"
00026
00027 import logging
00028
00029
00030 logSys = logging.getLogger("fail2ban")
00031
00032 class Ticket:
00033
00034 def __init__(self, ip, time):
00035 self.__ip = ip
00036 self.__time = time
00037 self.__attempt = 0
00038
00039 def setIP(self, value):
00040 self.__ip = value
00041
00042 def getIP(self):
00043 return self.__ip
00044
00045 def setTime(self, value):
00046 self.__time = value
00047
00048 def getTime(self):
00049 return self.__time
00050
00051 def setAttempt(self, value):
00052 self.__attempt = value
00053
00054 def getAttempt(self):
00055 return self.__attempt
00056
00057
00058 class FailTicket(Ticket):
00059
00060 def __init__(self, ip, time):
00061 Ticket.__init__(self, ip, time)
00062
00063
00064
00065
00066
00067
00068
00069 class BanTicket(Ticket):
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 def __init__(self, ip, time):
00080 Ticket.__init__(self, ip, time)