ó
ì$Sc        ?   @   s€  d  Z  d Z d Z d d l Z d d d g d d g d	 d
 g d d g d d g d d g d d g d d g d d d g d d g d d g d d g d d g d d g d d  d g d! d" g d# d$ g d% d& g d' d( g d d) d g d* d+ g d, d- g d. d/ g d0 d1 g d2 d3 g d4 d5 g d6 d7 g d8 d9 g d: d; g d< d= g d> d? g d@ dA g dB dC g dD dE g dF dG g dH dI g dJ dK g dL dM g dN dO g dP dQ g dR dS g dT dU g dV dW g dX dY g dZ d[ g d d\ d g d] d^ g d_ d` g da db g dc dd g de df g dg dh g di dj g dk dl g dm dn g do dp g dq dr g ds dt g du dv g dw dx g dy dz g d{ d| g g> Z d} „  Z d~ „  Z d „  Z d S(€   s   Cyril Jaquiers    Copyright (c) 2004 Cyril Jaquiert   GPLiÿÿÿÿNt    t   BASICt   starts   starts the server and the jailst   reloads   reloads the configurations   reload <JAIL>s   reloads the jail <JAIL>t   stops(   stops all jails and terminate the servert   statuss%   gets the current status of the servert   pings   tests if the server is alivet   helps   return this outputt   LOGGINGs   set loglevel <LEVEL>s7   sets logging level to <LEVEL>. 0 is minimal, 4 is debugs   get loglevels   gets the logging levels   set logtarget <TARGET>sH   sets logging target to <TARGET>. Can be STDOUT, STDERR, SYSLOG or a files   get logtargets   gets logging targett	   flushlogssA   flushes the logtarget if a file and reopens it. For log rotation.s   JAIL CONTROLs   add <JAIL> <BACKEND>s   creates <JAIL> using <BACKEND>s   start <JAIL>s   starts the jail <JAIL>s   stop <JAIL>s*   stops the jail <JAIL>. The jail is removeds   status <JAIL>s!   gets the current status of <JAIL>s   JAIL CONFIGURATIONs   set <JAIL> idle on|offs   sets the idle state of <JAIL>s   set <JAIL> addignoreip <IP>s&   adds <IP> to the ignore list of <JAIL>s   set <JAIL> delignoreip <IP>s+   removes <IP> from the ignore list of <JAIL>s   set <JAIL> addlogpath <FILE>s,   adds <FILE> to the monitoring list of <JAIL>s   set <JAIL> dellogpath <FILE>s1   removes <FILE> from the monitoring list of <JAIL>s   set <JAIL> addfailregex <REGEX>sH   adds the regular expression <REGEX> which must match failures for <JAIL>s   set <JAIL> delfailregex <INDEX>s7   removes the regular expression at <INDEX> for failregexs    set <JAIL> ignorecommand <VALUE>s   sets ignorecommand of <JAIL>s!   set <JAIL> addignoreregex <REGEX>sT   adds the regular expression <REGEX> which should match pattern to exclude for <JAIL>s!   set <JAIL> delignoreregex <INDEX>s9   removes the regular expression at <INDEX> for ignoreregexs   set <JAIL> findtime <TIME>sP   sets the number of seconds <TIME> for which the filter will look back for <JAIL>s   set <JAIL> bantime <TIME>sB   sets the number of seconds <TIME> a host will be banned for <JAIL>s   set <JAIL> usedns <VALUE>s   sets the usedns mode for <JAIL>s   set <JAIL> banip <IP>s   manually Ban <IP> for <JAIL>s   set <JAIL> unbanip <IP>s   manually Unban <IP> in <JAIL>s   set <JAIL> maxretry <RETRY>sF   sets the number of failures <RETRY> before banning the host for <JAIL>s   set <JAIL> addaction <ACT>s)   adds a new action named <NAME> for <JAIL>s   set <JAIL> delaction <ACT>s%   removes the action <NAME> from <JAIL>s'   set <JAIL> setcinfo <ACT> <KEY> <VALUE>s6   sets <VALUE> for <KEY> of the action <NAME> for <JAIL>s   set <JAIL> delcinfo <ACT> <KEY>s.   removes <KEY> for the action <NAME> for <JAIL>s"   set <JAIL> actionstart <ACT> <CMD>s;   sets the start command <CMD> of the action <ACT> for <JAIL>s!   set <JAIL> actionstop <ACT> <CMD>s:   sets the stop command <CMD> of the action <ACT> for <JAIL>s"   set <JAIL> actioncheck <ACT> <CMD>s;   sets the check command <CMD> of the action <ACT> for <JAIL>s    set <JAIL> actionban <ACT> <CMD>s9   sets the ban command <CMD> of the action <ACT> for <JAIL>s"   set <JAIL> actionunban <ACT> <CMD>s;   sets the unban command <CMD> of the action <ACT> for <JAIL>s   JAIL INFORMATIONs   get <JAIL> logpaths/   gets the list of the monitored files for <JAIL>s   get <JAIL> ignoreips0   gets the list of ignored IP addresses for <JAIL>s   get <JAIL> ignorecommands   gets ignorecommand of <JAIL>s   get <JAIL> failregexsJ   gets the list of regular expressions which matches the failures for <JAIL>s   get <JAIL> ignoreregexsP   gets the list of regular expressions which matches patterns to ignore for <JAIL>s   get <JAIL> findtimesI   gets the time for which the filter will look back for failures for <JAIL>s   get <JAIL> bantimes)   gets the time a host is banned for <JAIL>s   get <JAIL> usednss"   gets the usedns setting for <JAIL>s   get <JAIL> maxretrys.   gets the number of failures allowed for <JAIL>s   get <JAIL> addactions4   gets the last action which has been added for <JAIL>s   get <JAIL> actionstart <ACT>s6   gets the start command for the action <ACT> for <JAIL>s   get <JAIL> actionstop <ACT>s5   gets the stop command for the action <ACT> for <JAIL>s   get <JAIL> actioncheck <ACT>s6   gets the check command for the action <ACT> for <JAIL>s   get <JAIL> actionban <ACT>s4   gets the ban command for the action <ACT> for <JAIL>s   get <JAIL> actionunban <ACT>s6   gets the unban command for the action <ACT> for <JAIL>s   get <JAIL> cinfo <ACT> <KEY>s8   gets the value for <KEY> for the action <ACT> for <JAIL>c          C   sÆ   d }  d } d } t  } x§ t D]Ÿ } | d d k r? | r? Hn  t } t } xp t j | d | ƒ D]X } | r£ d |  | d d | t | d ƒ | } t  } n d |  | | } | GHqb Wq Wd  S(   Ni   i)   i"   i    R   i   t    (   t   Falset   protocolt   Truet   textwrapt   wrapt   len(   t   INDENTt   MARGINt   WIDTHt   firstHeadingt   mt   firstt   nt   line(    (    s&   /usr/share/fail2ban/common/protocol.pyt   printFormattede   s    ,	c          C   sz   t  }  xh t D]` } | d d k rO |  r1 d GHn  t | d | d ƒ t }  q d GHd | d d | d GHq Wd GHd  S(	   Ni    R   s   |}i   i   s   |-s(   | <span style="white-space:nowrap;"><tt>s   </tt></span> || || (   R   R   t   __printWikiHeaderR   (   R   R   (    (    s&   /usr/share/fail2ban/common/protocol.pyt	   printWikiz   s    	c         C   s#   Hd |  d GHH| GHHd GHd GHd  S(   Ns   === s    ===s   {|s'   | '''Command''' || || '''Description'''(    (   t   sectiont   desc(    (    s&   /usr/share/fail2ban/common/protocol.pyR   ‡   s    (   t
   __author__t   __copyright__t   __license__R   R   R   R   R   (    (    (    s&   /usr/share/fail2ban/common/protocol.pyt   <module>   sˆ   																																																										