Invoke bus_t.message hook twice, once plain and parsed, once encoded and encrypted

This commit is contained in:
Martin Willi
2012-03-20 17:31:37 +01:00
parent ae92641806
commit 47b8f6ef4b
31 changed files with 124 additions and 98 deletions
+2 -2
View File
@@ -406,7 +406,7 @@ METHOD(bus_t, child_state_change, void,
}
METHOD(bus_t, message, void,
private_bus_t *this, message_t *message, bool incoming)
private_bus_t *this, message_t *message, bool incoming, bool plain)
{
enumerator_t *enumerator;
ike_sa_t *ike_sa;
@@ -425,7 +425,7 @@ METHOD(bus_t, message, void,
}
entry->calling++;
keep = entry->listener->message(entry->listener, ike_sa,
message, incoming);
message, incoming, plain);
entry->calling--;
if (!keep)
{
+6 -1
View File
@@ -235,10 +235,15 @@ struct bus_t {
/**
* Message send/receive hook.
*
* The hook is invoked twice for each message: Once with plain, parsed data
* and once encoded and encrypted.
*
* @param message message to send/receive
* @param incoming TRUE for incoming messages, FALSE for outgoing
* @param plain TRUE if message is parsed and decrypted, FALSE it not
* @param
*/
void (*message)(bus_t *this, message_t *message, bool incoming);
void (*message)(bus_t *this, message_t *message, bool incoming, bool plain);
/**
* IKE_SA authorization hook.
+5 -1
View File
@@ -84,13 +84,17 @@ struct listener_t {
/**
* Hook called for received/sent messages of an IKE_SA.
*
* The hook is invoked twice for each message: Once with plain, parsed data
* and once encoded and encrypted.
*
* @param ike_sa IKE_SA sending/receiving a message
* @param message message object
* @param incoming TRUE for incoming messages, FALSE for outgoing
* @param plain TRUE if message is parsed and decrypted, FALSE it not
* @return TRUE to stay registered, FALSE to unregister
*/
bool (*message)(listener_t *this, ike_sa_t *ike_sa, message_t *message,
bool incoming);
bool incoming, bool plain);
/**
* Hook called with IKE_SA key material.