aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/encoding
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/encoding')
-rw-r--r--src/charon/encoding/message.c12
-rw-r--r--src/charon/encoding/message.h11
2 files changed, 21 insertions, 2 deletions
diff --git a/src/charon/encoding/message.c b/src/charon/encoding/message.c
index 980ff12b5..b093d2550 100644
--- a/src/charon/encoding/message.c
+++ b/src/charon/encoding/message.c
@@ -6,7 +6,8 @@
*/
/*
- * Copyright (C) 2006 Tobias Brunner, Daniel Roethlisberger
+ * Copyright (C) 2006-2007 Tobias Brunner
+ * Copyright (C) 2006 Daniel Roethlisberger
* Copyright (C) 2005-2006 Martin Willi
* Copyright (C) 2005 Jan Hutter
* Hochschule fuer Technik Rapperswil
@@ -446,6 +447,14 @@ static exchange_type_t get_exchange_type (private_message_t *this)
}
/**
+ * Implementation of message_t.get_first_payload_type.
+ */
+static payload_type_t get_first_payload_type (private_message_t *this)
+{
+ return this->first_payload;
+}
+
+/**
* Implementation of message_t.set_request.
*/
static void set_request (private_message_t *this,bool request)
@@ -1255,6 +1264,7 @@ message_t *message_create_from_packet(packet_t *packet)
this->public.get_ike_sa_id = (ike_sa_id_t*(*)(message_t*))get_ike_sa_id;
this->public.set_exchange_type = (void(*)(message_t*, exchange_type_t))set_exchange_type;
this->public.get_exchange_type = (exchange_type_t(*)(message_t*))get_exchange_type;
+ this->public.get_first_payload_type = (payload_type_t(*)(message_t*))get_first_payload_type;
this->public.set_request = (void(*)(message_t*, bool))set_request;
this->public.get_request = (bool(*)(message_t*))get_request;
this->public.add_payload = (void(*)(message_t*,payload_t*))add_payload;
diff --git a/src/charon/encoding/message.h b/src/charon/encoding/message.h
index 8f0be56a9..35b659f33 100644
--- a/src/charon/encoding/message.h
+++ b/src/charon/encoding/message.h
@@ -6,7 +6,8 @@
*/
/*
- * Copyright (C) 2006 Tobias Brunner, Daniel Roethlisberger
+ * Copyright (C) 2006-2007 Tobias Brunner
+ * Copyright (C) 2006 Daniel Roethlisberger
* Copyright (C) 2005-2006 Martin Willi
* Copyright (C) 2005 Jan Hutter
* Hochschule fuer Technik Rapperswil
@@ -152,6 +153,14 @@ struct message_t {
* @return exchange type of the message
*/
exchange_type_t (*get_exchange_type) (message_t *this);
+
+ /**
+ * @brief Gets the payload type of the first payload.
+ *
+ * @param this message_t object
+ * @return payload type of the first payload
+ */
+ payload_type_t (*get_first_payload_type) (message_t *this);
/**
* @brief Sets the request flag.