Annotation of embedaddon/strongswan/src/libimcv/ietf/ietf_attr_op_status.h, revision 1.1.1.1

1.1       misho       1: /*
                      2:  * Copyright (C) 2012-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:  * @defgroup ietf_attr_op_statust ietf_attr_op_status
                     18:  * @{ @ingroup ietf_attr
                     19:  */
                     20: 
                     21: #ifndef IETF_ATTR_OP_STATUS_H_
                     22: #define IETF_ATTR_OP_STATUS_H_
                     23: 
                     24: typedef struct ietf_attr_op_status_t ietf_attr_op_status_t;
                     25: typedef enum op_status_t op_status_t;
                     26: typedef enum op_result_t op_result_t;
                     27: 
                     28: #include "ietf_attr.h"
                     29: #include "pa_tnc/pa_tnc_attr.h"
                     30: 
                     31: /**
                     32:  * Operational Status type
                     33:  */
                     34: enum op_status_t {
                     35:        OP_STATUS_UNKNOWN =       0,
                     36:        OP_STATUS_NOT_INSTALLED = 1,
                     37:        OP_STATUS_INSTALLED =     2,
                     38:        OP_STATUS_OPERATIONAL =   3,
                     39:        OP_STATUS_ROOF =          3
                     40: };
                     41: 
                     42: extern enum_name_t *op_status_names;
                     43: 
                     44: /**
                     45:  * Operational Result type
                     46:  */
                     47: enum op_result_t {
                     48:        OP_RESULT_UNKNOWN =      0,
                     49:        OP_RESULT_SUCCESSFUL =   1,
                     50:        OP_RESULT_ERRORED =      2,
                     51:        OP_RESULT_UNSUCCESSFUL = 3,
                     52:        OP_RESULT_ROOF         = 3
                     53: };
                     54: 
                     55: extern enum_name_t *op_result_names;
                     56: 
                     57: /**
                     58:  * Class implementing the IETF PA-TNC Operational Status attribute.
                     59:  *
                     60:  */
                     61: struct ietf_attr_op_status_t {
                     62: 
                     63:        /**
                     64:         * Public PA-TNC attribute interface
                     65:         */
                     66:        pa_tnc_attr_t pa_tnc_attribute;
                     67: 
                     68:        /**
                     69:         * Gets the Operational Status
                     70:         *
                     71:         * @return                              Operational Status
                     72:         */
                     73:        uint8_t (*get_status)(ietf_attr_op_status_t *this);
                     74: 
                     75:        /**
                     76:         * Gets the Operational Result
                     77:         *
                     78:         * @return                              Operational Result
                     79:         */
                     80:        uint8_t (*get_result)(ietf_attr_op_status_t *this);
                     81: 
                     82:        /**
                     83:         * Gets the time of last use
                     84:         *
                     85:         * @return                              Time of last use
                     86:         */
                     87:        time_t (*get_last_use)(ietf_attr_op_status_t *this);
                     88: };
                     89: 
                     90: /**
                     91:  * Creates an ietf_attr_op_status_t object
                     92:  *
                     93:  * @param status                       Operational Status
                     94:  * @param result                       Operational Result
                     95:  * @param last_use                     Time of last use
                     96:  */
                     97: pa_tnc_attr_t* ietf_attr_op_status_create(uint8_t status, uint8_t result,
                     98:                                                                                  time_t last_use);
                     99: 
                    100: /**
                    101:  * Creates an ietf_attr_op_status_t object from received data
                    102:  *
                    103:  * @param length                       Total length of attribute value
                    104:  * @param value                                Unparsed attribute value (might be a segment)
                    105:  */
                    106: pa_tnc_attr_t* ietf_attr_op_status_create_from_data(size_t length,
                    107:                                                                                                        chunk_t value);
                    108: 
                    109: #endif /** IETF_ATTR_OP_STATUS_H_ @}*/

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