2007-02-28 14:04:36 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 Martin Willi
|
|
|
|
* Hochschule fuer Technik Rapperswil
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
2008-03-13 14:14:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup child_create child_create
|
|
|
|
* @{ @ingroup tasks
|
2007-02-28 14:04:36 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CHILD_CREATE_H_
|
|
|
|
#define CHILD_CREATE_H_
|
|
|
|
|
|
|
|
typedef struct child_create_t child_create_t;
|
|
|
|
|
|
|
|
#include <library.h>
|
|
|
|
#include <sa/ike_sa.h>
|
2011-12-19 12:10:29 +00:00
|
|
|
#include <sa/task.h>
|
2007-04-10 06:01:03 +00:00
|
|
|
#include <config/child_cfg.h>
|
2007-02-28 14:04:36 +00:00
|
|
|
|
|
|
|
/**
|
2011-11-21 11:18:24 +00:00
|
|
|
* Task of type TASK_CHILD_CREATE, established a new CHILD_SA.
|
2007-02-28 14:04:36 +00:00
|
|
|
*
|
2009-09-04 11:46:09 +00:00
|
|
|
* This task may be included in the IKE_AUTH message or in a separate
|
2007-02-28 14:04:36 +00:00
|
|
|
* CREATE_CHILD_SA exchange.
|
|
|
|
*/
|
|
|
|
struct child_create_t {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements the task_t interface
|
|
|
|
*/
|
|
|
|
task_t task;
|
2009-09-04 11:46:09 +00:00
|
|
|
|
2007-02-28 14:04:36 +00:00
|
|
|
/**
|
2008-03-13 14:14:44 +00:00
|
|
|
* Use a specific reqid for the CHILD_SA.
|
2007-02-28 14:04:36 +00:00
|
|
|
*
|
|
|
|
* When this task is used for rekeying, the same reqid is used
|
2009-09-04 11:46:09 +00:00
|
|
|
* for the new CHILD_SA.
|
2007-02-28 14:04:36 +00:00
|
|
|
*
|
|
|
|
* @param reqid reqid to use
|
|
|
|
*/
|
|
|
|
void (*use_reqid) (child_create_t *this, u_int32_t reqid);
|
2009-09-04 11:46:09 +00:00
|
|
|
|
2007-03-21 14:42:49 +00:00
|
|
|
/**
|
2008-03-13 14:14:44 +00:00
|
|
|
* Get the lower of the two nonces, used for rekey collisions.
|
2007-03-21 14:42:49 +00:00
|
|
|
*
|
|
|
|
* @return lower nonce
|
|
|
|
*/
|
|
|
|
chunk_t (*get_lower_nonce) (child_create_t *this);
|
2009-09-04 11:46:09 +00:00
|
|
|
|
2007-03-21 09:25:36 +00:00
|
|
|
/**
|
2008-03-13 14:14:44 +00:00
|
|
|
* Get the CHILD_SA established/establishing by this task.
|
2007-03-21 09:25:36 +00:00
|
|
|
*
|
|
|
|
* @return child_sa
|
|
|
|
*/
|
|
|
|
child_sa_t* (*get_child) (child_create_t *this);
|
2007-02-28 14:04:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2008-03-13 14:14:44 +00:00
|
|
|
* Create a new child_create task.
|
2007-02-28 14:04:36 +00:00
|
|
|
*
|
|
|
|
* @param ike_sa IKE_SA this task works for
|
2007-04-10 06:01:03 +00:00
|
|
|
* @param config child_cfg if task initiator, NULL if responder
|
2009-07-09 11:11:46 +00:00
|
|
|
* @param rekey whether we do a rekey or not
|
2009-05-20 09:44:43 +00:00
|
|
|
* @param tsi source of triggering packet, or NULL
|
|
|
|
* @param tsr destination of triggering packet, or NULL
|
|
|
|
* @return child_create task to handle by the task_manager
|
2007-02-28 14:04:36 +00:00
|
|
|
*/
|
2009-07-09 11:11:46 +00:00
|
|
|
child_create_t *child_create_create(ike_sa_t *ike_sa,
|
|
|
|
child_cfg_t *config, bool rekey,
|
2009-05-20 09:44:43 +00:00
|
|
|
traffic_selector_t *tsi, traffic_selector_t *tsr);
|
2007-02-28 14:04:36 +00:00
|
|
|
|
2009-03-24 17:43:01 +00:00
|
|
|
#endif /** CHILD_CREATE_H_ @}*/
|