2 * @file notify_payload.h
4 * @brief Declaration of the class notify_payload_t.
6 * An object of this type represents an IKEv2 Notify-Payload.
8 * See section 3.10 of Draft for details of this payload type.
13 * Copyright (C) 2005 Jan Hutter, Martin Willi
14 * Hochschule fuer Technik Rapperswil
16 * This program is free software; you can redistribute it and/or modify it
17 * under the terms of the GNU General Public License as published by the
18 * Free Software Foundation; either version 2 of the License, or (at your
19 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
21 * This program is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
28 #ifndef NOTIFY_PAYLOAD_H_
29 #define NOTIFY_PAYLOAD_H_
32 #include <payloads/payload.h>
33 #include <utils/linked_list.h>
36 * Critical flag must not be set
38 #define NOTIFY_PAYLOAD_CRITICAL_FLAG FALSE;
41 * Notify payload length in bytes without any spi and notification data
43 #define NOTIFY_PAYLOAD_HEADER_LENGTH 8
46 * Object representing an IKEv2-Notify Payload
48 * The Notify Payload format is described in Draft section 3.10.
51 typedef struct notify_payload_s notify_payload_t
;
53 struct notify_payload_s
{
55 * implements payload_t interface
57 payload_t payload_interface
;
60 * @brief Gets the protocol id of this payload.
62 * @param this calling notify_payload_t object
63 * @return protocol id of this payload
65 u_int8_t (*get_protocol_id
) (notify_payload_t
*this);
68 * @brief Sets the protocol id of this payload.
70 * @param this calling notify_payload_t object
71 * @param protocol_id protocol id to set
74 status_t (*set_protocol_id
) (notify_payload_t
*this, u_int8_t protocol_id
);
77 * @brief Gets the notify message type of this payload.
79 * @param this calling notify_payload_t object
80 * @return notify message type of this payload
82 u_int16_t (*get_notify_message_type
) (notify_payload_t
*this);
85 * @brief Sets notify message type of this payload.
87 * @param this calling notify_payload_t object
88 * @param notify_message_type notify message type to set
91 status_t (*set_notify_message_type
) (notify_payload_t
*this, u_int16_t notify_message_type
);
94 * @brief Returns the currently set spi of this payload.
96 * @warning Returned data are not copied.
98 * @param this calling notify_payload_t object
99 * @return chunk_t pointing to the value
101 chunk_t (*get_spi
) (notify_payload_t
*this);
104 * @brief Sets the spi of this payload.
106 * @warning Value is getting copied.
108 * @param this calling notify_payload_t object
109 * @param spi chunk_t pointing to the value to set
114 status_t (*set_spi
) (notify_payload_t
*this, chunk_t spi
);
117 * @brief Returns the currently set notification data of payload.
119 * @warning Returned data are not copied.
121 * @param this calling notify_payload_t object
122 * @return chunk_t pointing to the value
124 chunk_t (*get_notification_data
) (notify_payload_t
*this);
127 * @brief Sets the notification data of this payload.
129 * @warning Value is getting copied.
131 * @param this calling notify_payload_t object
132 * @param notification_data chunk_t pointing to the value to set
137 status_t (*set_notification_data
) (notify_payload_t
*this, chunk_t notification_data
);
140 * @brief Destroys an notify_payload_t object.
142 * @param this notify_payload_t object to destroy
144 * SUCCESS in any case
146 status_t (*destroy
) (notify_payload_t
*this);
150 * @brief Creates an empty notify_payload_t object
153 * - created notify_payload_t object, or
156 notify_payload_t
*notify_payload_create();
159 #endif /*NOTIFY_PAYLOAD_H_*/