/* ***********************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.
 **************************************************************************************/
#include "Intrus.h"
#include "Debug.h"
#include "Com/Initialisation_Com.h"
#include "Com/Commun.h"

void Envoie_Alerte_Intrusion (unsigned char *ID_Equipement)
{
	struct struct_Alerte_Intrus Message;

	ERROR_if (ID_Equipement == NULL);
	bzero (&Message, sizeof (struct struct_Alerte_Intrus));
	Message.ID_Reseau = Info_Demarrage.ID_Reseau;
	memcpy (Message.ID_Equipement, ID_Equipement, MAC_ADDR_LEN + IP_ADDR_LEN + 1);
	Communication_Envoie_Donnee (ALERTE_INTRUS, (gpointer *) & Message, sizeof (Message));
}

void Active_Alerte_Intrusion (gpointer * Donnee)
{
	ERROR_if (Donnee == NULL);
	Alerte_Intrusion = TRUE;
	debug_printf (D_INFO, __FILE__, __PRETTY_FUNCTION__, __LINE__, "Active alerte Intrusion");
}

void Desactive_Alerte_Intrusion (gpointer * Donnee)
{
	ERROR_if (Donnee == NULL);
	Alerte_Intrusion = FALSE;
	debug_printf (D_INFO, __FILE__, __PRETTY_FUNCTION__, __LINE__, "Désactive alerte Intrusion");
}


void Initialise_Alerte_intrusion (void)
{
	Alerte_Intrusion = FALSE;
}
