X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=blobdiff_plain;f=src%2Fcharon%2Fencoding%2Fmessage.h;h=8f0be56a9df1e0d874fcce29a9c64f6884833a5e;hp=41edd4c75a65720070a98ef181bc941c35e99fc0;hb=a9522e16003dd9f9fc7dc998a9017dbb41a65273;hpb=3dd3c5f39e57ef2f402870136579f7478a4eba34 diff --git a/src/charon/encoding/message.h b/src/charon/encoding/message.h index 41edd4c..8f0be56 100644 --- a/src/charon/encoding/message.h +++ b/src/charon/encoding/message.h @@ -7,7 +7,8 @@ /* * Copyright (C) 2006 Tobias Brunner, Daniel Roethlisberger - * Copyright (C) 2005 Jan Hutter, Martin Willi + * Copyright (C) 2005-2006 Martin Willi + * Copyright (C) 2005 Jan Hutter * Hochschule fuer Technik Rapperswil * * This program is free software; you can redistribute it and/or modify it @@ -24,7 +25,9 @@ #ifndef MESSAGE_H_ #define MESSAGE_H_ -#include +typedef struct message_t message_t; + +#include #include #include #include @@ -33,9 +36,6 @@ #include #include - -typedef struct message_t message_t; - /** * @brief This class is used to represent an IKEv2-Message. * @@ -184,6 +184,21 @@ struct message_t { void (*add_payload) (message_t *this, payload_t *payload); /** + * @brief Build a notify payload and add it to the message. + * + * This is a helper method to create notify messages or add + * notify payload to messages. The flush parameter specifies if existing + * payloads should get removed before appending the notify. + * + * @param this message_t object + * @param flush TRUE to remove existing payloads + * @param type type of the notify + * @param data a chunk of data to add to the notify, gets cloned + */ + void (*add_notify) (message_t *this, bool flush, notify_type_t type, + chunk_t data); + + /** * @brief Parses header of message. * * Begins parisng of a message created via message_create_from_packet(). @@ -304,6 +319,17 @@ struct message_t { iterator_t * (*get_payload_iterator) (message_t *this); /** + * @brief Find a payload of a specific type. + * + * Returns the first occurance. + * + * @param this message_t object + * @param type type of the payload to find + * @return payload, or NULL if no such payload found + */ + payload_t* (*get_payload) (message_t *this, payload_type_t type); + + /** * @brief Returns a clone of the internal stored packet_t object. * * @param this message_t object