############################################################################
##
## Copyright (c) 2000-2001 BalaBit IT Ltd, Budapest, Hungary
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
##
## $Id: Whois.py,v 1.2.4.2 2001/09/19 19:38:43 bazsi Exp $
##
############################################################################

"""Module defining interface to the Whois proxy.

This module defines the interface to the Whois proxy as implemented by
the Whois Zorp module.
"""

from Zorp import *
from Proxy import Proxy

class WhoisProxy(Proxy):
	"""Wrapper class for the Whois protocol proxy implemented by Zorp.
	
	FIXME: missing description
	
	Attributes
	
	  timeout -- I/O timeout
	  
	  max_line_length -- the maximum number of characters in a single line

	  response_header -- prepend this string to each finger response
	  
	  response_footer -- append this string to each finger response
	  
	  FIXME: missing attributes

	"""
	def __init__(self, session, type):
		"""Constructor to initialize a WhoisProxy instance.

		This constructor creates and set up a WhoisProxy instance.

		Arguments

		  self -- this instance
		  
		  session -- session this instance belongs to
		
		"""
		Proxy.__init__(self, "whois", session, type)

	def whoisRequest(self, request):
		"""Function to process a given whois request.
		
		This function is called by the whois proxy to process a 
		request. It has a chance to change request specific
		attributes.
		
		Arguments
		
		  self -- this instance
		  
		  request -- request contents, same as self.request
		"""
		return Z_ACCEPT
