aboutsummaryrefslogtreecommitdiffstats
path: root/src/libipsec/esp_packet.h
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2012-07-13 15:23:00 +0200
committerTobias Brunner <tobias@strongswan.org>2012-08-08 15:41:03 +0200
commitb37758c41eb3137a4398847e729d6fa3d70617a6 (patch)
tree5e740c45f9d75f7b2bd286e8fb5827cef3124d69 /src/libipsec/esp_packet.h
parent2e1a19136d8123e5a8c9aa99afbb4a51d92ec2a6 (diff)
downloadstrongswan-b37758c41eb3137a4398847e729d6fa3d70617a6.tar.bz2
strongswan-b37758c41eb3137a4398847e729d6fa3d70617a6.tar.xz
Represent the payload of an ESP packet as ip_packet_t instead of a chunk_t
Diffstat (limited to 'src/libipsec/esp_packet.h')
-rw-r--r--src/libipsec/esp_packet.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/libipsec/esp_packet.h b/src/libipsec/esp_packet.h
index 7dbbd1986..a1d1602c1 100644
--- a/src/libipsec/esp_packet.h
+++ b/src/libipsec/esp_packet.h
@@ -23,6 +23,7 @@
#ifndef ESP_PACKET_H_
#define ESP_PACKET_H_
+#include "ip_packet.h"
#include "esp_context.h"
#include <library.h>
@@ -105,12 +106,20 @@ struct esp_packet_t {
u_int8_t (*get_next_header)(esp_packet_t *this);
/**
- * Get the plaintext payload of this packet (e.g. inner IP packet).
+ * Get the plaintext payload of this packet.
*
* @return plaintext payload (internal data),
- * chunk_empty if not decrypted
+ * NULL if not decrypted
*/
- chunk_t (*get_payload)(esp_packet_t *this);
+ ip_packet_t *(*get_payload)(esp_packet_t *this);
+
+ /**
+ * Extract the plaintext payload from this packet.
+ *
+ * @return plaintext payload (has to be destroyed),
+ * NULL if not decrypted
+ */
+ ip_packet_t *(*extract_payload)(esp_packet_t *this);
/**
* Destroy an esp_packet_t
@@ -128,17 +137,15 @@ struct esp_packet_t {
esp_packet_t *esp_packet_create_from_packet(packet_t *packet);
/**
- * Create an ESP packet from a plaintext payload (e.g. inner IP packet)
+ * Create an ESP packet from a plaintext payload
*
* @param src source address
* @param dst destination address
- * @param payload plaintext payload (e.g. inner IP packet), gets owned
- * @param next_header next header type of the payload (e.g IPPROTO_IPIP)
+ * @param payload plaintext payload, gets owned
* @return esp_packet_t instance
*/
esp_packet_t *esp_packet_create_from_payload(host_t *src, host_t *dst,
- chunk_t payload,
- u_int8_t next_header);
+ ip_packet_t *payload);
#endif /** ESP_PACKET_H_ @}*/