2 * @file vendor_id_payload.h
4 * @brief Interface of vendor_id_payload_t.
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 #ifndef VENDOR_ID_PAYLOAD_H_
24 #define VENDOR_ID_PAYLOAD_H_
27 #include <encoding/payloads/payload.h>
30 * Length of a VENDOR ID payload without the VID data in bytes.
34 #define VENDOR_ID_PAYLOAD_HEADER_LENGTH 4
37 typedef struct vendor_id_payload_t vendor_id_payload_t
;
40 * @brief Class representing an IKEv2 VENDOR ID payload.
42 * The VENDOR ID payload format is described in RFC section 3.12.
45 * - vendor_id_payload_create()
49 struct vendor_id_payload_t
{
51 * The payload_t interface.
53 payload_t payload_interface
;
56 * @brief Set the VID data.
58 * Data are getting cloned.
60 * @param this calling vendor_id_payload_t object
61 * @param data VID data as chunk_t
63 void (*set_data
) (vendor_id_payload_t
*this, chunk_t data
);
66 * @brief Get the VID data.
68 * Returned data are a copy of the internal one.
70 * @param this calling vendor_id_payload_t object
71 * @return VID data as chunk_t
73 chunk_t (*get_data_clone
) (vendor_id_payload_t
*this);
76 * @brief Get the VID data.
78 * Returned data are NOT copied.
80 * @param this calling vendor_id_payload_t object
81 * @return VID data as chunk_t
83 chunk_t (*get_data
) (vendor_id_payload_t
*this);
86 * @brief Destroys an vendor_id_payload_t object.
88 * @param this vendor_id_payload_t object to destroy
90 void (*destroy
) (vendor_id_payload_t
*this);
94 * @brief Creates an empty vendor_id_payload_t object.
96 * @return vendor_id_payload_t object
100 vendor_id_payload_t
*vendor_id_payload_create(void);
103 #endif /* VENDOR_ID_PAYLOAD_H_ */