2 * @file certreq_payload.h
4 * @brief Interface of certreq_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 CERTREQ_PAYLOAD_H_
24 #define CERTREQ_PAYLOAD_H_
27 #include <encoding/payloads/payload.h>
28 #include <encoding/payloads/cert_payload.h>
31 * Length of a CERTREQ payload without the CERTREQ data in bytes.
35 #define CERTREQ_PAYLOAD_HEADER_LENGTH 5
38 typedef struct certreq_payload_t certreq_payload_t
;
41 * @brief Class representing an IKEv2 CERTREQ payload.
43 * The CERTREQ payload format is described in RFC section 3.7.
44 * This is just a dummy implementation to fullfill the standards
45 * requirements. A full implementation would offer setters/getters
46 * for the different encoding types.
49 * - certreq_payload_create()
51 * @todo Implement payload functionality.
55 struct certreq_payload_t
{
57 * The payload_t interface.
59 payload_t payload_interface
;
62 * @brief Set the CERT encoding.
64 * @param this calling certreq_payload_t object
65 * @param encoding CERT encoding
67 void (*set_cert_encoding
) (certreq_payload_t
*this, cert_encoding_t encoding
);
70 * @brief Get the CERT encoding.
72 * @param this calling certreq_payload_t object
73 * @return Encoding of the CERT
75 cert_encoding_t (*get_cert_encoding
) (certreq_payload_t
*this);
78 * @brief Set the CERTREQ data.
80 * Data are getting cloned.
82 * @param this calling certreq_payload_t object
83 * @param data CERTREQ data as chunk_t
85 void (*set_data
) (certreq_payload_t
*this, chunk_t data
);
88 * @brief Get the CERTREQ data.
90 * Returned data are a copy of the internal one.
92 * @param this calling certreq_payload_t object
93 * @return CERTREQ data as chunk_t
95 chunk_t (*get_data_clone
) (certreq_payload_t
*this);
98 * @brief Get the CERTREQ data.
100 * Returned data are NOT copied.
102 * @param this calling certreq_payload_t object
103 * @return CERTREQ data as chunk_t
105 chunk_t (*get_data
) (certreq_payload_t
*this);
108 * @brief Destroys an certreq_payload_t object.
110 * @param this certreq_payload_t object to destroy
112 void (*destroy
) (certreq_payload_t
*this);
116 * @brief Creates an empty certreq_payload_t object.
118 * @return certreq_payload_t object
122 certreq_payload_t
*certreq_payload_create(void);
125 #endif /* CERTREQ_PAYLOAD_H_ */