b2bae7728af850b578e09452cf9de850d659cef8
[strongswan.git] / src / charon / sa / transactions / create_child_sa.h
1 /**
2 * @file create_child_sa.h
3 *
4 * @brief Interface of transaction create_child_sa.
5 *
6 */
7
8 /*
9 * Copyright (C) 2006 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 CREATE_CHILD_SA_
25 #define CREATE_CHILD_SA_
26
27 #include <sa/ike_sa.h>
28 #include <sa/child_sa.h>
29 #include <sa/transactions/transaction.h>
30
31
32 typedef struct create_child_sa_t create_child_sa_t;
33
34 /**
35 * @brief A transaction to create a new or rekey an existing CHILD_SA.
36 *
37 * Rekeying of an CHILD_SA works the same way as creating a new one,
38 * but includes an additional REKEY_SA notify and deletes the old
39 * one (in a separate transaction).
40 *
41 * @b Constructors:
42 * - create_child_sa_create()
43 * - transaction_create() with the appropriate message
44 *
45 * @ingroup transactions
46 */
47 struct create_child_sa_t {
48
49 /**
50 * The transaction_t interface.
51 */
52 transaction_t transaction;
53
54 /**
55 * @brief Set the CHILD_SA which gets rekeyed by the new one.
56 *
57 * If this transaction is used for rekeying, set the inbound
58 * SPI of the CHILD_SA which the new CHILD_SA rekeys.
59 *
60 * @param this calling object
61 * @param child_sa CHILD_SA to rekey
62 */
63 void (*rekeys_child) (create_child_sa_t* this, child_sa_t *child_sa);
64 };
65
66 /**
67 * @brief Create a new transaction which creates/rekeys CHILD_SAs.
68 *
69 * @param ike_sa assigned IKE_SA
70 * @param message_id message ids used in this transaction
71 * @return created create_child_sa transaction
72 *
73 * @ingroup transactions
74 */
75 create_child_sa_t *create_child_sa_create(ike_sa_t *ike_sa, u_int32_t message_id);
76
77 #endif /* CREATE_CHILD_SA_ */