Annotation of embedaddon/strongswan/src/libcharon/encoding/payloads/id_payload.h, revision 1.1

1.1     ! misho       1: /*
        !             2:  * Copyright (C) 2007 Tobias Brunner
        !             3:  * Copyright (C) 2005-2006 Martin Willi
        !             4:  * Copyright (C) 2005 Jan Hutter
        !             5:  * HSR Hochschule fuer Technik Rapperswil
        !             6:  *
        !             7:  * This program is free software; you can redistribute it and/or modify it
        !             8:  * under the terms of the GNU General Public License as published by the
        !             9:  * Free Software Foundation; either version 2 of the License, or (at your
        !            10:  * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
        !            11:  *
        !            12:  * This program is distributed in the hope that it will be useful, but
        !            13:  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
        !            14:  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
        !            15:  * for more details.
        !            16:  */
        !            17: 
        !            18: /**
        !            19:  * @defgroup id_payload id_payload
        !            20:  * @{ @ingroup payloads
        !            21:  */
        !            22: 
        !            23: #ifndef ID_PAYLOAD_H_
        !            24: #define ID_PAYLOAD_H_
        !            25: 
        !            26: typedef struct id_payload_t id_payload_t;
        !            27: 
        !            28: #include <library.h>
        !            29: #include <utils/identification.h>
        !            30: #include <encoding/payloads/payload.h>
        !            31: #include <selectors/traffic_selector.h>
        !            32: 
        !            33: /**
        !            34:  * Object representing an IKEv1 or an IKEv2 ID payload.
        !            35:  */
        !            36: struct id_payload_t {
        !            37: 
        !            38:        /**
        !            39:         * The payload_t interface.
        !            40:         */
        !            41:        payload_t payload_interface;
        !            42: 
        !            43:        /**
        !            44:         * Creates an identification object of this id payload.
        !            45:         *
        !            46:         * @return                              identification_t object
        !            47:         */
        !            48:        identification_t *(*get_identification) (id_payload_t *this);
        !            49: 
        !            50:        /**
        !            51:         * Creates a traffic selector form a ID_ADDR_SUBNET/RANGE identity.
        !            52:         *
        !            53:         * @return                              traffic selector, NULL on failure
        !            54:         */
        !            55:        traffic_selector_t* (*get_ts)(id_payload_t *this);
        !            56: 
        !            57:        /**
        !            58:         * Get encoded payload without fixed payload header (used for IKEv1).
        !            59:         *
        !            60:         * @return                              encoded payload (gets allocated)
        !            61:         */
        !            62:        chunk_t (*get_encoded)(id_payload_t *this);
        !            63: 
        !            64:        /**
        !            65:         * Destroys an id_payload_t object.
        !            66:         */
        !            67:        void (*destroy) (id_payload_t *this);
        !            68: };
        !            69: 
        !            70: /**
        !            71:  * Creates an empty id_payload_t object.
        !            72:  *
        !            73:  * @param type         one of PLV2_ID_INITIATOR, PLV2_ID_RESPONDER, PLV1_ID and PLV1_NAT_OA
        !            74:  * @return                     id_payload_t object
        !            75:  */
        !            76: id_payload_t *id_payload_create(payload_type_t type);
        !            77: 
        !            78: /**
        !            79:  * Creates an id_payload_t from an existing identification_t object.
        !            80:  *
        !            81:  * @param type         one of PLV2_ID_INITIATOR, PLV2_ID_RESPONDER, PLV1_ID and PLV1_NAT_OA
        !            82:  * @param id           identification_t object
        !            83:  * @return                     id_payload_t object
        !            84:  */
        !            85: id_payload_t *id_payload_create_from_identification(payload_type_t type,
        !            86:                                                                                                        identification_t *id);
        !            87: 
        !            88: /**
        !            89:  * Create an IKEv1 ID_ADDR_SUBNET/RANGE identity from a traffic selector.
        !            90:  *
        !            91:  * @param ts           traffic selector
        !            92:  * @return                     PLV1_ID id_payload_t object.
        !            93:  */
        !            94: id_payload_t *id_payload_create_from_ts(traffic_selector_t *ts);
        !            95: 
        !            96: #endif /** ID_PAYLOAD_H_ @}*/

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