/* ***********************IMPORTANT *********************************************
 *  Copyright (C) 2004-2007 Thierry Lagarde <tlagarde@users.sourceforge.net>
 *  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.
 *
 *
 *                      ********************
 *
 *
 *  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 Library General Public License for more details.
 *
 *
 *                      ********************
 *
 *
 * You are highly encouraged to send your changes to <tlagarde@users.sourceforge.net>
 * for possible incorporation into the main distribution.
 * By sending these changes to <tlagarde@users.sourceforge.net>,
 * it is assumed that you are offering <tlagarde@users.sourceforge.net>
 * the unlimited, non-exclusive right to reuse, modify, and relicense the code.
 *
 *
 *                      ********************
 *
 *  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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **************************************************************************************/
#ifndef         __SCAN_SERVICE
#define         __SCAN_SERVICE

#include "Liste_Equipement.h"


struct Struct_Option_Telnet {
	unsigned char      	id;
	gchar 	*info;
	gboolean reponse; 
	gboolean init;
  	unsigned char		  cmd_init;
};


#define TELNET_IAC 255
enum enum_ID_telnet_cmd{
  TELNET_CMD_EOF =   236, 	
  TELNET_CMD_SUSP =  237, 
  TELNET_CMD_ABORT = 238, 
  TELNET_CMD_EOR =   239, 	
  TELNET_CMD_SE =    240, 	
  TELNET_CMD_NOP =   241, 	
  TELNET_CMD_DM =    242, 	
  TELNET_CMD_BRK =   243, 	
  TELNET_CMD_IP =    244, 	
  TELNET_CMD_AO =    245, 	
  TELNET_CMD_AYT =   246, 	
  TELNET_CMD_EC =    247, 	
  TELNET_CMD_EL =    248, 	
  TELNET_CMD_GA =    249, 	
  TELNET_CMD_SB =    250, 	
  TELNET_CMD_WILL =  251,
  TELNET_CMD_WONT =  252,
  TELNET_CMD_DO =    253,
  TELNET_CMD_DONT =  254
};
typedef enum {
  TELNET_OPT_BINARY =   0, 				
  TELNET_OPT_ECHO =     1, 					
  TELNET_OPT_RCP =      2, 					
  TELNET_OPT_SGA =      3, 					
  TELNET_OPT_NAMS =     4, 					
  TELNET_OPT_STATUS =   5, 				
  TELNET_OPT_TM =       6, 					
  TELNET_OPT_RCTE =     7, 					
  TELNET_OPT_NAOL =     8, 					
  TELNET_OPT_NAOP =     9, 					
  TELNET_OPT_NAOCRD =  10, 				
  TELNET_OPT_NAOHTS =  11, 				
  TELNET_OPT_NAOHTD =  12,				
  TELNET_OPT_NAOFFD =  13, 				
  TELNET_OPT_NAOVTS =  14,				
  TELNET_OPT_NAOVTD =  15, 				
  TELNET_OPT_NAOLFD =  16, 				
  TELNET_OPT_XASCII =  17, 					
  TELNET_OPT_LOGOUT =  18, 				
  TELNET_OPT_BM =      19, 					
  TELNET_OPT_DET =     20,					
  TELNET_OPT_SUPDUP =  21, 				
  TELNET_OPT_SUPDUPOUTPUT =    22, 
  TELNET_OPT_SNDLOC =          23,		
  TELNET_OPT_TTYPE =           24,			
  TELNET_OPT_EOR =             25,			
  TELNET_OPT_TUID =            26, 			
  TELNET_OPT_OUTMRK =          27,		
  TELNET_OPT_TTYLOC =          28, 		
  TELNET_OPT_3270REGIME =      29, 	
  TELNET_OPT_X3PAD =           30,			
  TELNET_OPT_NAWS =            31, 		
  TELNET_OPT_TSPEED =          32, 		
  TELNET_OPT_LFLOW =           33, 		
  TELNET_OPT_LINEMODE =        34, 	
  TELNET_OPT_XDISPLOC =        35, 	
  TELNET_OPT_OLD_ENVIRON =     36, 
  TELNET_OPT_AUTHENTICATION =  37,
  TELNET_OPT_ENCRYPT =         38, 	
  TELNET_OPT_NEW_ENVIRON =     39,
  TELNET_OPT_TN3270E =         40, 		
  TELNET_OPT_MAX  =   41       		
};



gint Time_Out_Service;
gint Time_Out_Connect_Service;

void      Recupere_Nom_DNS (struct Struct_Liste_Equipement *Equip);
gchar *send_service(struct Struct_Liste_Equipement *Equip,gchar *Requete,gint Taille_Requete,gchar *Protocol);
gchar *connect_service(struct Struct_Liste_Equipement *Equipement,gchar *Protocol,int Port);
char     *Recupere_Banniere_FTP (struct Struct_Liste_Equipement *Equipement);
char     *Recupere_Banniere_HTTP (struct Struct_Liste_Equipement *Equipement);
char     *Recupere_Banniere_IMAP (struct Struct_Liste_Equipement *Equipement);
char     *Recupere_Banniere_SSH(struct Struct_Liste_Equipement *Equip);
char     *Recupere_Banniere_TELNET (struct Struct_Liste_Equipement *Equipement);
#endif


