2 * Copyright (C) 2010 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * @defgroup imc_manager imc_manager
21 #ifndef IMC_MANAGER_H_
22 #define IMC_MANAGER_H_
28 typedef struct imc_manager_t imc_manager_t
;
31 * The IMC manager controls all IMC instances.
33 struct imc_manager_t
{
38 * @param imc IMC instance
39 * @return TRUE if initialization successful
41 bool (*add
)(imc_manager_t
*this, imc_t
*imc
);
44 * Notify all IMC instances
46 * @param state communicate the state a connection has reached
48 void (*notify_connection_change
)(imc_manager_t
*this,
50 TNC_ConnectionState state
);
53 * Begin a handshake between the IMCs and a connection
55 * @param id Connection ID
57 void (*begin_handshake
)(imc_manager_t
*this, TNC_ConnectionID id
);
60 * Sets the supported message types reported by a given IMC
62 * @param id ID of reporting IMC
63 * @param supported_types list of messages type supported by IMC
64 * @param type_count number of supported message types
65 * @return TNC result code
67 TNC_Result (*set_message_types
)(imc_manager_t
*this,
69 TNC_MessageTypeList supported_types
,
70 TNC_UInt32 type_count
);
73 * Delivers a message to interested IMCs.
75 * @param connection_id ID of connection over which message was received
76 * @param message message
77 * @param message_len message length
78 * @param message_type message type
80 void (*receive_message
)(imc_manager_t
*this,
81 TNC_ConnectionID connection_id
,
82 TNC_BufferReference message
,
83 TNC_UInt32 message_len
,
84 TNC_MessageType message_type
);
87 * Destroy an IMC manager and all its controlled instances.
89 void (*destroy
)(imc_manager_t
*this);
92 #endif /** IMC_MANAGER_H_ @}*/