Annotation of embedaddon/strongswan/src/libcharon/sa/ikev2/tasks/child_rekey.h, revision 1.1

1.1     ! misho       1: /*
        !             2:  * Copyright (C) 2016 Tobias Brunner
        !             3:  * Copyright (C) 2007 Martin Willi
        !             4:  * HSR 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: 
        !            17: /**
        !            18:  * @defgroup child_rekey child_rekey
        !            19:  * @{ @ingroup tasks_v2
        !            20:  */
        !            21: 
        !            22: #ifndef CHILD_REKEY_H_
        !            23: #define CHILD_REKEY_H_
        !            24: 
        !            25: typedef struct child_rekey_t child_rekey_t;
        !            26: 
        !            27: #include <library.h>
        !            28: #include <sa/ike_sa.h>
        !            29: #include <sa/child_sa.h>
        !            30: #include <sa/task.h>
        !            31: 
        !            32: /**
        !            33:  * Task of type TASK_CHILD_REKEY, rekey an established CHILD_SA.
        !            34:  */
        !            35: struct child_rekey_t {
        !            36: 
        !            37:        /**
        !            38:         * Implements the task_t interface
        !            39:         */
        !            40:        task_t task;
        !            41: 
        !            42:        /**
        !            43:         * Check if the given SA is the redundant CHILD_SA created during a rekey
        !            44:         * collision.
        !            45:         *
        !            46:         * This is called if the other peer deletes the redundant SA before we were
        !            47:         * able to handle the CREATE_CHILD_SA response.
        !            48:         *
        !            49:         * @param child         CHILD_SA to check
        !            50:         * @return                      TRUE if the SA is the redundant CHILD_SA
        !            51:         */
        !            52:        bool (*is_redundant)(child_rekey_t *this, child_sa_t *child);
        !            53: 
        !            54:        /**
        !            55:         * Register a rekeying/delete task which collides with this one
        !            56:         *
        !            57:         * If two peers initiate rekeying at the same time, the collision must
        !            58:         * be handled gracefully. The task manager is aware of what exchanges
        !            59:         * are going on and notifies the active task by passing the passive.
        !            60:         *
        !            61:         * @param other         passive task (adopted)
        !            62:         */
        !            63:        void (*collide)(child_rekey_t* this, task_t *other);
        !            64: };
        !            65: 
        !            66: /**
        !            67:  * Create a new TASK_CHILD_REKEY task.
        !            68:  *
        !            69:  * @param ike_sa               IKE_SA this task works for
        !            70:  * @param protocol             protocol of CHILD_SA to rekey, PROTO_NONE as responder
        !            71:  * @param spi                  inbound SPI of CHILD_SA to rekey
        !            72:  * @return                             child_rekey task to handle by the task_manager
        !            73:  */
        !            74: child_rekey_t *child_rekey_create(ike_sa_t *ike_sa, protocol_id_t protocol,
        !            75:                                                                  uint32_t spi);
        !            76: 
        !            77: #endif /** CHILD_REKEY_H_ @}*/

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>