Annotation of embedaddon/strongswan/src/libcharon/encoding/payloads/vendor_id_payload.h, revision 1.1.1.1

1.1       misho       1: /*
                      2:  * Copyright (C) 2005-2009 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 vendor_id_payload vendor_id_payload
                     19:  * @{ @ingroup payloads
                     20:  */
                     21: 
                     22: #ifndef VENDOR_ID_PAYLOAD_H_
                     23: #define VENDOR_ID_PAYLOAD_H_
                     24: 
                     25: typedef struct vendor_id_payload_t vendor_id_payload_t;
                     26: 
                     27: #include <library.h>
                     28: #include <encoding/payloads/payload.h>
                     29: 
                     30: /**
                     31:  * Class representing an IKEv1/IKEv2 VENDOR ID payload.
                     32:  *
                     33:  * The VENDOR ID payload format is described in RFC section 3.12.
                     34:  */
                     35: struct vendor_id_payload_t {
                     36: 
                     37:        /**
                     38:         * The payload_t interface.
                     39:         */
                     40:        payload_t payload_interface;
                     41: 
                     42:        /**
                     43:         * Get the VID data.
                     44:         *
                     45:         * @return              VID data, pointing to an internal chunk_t
                     46:         */
                     47:        chunk_t (*get_data)(vendor_id_payload_t *this);
                     48: 
                     49:        /**
                     50:         * Destroy Vendor ID payload.
                     51:         */
                     52:        void (*destroy)(vendor_id_payload_t *this);
                     53: };
                     54: 
                     55: /**
                     56:  * Creates an empty Vendor ID payload for IKEv1 or IKEv2.
                     57:  *
                     58:  * @@param type                PLV2_VENDOR_ID or PLV1_VENDOR_ID
                     59:  * @return                     vendor ID payload
                     60:  */
                     61: vendor_id_payload_t *vendor_id_payload_create(payload_type_t type);
                     62: 
                     63: /**
                     64:  * Creates a vendor ID payload using a chunk of data
                     65:  *
                     66:  * @param type         PLV2_VENDOR_ID or PLV1_VENDOR_ID
                     67:  * @param data         data to use in vendor ID payload, gets owned by payload
                     68:  * @return                     vendor ID payload
                     69:  */
                     70: vendor_id_payload_t *vendor_id_payload_create_data(payload_type_t type,
                     71:                                                                                                   chunk_t data);
                     72: 
                     73: #endif /** VENDOR_ID_PAYLOAD_H_ @}*/

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