/* ***********************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         __RESEAU
#define         __RESEAU

#include <gtk/gtk.h>

#include "Equipement.h"
#include "Log.h"


enum enum_Liste {
	LISTE_ERREUR = 0,
	LISTE_MACHINE_PAR_TYPE,
	LISTE_MACHINE_PAR_IP,
	LISTE_INFO,
	LISTE_INFO_AUTRE,
	LISTE_INFO_SNMP,
	LISTE_INFO_INVENTAIRE,
	LISTE_INFO_HISTORIQUE,
	LISTE_INFO_NESSUS,
	LISTE_MODULE
};



struct Struct_Liste_Reseau {
	gchar    *Nom_Complet_Reseau;
	gchar    *Nom_Reseau;
	gchar    *Icone_Reseau;
	gchar    *Interface;
	gchar    *Ip;
	gchar    *Communaute_Snmp;
	gchar	 *Ip_Agent;
	gint	 Port_Agent;
	int       Socket_Agent; 
	int       Id_Reseau;
	gint      Pid_Agent;
	gint      ID_Derniere_Liste_Selectionner;
	GtkWidget *Liste_Equipement_Type;
	GtkWidget *Liste_Equipement_IP; 
	gboolean  Mode_Liste_Detaille;
	gboolean  Ip_Dynamic;
	GList    *GList_Liste_Equipement;

	GList    *GList_Liste_Info;
	GList    *GList_Liste_Info_Autre;
	GList    *GList_Liste_Info_Snmp;
	GList    *GList_Liste_Info_Inventaire;
	GList    *GList_Liste_Info_Historique;
	GList    *GList_Liste_Info_Nessus;

	GList    *GList_Liste_Module;
	GList    *GList_Alerte;
	GList    *GList_Rafraichissement;
	GList    *GList_Test_Etat;
	gint      Octet_Envoyer;// Nb octet envoyer par l'agent
	gint      Octet_Recu;// Nb octet recu par l'agent
	gint      Nb_Equipement;
	gint	  Nb_Equipement_Erase;
	gint      Nb_Equipement_En_Cours_De_Scan;
	gint      Nb_Equipement_En_Attente_De_Scan;
	gint      Octet_Envoyer_Agent;
	gint      Octet_Recu_Agent;
	gint	  Compteur_Activite_Agent ;
	gchar    *User_Nessus;
	gchar    *Password_Nessus;
	gchar    *IP_Nessus;
	gboolean  Alert_Intrusion;
	GtkWidget *scrollwin;
	GdkPixmap *pixmap;
	GtkWidget *drawingarea1;
	GList    *Glist_Subnet_Equipement;
	struct struct_Cle_Privee *Log_Send;
	struct struct_Cle_Privee *Log_Recv;
	gboolean Connection_Failed; 
};

gint      ID_Reseau_En_Cours;
GList    *GList_Liste_Reseau;
gint      Genere_ID_Reseau;
struct Struct_Liste_Reseau *Reseau_Selectionner;

void      Affiche_Info_Reseau (struct Struct_Liste_Reseau *Reseau);
void      Arreter_Tous_Les_Agents (void);
void      Initialisation_Variable_Reseau (void);
void      Afficher_Liste_Reseau (void);
struct Struct_Liste_Reseau *Recupere_Pointeur_Structure_Reseau (gint ID_Reseau);
gboolean  Recherche_Si_Reseau_Existe_Deja (gchar * Nom_Complet_Reseau);
struct Struct_Liste_Reseau *Creation_Structure_Nouveau_Reseau (gchar * Nom_Complet_Reseau, gchar * Nom_Reseau, gchar * Interface, gchar * Ip, gchar * Communaute_Snmp,gchar *Ip_Agent,gint Port_Agent);
struct Struct_Liste_Reseau *Creation_Nouveau_Reseau (gchar * Nom_Reseau, gchar * Interface, gchar * Ip, gchar * Communaute_Snmp, gchar * Icon,int Socket_Agent_Init,gchar *Ip_Agent,gint Port_Agent);
struct Struct_Liste_Reseau *Recupere_Pointeur_Reseau_Selectionner (GtkWidget * scrollwin);
void      Copie_Subnet (struct Struct_Liste_Reseau *Reseau, GList * Glist);
#endif
