implement IMC and IMV manager classes

This commit is contained in:
Andreas Steffen
2010-11-09 20:43:50 +01:00
parent c78be5691c
commit b25633314e
20 changed files with 757 additions and 88 deletions
+11 -4
View File
@@ -18,8 +18,8 @@
* @{ @ingroup libcharon
*/
#ifndef IMV_H_
#define IMV_H_
#ifndef IMC_H_
#define IMC_H_
#include <tnc/tncifimc.h>
@@ -121,10 +121,17 @@ struct imc_t {
TNC_Result (*provide_bind_function)(TNC_IMCID imcID,
TNC_TNCC_BindFunctionPointer bindFunction);
/**
* Sets the ID of an imc_t object.
*
* @param id IMC ID to be assigned
*/
void (*set_id)(imc_t *this, TNC_IMCID id);
/**
* Returns the ID of an imc_t object.
*
* @result IMC ID assigned by TNCC
* @result assigned IMC ID
*/
TNC_IMCID (*get_id)(imc_t *this);
@@ -141,4 +148,4 @@ struct imc_t {
void (*destroy)(imc_t *this);
};
#endif /** IMV_H_ @}*/
#endif /** IMC_H_ @}*/
+65
View File
@@ -0,0 +1,65 @@
/*
* Copyright (C) 2010 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* 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. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* 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.
*/
/**
* @defgroup imc_manager imc_manager
* @{ @ingroup imc
*/
#ifndef IMC_MANAGER_H_
#define IMC_MANAGER_H_
#include "imc.h"
#include <library.h>
typedef struct imc_manager_t imc_manager_t;
/**
* The IMC manager controls all IMC instances.
*/
struct imc_manager_t {
/**
* Add an IMC instance
*
* @param imc IMC instance
* @return TRUE if initialization successful
*/
bool (*add)(imc_manager_t *this, imc_t *imc);
/**
* Notify all IMC instances
*
* @param state communicate the state a connection has reached
*/
void (*notify_connection_change)(imc_manager_t *this,
TNC_ConnectionID id,
TNC_ConnectionState state);
/**
* Begin a handshake between the IMCs and a connection
*
* @param id Connection ID
*/
void (*begin_handshake)(imc_manager_t *this, TNC_ConnectionID id);
/**
* Destroy an IMC manager and all its controlled instances.
*/
void (*destroy)(imc_manager_t *this);
};
#endif /** IMC_MANAGER_H_ @}*/
+7
View File
@@ -121,6 +121,13 @@ struct imv_t {
TNC_Result (*provide_bind_function)(TNC_IMVID imvID,
TNC_TNCS_BindFunctionPointer bindFunction);
/**
* Sets the ID of an imv_t object.
*
* @param id IMV ID to be assigned
*/
void (*set_id)(imv_t *this, TNC_IMVID id);
/**
* Returns the ID of an imv_t object.
*
+57
View File
@@ -0,0 +1,57 @@
/*
* Copyright (C) 2010 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* 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. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* 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.
*/
/**
* @defgroup imv_manager imv_manager
* @{ @ingroup imv
*/
#ifndef IMV_MANAGER_H_
#define IMV_MANAGER_H_
#include "imv.h"
#include <library.h>
typedef struct imv_manager_t imv_manager_t;
/**
* The IMV manager controls all IMV instances.
*/
struct imv_manager_t {
/**
* Add an IMV instance
*
* @param imv IMV instance
* @return TRUE if initialization successful
*/
bool (*add)(imv_manager_t *this, imv_t *imv);
/**
* Notify all IMV instances
*
* @param state communicate the state a connection has reached
*/
void (*notify_connection_change)(imv_manager_t *this,
TNC_ConnectionID id,
TNC_ConnectionState state);
/**
* Destroy an IMV manager and all its controlled instances.
*/
void (*destroy)(imv_manager_t *this);
};
#endif /** IMV_MANAGER_H_ @}*/