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

1.1     ! misho       1: /*
        !             2:  * Copyright (C) 2005-2006 Martin Willi
        !             3:  * Copyright (C) 2005 Jan Hutter
        !             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 auth_payload auth_payload
        !            19:  * @{ @ingroup payloads
        !            20:  */
        !            21: 
        !            22: #ifndef AUTH_PAYLOAD_H_
        !            23: #define AUTH_PAYLOAD_H_
        !            24: 
        !            25: typedef struct auth_payload_t auth_payload_t;
        !            26: 
        !            27: #include <library.h>
        !            28: #include <encoding/payloads/payload.h>
        !            29: #include <sa/authenticator.h>
        !            30: 
        !            31: /**
        !            32:  * Class representing an IKEv2 AUTH payload.
        !            33:  *
        !            34:  * The AUTH payload format is described in RFC section 3.8.
        !            35:  */
        !            36: struct auth_payload_t {
        !            37: 
        !            38:        /**
        !            39:         * The payload_t interface.
        !            40:         */
        !            41:        payload_t payload_interface;
        !            42: 
        !            43:        /**
        !            44:         * Set the AUTH method.
        !            45:         *
        !            46:         * @param method                auth_method_t to use
        !            47:         */
        !            48:        void (*set_auth_method) (auth_payload_t *this, auth_method_t method);
        !            49: 
        !            50:        /**
        !            51:         * Get the AUTH method.
        !            52:         *
        !            53:         * @return                              auth_method_t used
        !            54:         */
        !            55:        auth_method_t (*get_auth_method) (auth_payload_t *this);
        !            56: 
        !            57:        /**
        !            58:         * Set the AUTH data.
        !            59:         *
        !            60:         * @param data                  AUTH data as chunk_t, gets cloned
        !            61:         */
        !            62:        void (*set_data) (auth_payload_t *this, chunk_t data);
        !            63: 
        !            64:        /**
        !            65:         * Get the AUTH data.
        !            66:         *
        !            67:         * @return                              AUTH data as chunk_t, internal data
        !            68:         */
        !            69:        chunk_t (*get_data) (auth_payload_t *this);
        !            70: 
        !            71:        /**
        !            72:         * Get the value of a reserved bit.
        !            73:         *
        !            74:         * @param nr                    number of the reserved bit, 0-6
        !            75:         * @return                              TRUE if bit was set, FALSE to clear
        !            76:         */
        !            77:        bool (*get_reserved_bit)(auth_payload_t *this, u_int nr);
        !            78: 
        !            79:        /**
        !            80:         * Set one of the reserved bits.
        !            81:         *
        !            82:         * @param nr                    number of the reserved bit, 0-6
        !            83:         */
        !            84:        void (*set_reserved_bit)(auth_payload_t *this, u_int nr);
        !            85: 
        !            86:        /**
        !            87:         * Destroys an auth_payload_t object.
        !            88:         */
        !            89:        void (*destroy) (auth_payload_t *this);
        !            90: };
        !            91: 
        !            92: /**
        !            93:  * Creates an empty auth_payload_t object.
        !            94:  *
        !            95:  * @return auth_payload_t object
        !            96:  */
        !            97: auth_payload_t *auth_payload_create(void);
        !            98: 
        !            99: #endif /** AUTH_PAYLOAD_H_ @}*/

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