- key derivation for child_sa works
[strongswan.git] / Source / charon / sa / child_sa.h
1 /**
2 * @file child_sa.h
3 *
4 * @brief Interface of child_sa_t.
5 *
6 */
7
8 /*
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
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>.
16 *
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
20 * for more details.
21 */
22
23
24 #ifndef _CHILD_SA_H_
25 #define _CHILD_SA_H_
26
27 #include <types.h>
28 #include <transforms/prf_plus.h>
29 #include <encoding/payloads/proposal_substructure.h>
30
31 typedef struct child_sa_t child_sa_t;
32
33 /**
34 * @brief Represents a CHILD_SA between to hosts.
35 *
36 *
37 * @b Constructors:
38 * - child_sa_create
39 *
40 * @ingroup sa
41 */
42 struct child_sa_t {
43
44 /**
45 * @brief Returns the SPI value of this CHILD_SA.
46 *
47 * AH and ESP are using 4 byte SPI values.
48 *
49 * @param this calling object
50 * @return 4 Byte SPI value
51 */
52 u_int32_t (*get_spi) (child_sa_t *this);
53
54 /**
55 * @brief Destroys a child_sa.
56 *
57 * @param this calling object
58 */
59 void (*destroy) (child_sa_t *this);
60 };
61
62 /**
63 * @brief Constructor to create a new CHILD_SA.
64 *
65 * @param protocol_id protocol id (AH or ESP) of CHILD_SA
66 * @param prf_plus prf_plus_t object use to derive shared secrets
67 * @return child_sa_t object
68 * @ingroup sa
69 */
70 child_sa_t * child_sa_create(child_proposal_t *proposal, prf_plus_t *prf_plus);
71
72 #endif /*_CHILD_SA_H_*/