updated Doxyfile
[strongswan.git] / src / charon / encoding / payloads / auth_payload.h
1 /*
2 * Copyright (C) 2005-2006 Martin Willi
3 * Copyright (C) 2005 Jan Hutter
4 * Hochschule fuer Technik Rapperswil
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * $Id$
17 */
18
19 /**
20 * @defgroup auth_payload auth_payload
21 * @{ @ingroup payloads
22 */
23
24 #ifndef AUTH_PAYLOAD_H_
25 #define AUTH_PAYLOAD_H_
26
27 typedef struct auth_payload_t auth_payload_t;
28
29 #include <library.h>
30 #include <encoding/payloads/payload.h>
31 #include <sa/authenticators/authenticator.h>
32
33 /**
34 * Length of a auth payload without the auth data in bytes.
35 */
36 #define AUTH_PAYLOAD_HEADER_LENGTH 8
37
38 /**
39 * Class representing an IKEv2 AUTH payload.
40 *
41 * The AUTH payload format is described in RFC section 3.8.
42 */
43 struct auth_payload_t {
44
45 /**
46 * The payload_t interface.
47 */
48 payload_t payload_interface;
49
50 /**
51 * Set the AUTH method.
52 *
53 * @param method auth_method_t to use
54 */
55 void (*set_auth_method) (auth_payload_t *this, auth_method_t method);
56
57 /**
58 * Get the AUTH method.
59 *
60 * @return auth_method_t used
61 */
62 auth_method_t (*get_auth_method) (auth_payload_t *this);
63
64 /**
65 * Set the AUTH data.
66 *
67 * Data gets cloned.
68 *
69 * @param data AUTH data as chunk_t
70 */
71 void (*set_data) (auth_payload_t *this, chunk_t data);
72
73 /**
74 * Get the AUTH data.
75 *
76 * Returned data are a copy of the internal one.
77 *
78 * @return AUTH data as chunk_t
79 */
80 chunk_t (*get_data_clone) (auth_payload_t *this);
81
82 /**
83 * Get the AUTH data.
84 *
85 * Returned data are NOT copied
86 *
87 * @return AUTH data as chunk_t
88 */
89 chunk_t (*get_data) (auth_payload_t *this);
90
91 /**
92 * Destroys an auth_payload_t object.
93 */
94 void (*destroy) (auth_payload_t *this);
95 };
96
97 /**
98 * Creates an empty auth_payload_t object.
99 *
100 * @return auth_payload_t object
101 */
102 auth_payload_t *auth_payload_create(void);
103
104 #endif /** AUTH_PAYLOAD_H_ @}*/