}
CALLBACK(send_esp, void,
- void *data, esp_packet_t *packet)
+ void *data, esp_packet_t *packet, bool encap)
{
charon->sender->send_no_marker(charon->sender, (packet_t*)packet);
}
* Send an ESP packet using the registered outbound callback
*/
static void send_outbound(private_ipsec_processor_t *this,
- esp_packet_t *packet)
+ esp_packet_t *packet, bool encap)
{
this->lock->read_lock(this->lock);
if (this->outbound.cb)
{
- this->outbound.cb(this->outbound.data, packet);
+ this->outbound.cb(this->outbound.data, packet, encap);
}
else
{
ip_packet_t *packet;
ipsec_sa_t *sa;
host_t *src, *dst;
- bool acquire = FALSE;
+ bool acquire = FALSE, encap = FALSE;
packet = (ip_packet_t*)this->outbound_queue->dequeue(this->outbound_queue);
return JOB_REQUEUE_DIRECT;
}
sa->update_usestats(sa, packet->get_encoding(packet).len);
+ encap = sa->get_encap(sa);
ipsec->sas->checkin(ipsec->sas, sa);
policy->destroy(policy);
- send_outbound(this, esp_packet);
+ send_outbound(this, esp_packet, encap);
return JOB_REQUEUE_DIRECT;
}
/*
- * Copyright (C) 2012 Tobias Brunner
+ * Copyright (C) 2012-2023 Tobias Brunner
*
* Copyright (C) secunet Security Networks AG
*
*
* @param data data supplied during registration of the callback
* @param packet ESP packet to send
+ * @param encap TRUE to send the packet with UDP encapsulation
*/
-typedef void (*ipsec_outbound_cb_t)(void *data, esp_packet_t *packet);
+typedef void (*ipsec_outbound_cb_t)(void *data, esp_packet_t *packet,
+ bool encap);
/**
* IPsec processor