enumerator->destroy(enumerator);
}
+METHOD(imc_manager_t, batch_ending, void,
+ private_tnc_imc_manager_t *this, TNC_ConnectionID id)
+{
+ enumerator_t *enumerator;
+ imc_t *imc;
+
+ enumerator = this->imcs->create_enumerator(this->imcs);
+ while (enumerator->enumerate(enumerator, &imc))
+ {
+ if (imc->batch_ending)
+ {
+ imc->batch_ending(imc->get_id(imc), id);
+ }
+ }
+ enumerator->destroy(enumerator);
+}
+
METHOD(imc_manager_t, destroy, void,
private_tnc_imc_manager_t *this)
{
.begin_handshake = _begin_handshake,
.set_message_types = _set_message_types,
.receive_message = _receive_message,
+ .batch_ending = _batch_ending,
.destroy = _destroy,
},
.imcs = linked_list_create(),
return result;
}
+METHOD(imv_manager_t, solicit_recommendation, void,
+ private_tnc_imv_manager_t *this, TNC_ConnectionID id)
+{
+ enumerator_t *enumerator;
+ imv_t *imv;
+
+ enumerator = this->imvs->create_enumerator(this->imvs);
+ while (enumerator->enumerate(enumerator, &imv))
+ {
+ imv->solicit_recommendation(imv->get_id(imv), id);
+ }
+ enumerator->destroy(enumerator);
+}
+
METHOD(imv_manager_t, receive_message, void,
private_tnc_imv_manager_t *this, TNC_ConnectionID connection_id,
TNC_BufferReference message,
enumerator->destroy(enumerator);
}
+METHOD(imv_manager_t, batch_ending, void,
+ private_tnc_imv_manager_t *this, TNC_ConnectionID id)
+{
+ enumerator_t *enumerator;
+ imv_t *imv;
+
+ enumerator = this->imvs->create_enumerator(this->imvs);
+ while (enumerator->enumerate(enumerator, &imv))
+ {
+ if (imv->batch_ending)
+ {
+ imv->batch_ending(imv->get_id(imv), id);
+ }
+ }
+ enumerator->destroy(enumerator);
+}
+
METHOD(imv_manager_t, destroy, void,
private_tnc_imv_manager_t *this)
{
.get_count = _get_count,
.notify_connection_change = _notify_connection_change,
.set_message_types = _set_message_types,
+ .solicit_recommendation = _solicit_recommendation,
.receive_message = _receive_message,
+ .batch_ending = _batch_ending,
.destroy = _destroy,
},
.imvs = linked_list_create(),
{
charon->imvs->receive_message(charon->imvs, this->connection_id,
pos, len, 0x0080ab31);
+ charon->imvs->batch_ending(charon->imvs, this->connection_id);
}
else
{
charon->imcs->receive_message(charon->imcs, this->connection_id,
pos, len, 0x0080ab31);
+ charon->imcs->batch_ending(charon->imcs, this->connection_id);
}
return NEED_MORE;
}
/**
* Begin a handshake between the IMCs and a connection
*
- * @param id Connection ID
+ * @param id connection ID
*/
void (*begin_handshake)(imc_manager_t *this, TNC_ConnectionID id);
TNC_MessageType message_type);
/**
+ * Notify all IMCs that all IMV messages received in a batch have been
+ * delivered and this is the IMCs last chance to send a message in the
+ * batch of IMC messages currently being collected.
+ *
+ * @param id connection ID
+ */
+ void (*batch_ending)(imc_manager_t *this, TNC_ConnectionID id);
+
+ /**
* Destroy an IMC manager and all its controlled instances.
*/
void (*destroy)(imc_manager_t *this);
TNC_UInt32 type_count);
/**
+ * Solicit recommendations from IMVs that have not yet provided one
+ *
+ * @param id connection ID
+ */
+ void (*solicit_recommendation)(imv_manager_t *this, TNC_ConnectionID id);
+
+ /**
* Delivers a message to interested IMVs.
*
* @param connection_id ID of connection over which message was received
TNC_MessageType message_type);
/**
+ * Notify all IMVs that all IMC messages received in a batch have been
+ * delivered and this is the IMVs last chance to send a message in the
+ * batch of IMV messages currently being collected.
+ *
+ * @param id connection ID
+ */
+ void (*batch_ending)(imv_manager_t *this, TNC_ConnectionID id);
+
+ /**
* Destroy an IMV manager and all its controlled instances.
*/
void (*destroy)(imv_manager_t *this);