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
18 * @{ @ingroup libcharon
24 #include <tnc/tncifimv.h>
26 typedef struct imv_t imv_t
;
31 * The TNC Server calls this function to initialize the IMV and agree on
32 * the API version number to be used. It also supplies the IMV ID, an IMV
33 * identifier that the IMV must use when calling TNC Server callback functions.
35 * @param imvID IMV ID assigned by TNCS
36 * @param minVersion Minimum API version supported
37 * @param maxVersion Maximum API version supported by TNCS
38 * @param OutActualVersion Mutually supported API version number
39 * @return TNC result code
41 TNC_Result (*initialize
)(TNC_IMVID imvID
,
42 TNC_Version minVersion
,
43 TNC_Version maxVersion
,
44 TNC_Version
*OutActualVersion
);
47 * The TNC Server calls this function to inform the IMV that the state of
48 * the network connection identified by connectionID has changed to newState.
50 * @param imvID IMV ID assigned by TNCS
51 * @param connectionID Network connection ID assigned by TNCS
52 * @param newState New network connection state
53 * @return TNC result code
55 TNC_Result (*notify_connection_change
)(TNC_IMVID imvID
,
56 TNC_ConnectionID connectionID
,
57 TNC_ConnectionState newState
);
60 * The TNC Server calls this function at the end of an Integrity Check
61 * Handshake (after all IMC-IMV messages have been delivered) to solicit
62 * recommendations from IMVs that have not yet provided a recommendation.
64 * @param imvID IMV ID assigned by TNCS
65 * @param connectionID Network connection ID assigned by TNCS
66 * @return TNC result code
68 TNC_Result (*solicit_recommendation
)(TNC_IMVID imvID
,
69 TNC_ConnectionID connectionID
);
72 * The TNC Server calls this function to deliver a message to the IMV.
73 * The message is contained in the buffer referenced by message and contains
74 * the number of octets indicated by messageLength. The type of the message
75 * is indicated by messageType.
77 * @param imvID IMV ID assigned by TNCS
78 * @param connectionID Network connection ID assigned by TNCS
79 * @param message Reference to buffer containing message
80 * @param messageLength Number of octets in message
81 * @param messageType Message type of message
82 * @return TNC result code
84 TNC_Result (*receive_message
)(TNC_IMVID imvID
,
85 TNC_ConnectionID connectionID
,
86 TNC_BufferReference message
,
87 TNC_UInt32 messageLength
,
88 TNC_MessageType messageType
);
91 * The TNC Server calls this function to notify IMVs that all IMC messages
92 * received in a batch have been delivered and this is the IMV’s last chance
93 * to send a message in the batch of IMV messages currently being collected.
95 * @param imvID IMV ID assigned by TNCS
96 * @param connectionID Network connection ID assigned by TNCS
97 * @return TNC result code
99 TNC_Result (*batch_ending
)(TNC_IMVID imvID
,
100 TNC_ConnectionID connectionID
);
103 * The TNC Server calls this function to close down the IMV.
105 * @param imvID IMV ID assigned by TNCS
106 * @return TNC result code
108 TNC_Result (*terminate
)(TNC_IMVID imvID
);
111 * IMVs implementing the UNIX/Linux Dynamic Linkage platform binding MUST
112 * define this additional function. The TNC Server MUST call the function
113 * immediately after calling TNC_IMV_Initialize to provide a pointer to the
114 * TNCS bind function. The IMV can then use the TNCS bind function to obtain
115 * pointers to any other TNCS functions.
117 * @param imvID IMV ID assigned by TNCS
118 * @param bindFunction Pointer to TNC_TNCS_BindFunction
119 * @return TNC result code
121 TNC_Result (*provide_bind_function
)(TNC_IMVID imvID
,
122 TNC_TNCS_BindFunctionPointer bindFunction
);
125 * Sets the ID of an imv_t object.
127 * @param id IMV ID to be assigned
129 void (*set_id
)(imv_t
*this, TNC_IMVID id
);
132 * Returns the ID of an imv_t object.
134 * @return IMV ID assigned by TNCS
136 TNC_IMVID (*get_id
)(imv_t
*this);
139 * Returns the name of an imv_t object.
141 * @return name of IMV
143 char* (*get_name
)(imv_t
*this);
146 * Sets the supported message types of an imv_t object.
148 * @param supported_types List of messages type supported by IMV
149 * @param type_count Number of supported message types
151 void (*set_message_types
)(imv_t
*this, TNC_MessageTypeList supported_types
,
152 TNC_UInt32 type_count
);
155 * Destroys an imv_t object.
157 void (*destroy
)(imv_t
*this);
160 #endif /** IMV_H_ @}*/