Annotation of embedaddon/strongswan/src/libimcv/generic/generic_attr_chunk.h, revision 1.1.1.1

1.1       misho       1: /*
                      2:  * Copyright (C) 2015 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 generic_attr_chunk generic_attr_chunk
                     18:  * @{ @ingroup generic_attr
                     19:  */
                     20: 
                     21: #ifndef GENERIC_ATTR_CHUNK_H_
                     22: #define GENERIC_ATTR_CHUNK_H_
                     23: 
                     24: typedef struct generic_attr_chunk_t generic_attr_chunk_t;
                     25: 
                     26: #include <pen/pen.h>
                     27: #include "pa_tnc/pa_tnc_attr.h"
                     28: 
                     29: /**
                     30:  * Class implementing a generic PA-TNC attribute containing a possibly
                     31:  * binary string with either a fixed or variable size
                     32:  */
                     33: struct generic_attr_chunk_t {
                     34: 
                     35:        /**
                     36:         * Public PA-TNC attribute interface
                     37:         */
                     38:        pa_tnc_attr_t pa_tnc_attribute;
                     39: };
                     40: 
                     41: /**
                     42:  * Creates a generic_attr_chunk_t object
                     43:  *
                     44:  * @param string                       Non-nul terminated string
                     45:  * @param type                         Vendor ID / Attribute Type
                     46:  */
                     47: pa_tnc_attr_t* generic_attr_chunk_create(chunk_t string, pen_type_t type);
                     48: 
                     49: /**
                     50:  * Creates an generic_attr_chunk_t object from received data
                     51:  *
                     52:  * @param length                       Total length of attribute value
                     53:  * @param value                                Unparsed attribute value (might be a segment)
                     54:  * @param size                         size in bytes if fixed array or 0 if dynamic size
                     55:  * @param type                         Vendor ID / Attribute Type
                     56:  */
                     57: pa_tnc_attr_t* generic_attr_chunk_create_from_data(size_t length, chunk_t value,
                     58:                                                                                                   size_t size, pen_type_t type);
                     59: 
                     60: #endif /** GENERIC_ATTR_CHUNK_H_ @}*/

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