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 imv_manager imv_manager
21 #ifndef IMV_MANAGER_H_
22 #define IMV_MANAGER_H_
28 typedef struct imv_manager_t imv_manager_t
;
31 * The IMV manager controls all IMV instances.
33 struct imv_manager_t
{
38 * @param imv IMV instance
39 * @return TRUE if initialization successful
41 bool (*add
)(imv_manager_t
*this, imv_t
*imv
);
44 * Remove an IMV instance from the list and return it
46 * @param id ID of IMV instance
47 * @return removed IMC instance
49 imv_t
* (*remove
)(imv_manager_t
*this, TNC_IMVID id
);
52 * Return the number of registered IMVs
54 * @return number of IMVs
56 int (*get_count
)(imv_manager_t
*this);
59 * Notify all IMV instances
61 * @param state communicate the state a connection has reached
63 void (*notify_connection_change
)(imv_manager_t
*this,
65 TNC_ConnectionState state
);
68 * Sets the supported message types reported by a given IMV
70 * @param id ID of reporting IMV
71 * @param supported_types list of messages type supported by IMV
72 * @param type_count number of supported message types
73 * @return TNC result code
75 TNC_Result (*set_message_types
)(imv_manager_t
*this,
77 TNC_MessageTypeList supported_types
,
78 TNC_UInt32 type_count
);
81 * Delivers a message to interested IMVs.
83 * @param connection_id ID of connection over which message was received
84 * @param message message
85 * @param message_len message length
86 * @param message_type message type
88 void (*receive_message
)(imv_manager_t
*this,
89 TNC_ConnectionID connection_id
,
90 TNC_BufferReference message
,
91 TNC_UInt32 message_len
,
92 TNC_MessageType message_type
);
95 * Destroy an IMV manager and all its controlled instances.
97 void (*destroy
)(imv_manager_t
*this);
100 #endif /** IMV_MANAGER_H_ @}*/