/*

struct Struct_Option_Telnet opt_telnet[] = {
 	{TELNET_OPT_BINARY					,"8-bit data path"												,0									,FALSE	,0},
	{TELNET_OPT_ECHO  						,"echo"																,TELNET_CMD_WONT	,TRUE		,TELNET_CMD_DO},
	{TELNET_OPT_RCP 						,"prepare to reconnect"									,0									,FALSE	,0},
	{TELNET_OPT_SGA 							,"suppress go ahead"										,0									,TRUE		,TELNET_CMD_DO},
	{TELNET_OPT_NAMS  					,"approximate message size"							,0									,FALSE	,0},
	{TELNET_OPT_STATUS 					,"give status"													,TELNET_CMD_DONT 	,FALSE	,0},
	{TELNET_OPT_TM 							,"timing mark"												,TELNET_CMD_WONT	,FALSE	,0},
	{TELNET_OPT_RCTE 						,"remote controlled transmission and echo"	,0									,FALSE	,0},
	{TELNET_OPT_NAOL						,"negotiate about output line width"				,0									,FALSE	,0},
	{TELNET_OPT_NAOP						,"negotiate about output page size"					,0									,FALSE	,0},
	{TELNET_OPT_NAOCRD 					,"negotiate about CR disposition"					,0									,FALSE	,0},
	{TELNET_OPT_NAOHTS 					,"negotiate about horizontal tabstops"				,0									,FALSE	,0},
	{TELNET_OPT_NAOHTD					,"nego. about horizontal tab disposition"			,0									,FALSE	,0},
	{TELNET_OPT_NAOFFD 					,"negotiate about formfeed disposition"			,0									,FALSE	,0},
	{TELNET_OPT_NAOVTS 					,"negotiate about vertical tab stops"				,0									,FALSE	,0},
	{TELNET_OPT_NAOVTD					,"nego. about vertical tab disposition"				,0									,FALSE	,0},
	{TELNET_OPT_NAOLFD 					,"negotiate about output LF disposition"			,0									,FALSE	,0},
	{TELNET_OPT_XASCII 					,"extended ascii character set"						,0									,FALSE	,0},
	{TELNET_OPT_LOGOUT 					,"force logout"													,0									,FALSE	,0},
	{TELNET_OPT_BM 							,"byte macro"													,0									,FALSE	,0},
	{TELNET_OPT_DET							,"data entry terminal"										,0									,FALSE	,0},
	{TELNET_OPT_SUPDUP 					,"supdup protocol"											,0									,FALSE	,0},
	{TELNET_OPT_SUPDUPOUTPUT  	,"supdup output"												,0									,FALSE	,0},
	{TELNET_OPT_SNDLOC					,"send location"												,0									,FALSE	,0},
	{TELNET_OPT_TTYPE 						,"terminal type"												,TELNET_CMD_WONT  ,FALSE	,0},
	{TELNET_OPT_EOR							,"end or record"												,0									,FALSE	,0},
	{TELNET_OPT_TUID 						,"TACACS user identification"							,0									,FALSE	,0},
	{TELNET_OPT_OUTMRK					,"output marking"											,0									,FALSE	,0},
	{TELNET_OPT_TTYLOC 					,"terminal location number"							,0									,FALSE	,0},
	{TELNET_OPT_3270REGIME  			,"3270 regime"												,0									,FALSE	,0},
	{TELNET_OPT_X3PAD						,"X.3 PAD"														,0									,FALSE	,0},
	{TELNET_OPT_NAWS  					,"window size"													,TELNET_CMD_WONT	,FALSE	,0},
	{TELNET_OPT_TSPEED 					,"terminal speed"												,TELNET_CMD_WONT	,FALSE	,0},
	{TELNET_OPT_LFLOW 					,"remote flow control"										,TELNET_CMD_WONT	,FALSE	,0},
	{TELNET_OPT_LINEMODE  				,"Linemode option"											,TELNET_CMD_WONT	,FALSE	,0},
	{TELNET_OPT_XDISPLOC 				,"X Display Location"										,TELNET_CMD_WONT  ,FALSE	,0},
	{TELNET_OPT_OLD_ENVIRON 		,"Old - Environment variables"							,TELNET_CMD_WONT	,FALSE	,0},
	{TELNET_OPT_AUTHENTICATION  	,"Authenticate"												,TELNET_CMD_WONT	,FALSE	,0},
	{TELNET_OPT_ENCRYPT 				,"Encryption option"										,TELNET_CMD_DONT	,FALSE	,0},
	{TELNET_OPT_NEW_ENVIRON 		,"New - Environment variables"						,TELNET_CMD_WONT	,FALSE	,0},
	{TELNET_OPT_TN3270E  				,"TN3270E"														,0									,FALSE	,0}
};

*/
