Annotation of embedaddon/strongswan/src/libimcv/imc/imc_state.h, revision 1.1

1.1     ! misho       1: /*
        !             2:  * Copyright (C) 2011-2014 Andreas Steffen
        !             3:  * HSR Hochschule fuer Technik Rapperswil
        !             4:  *
        !             5:  * This program is free software; you can redistribute it and/or modify it
        !             6:  * under the terms of the GNU General Public License as published by the
        !             7:  * Free Software Foundation; either version 2 of the License, or (at your
        !             8:  * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
        !             9:  *
        !            10:  * This program is distributed in the hope that it will be useful, but
        !            11:  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
        !            12:  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
        !            13:  * for more details.
        !            14:  */
        !            15: 
        !            16: /**
        !            17:  *
        !            18:  * @defgroup imc_state_t imc_state
        !            19:  * @{ @ingroup libimcv_imc
        !            20:  */
        !            21: 
        !            22: #ifndef IMC_STATE_H_
        !            23: #define IMC_STATE_H_
        !            24: 
        !            25: #include "seg/seg_contract_manager.h"
        !            26: 
        !            27: #include <tncif.h>
        !            28: #include <tncifimv.h>
        !            29: #include <tncifimc.h>
        !            30: 
        !            31: #include <library.h>
        !            32: 
        !            33: typedef struct imc_state_t imc_state_t;
        !            34: 
        !            35: /**
        !            36:  * Internal state of an IMC connection instance
        !            37:  */
        !            38: struct imc_state_t {
        !            39: 
        !            40:        /**
        !            41:         * Get the TNCS connection ID attached to the state
        !            42:         *
        !            43:         * @return                              TNCS connection ID of the state
        !            44:         */
        !            45:         TNC_ConnectionID (*get_connection_id)(imc_state_t *this);
        !            46: 
        !            47:        /**
        !            48:         * Checks if long message types are supported for this TNCCS connection
        !            49:         *
        !            50:         * @return                              TRUE if set, FALSE otherwise
        !            51:         */
        !            52:        bool (*has_long)(imc_state_t *this);
        !            53: 
        !            54:        /**
        !            55:         * Checks if the exclusive delivery is supported for this TNCCS connection
        !            56:         *
        !            57:         * @return                              TRUE if set, FALSE otherwise
        !            58:         */
        !            59:        bool (*has_excl)(imc_state_t *this);
        !            60: 
        !            61:        /**
        !            62:         * Sets the long message types and exclusive flags for this TNCCS connection
        !            63:         *
        !            64:         * @param has_long              TNCCS connection supports long message types
        !            65:         * @param has_excl              TNCCS connection supports exclusive delivery
        !            66:         * @return                              TRUE if set, FALSE otherwise
        !            67:         */
        !            68:        void (*set_flags)(imc_state_t *this, bool has_long, bool has_excl);
        !            69: 
        !            70:        /**
        !            71:         * Set the maximum size of a PA-TNC message for this TNCCS connection
        !            72:         *
        !            73:         * @param max_msg_len   maximum size of a PA-TNC message
        !            74:         */
        !            75:        void (*set_max_msg_len)(imc_state_t *this, uint32_t max_msg_len);
        !            76: 
        !            77:        /**
        !            78:         * Get the maximum size of a PA-TNC message for this TNCCS connection
        !            79:         *
        !            80:         * @return                              maximum size of a PA-TNC message
        !            81:         */
        !            82:        uint32_t (*get_max_msg_len)(imc_state_t *this);
        !            83: 
        !            84:        /**
        !            85:         * Get attribute segmentation contracts associated with TNCCS Connection
        !            86:         *
        !            87:         * @return                              contracts associated with TNCCS Connection
        !            88:         */
        !            89:        seg_contract_manager_t* (*get_contracts)(imc_state_t *this);
        !            90: 
        !            91:        /**
        !            92:         * Change the connection state
        !            93:         *
        !            94:         * @param new_state             new connection state
        !            95:         * @return                              old connection state
        !            96:         */
        !            97:        TNC_ConnectionState (*change_state)(imc_state_t *this,
        !            98:                                                 TNC_ConnectionState new_state);
        !            99: 
        !           100:        /**
        !           101:         * Set the Assessment/Evaluation Result
        !           102:         *
        !           103:         * @param id                    IMC ID
        !           104:         * @param result                Assessment/Evaluation Result
        !           105:         */
        !           106:        void (*set_result)(imc_state_t *this, TNC_IMCID id,
        !           107:                                                                                  TNC_IMV_Evaluation_Result result);
        !           108: 
        !           109:        /**
        !           110:         * Get the Assessment/Evaluation Result
        !           111:         *
        !           112:         * @param id                    IMC ID
        !           113:         * @param result                Assessment/Evaluation Result
        !           114:         * @return                              TRUE if result is known
        !           115:         */
        !           116:        bool (*get_result)(imc_state_t *this, TNC_IMCID id,
        !           117:                                                                                  TNC_IMV_Evaluation_Result *result);
        !           118: 
        !           119:        /**
        !           120:         * Resets the state for a new measurement cycle triggered by a SRETRY batch
        !           121:         */
        !           122:        void (*reset)(imc_state_t *this);
        !           123: 
        !           124:        /**
        !           125:         * Destroys an imc_state_t object
        !           126:         */
        !           127:        void (*destroy)(imc_state_t *this);
        !           128: };
        !           129: 
        !           130: #endif /** IMC_STATE_H_ @}*/

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