2005-12-05 14:01:56 +00:00
|
|
|
/*
|
2009-11-09 11:38:48 +00:00
|
|
|
* Copyright (C) 2005-2009 Martin Willi
|
2006-07-07 08:49:06 +00:00
|
|
|
* Copyright (C) 2005 Jan Hutter
|
2018-05-23 14:04:50 +00:00
|
|
|
* HSR Hochschule fuer Technik Rapperswil
|
2005-12-05 14:01:56 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
2008-03-13 14:14:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup vendor_id_payload vendor_id_payload
|
|
|
|
* @{ @ingroup payloads
|
2005-12-05 14:01:56 +00:00
|
|
|
*/
|
|
|
|
|
2006-03-16 15:25:06 +00:00
|
|
|
#ifndef VENDOR_ID_PAYLOAD_H_
|
|
|
|
#define VENDOR_ID_PAYLOAD_H_
|
2005-12-05 14:01:56 +00:00
|
|
|
|
2006-10-30 14:07:05 +00:00
|
|
|
typedef struct vendor_id_payload_t vendor_id_payload_t;
|
|
|
|
|
2006-10-31 12:27:59 +00:00
|
|
|
#include <library.h>
|
2005-12-05 14:01:56 +00:00
|
|
|
#include <encoding/payloads/payload.h>
|
|
|
|
|
|
|
|
/**
|
2011-11-15 14:58:47 +00:00
|
|
|
* Class representing an IKEv1/IKEv2 VENDOR ID payload.
|
2006-10-30 14:07:05 +00:00
|
|
|
*
|
2006-03-07 09:42:15 +00:00
|
|
|
* The VENDOR ID payload format is described in RFC section 3.12.
|
2005-12-05 14:01:56 +00:00
|
|
|
*/
|
|
|
|
struct vendor_id_payload_t {
|
2009-11-09 11:38:48 +00:00
|
|
|
|
2005-12-05 14:01:56 +00:00
|
|
|
/**
|
|
|
|
* The payload_t interface.
|
|
|
|
*/
|
|
|
|
payload_t payload_interface;
|
|
|
|
|
|
|
|
/**
|
2008-03-13 14:14:44 +00:00
|
|
|
* Get the VID data.
|
2009-09-04 11:46:09 +00:00
|
|
|
*
|
2009-11-09 11:38:48 +00:00
|
|
|
* @return VID data, pointing to an internal chunk_t
|
2005-12-05 14:01:56 +00:00
|
|
|
*/
|
2009-11-09 11:38:48 +00:00
|
|
|
chunk_t (*get_data)(vendor_id_payload_t *this);
|
2010-11-24 13:42:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroy Vendor ID payload.
|
|
|
|
*/
|
|
|
|
void (*destroy)(vendor_id_payload_t *this);
|
2005-12-05 14:01:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2011-11-15 14:58:47 +00:00
|
|
|
* Creates an empty Vendor ID payload for IKEv1 or IKEv2.
|
2009-11-09 11:38:48 +00:00
|
|
|
*
|
2013-10-29 09:09:39 +00:00
|
|
|
* @@param type PLV2_VENDOR_ID or PLV1_VENDOR_ID
|
2009-11-09 11:38:48 +00:00
|
|
|
* @return vendor ID payload
|
|
|
|
*/
|
2011-11-15 14:58:47 +00:00
|
|
|
vendor_id_payload_t *vendor_id_payload_create(payload_type_t type);
|
2009-11-09 11:38:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a vendor ID payload using a chunk of data
|
2009-09-04 11:46:09 +00:00
|
|
|
*
|
2013-10-29 09:09:39 +00:00
|
|
|
* @param type PLV2_VENDOR_ID or PLV1_VENDOR_ID
|
2009-11-09 11:38:48 +00:00
|
|
|
* @param data data to use in vendor ID payload, gets owned by payload
|
|
|
|
* @return vendor ID payload
|
2005-12-05 14:01:56 +00:00
|
|
|
*/
|
2011-11-15 14:58:47 +00:00
|
|
|
vendor_id_payload_t *vendor_id_payload_create_data(payload_type_t type,
|
|
|
|
chunk_t data);
|
2005-12-05 14:01:56 +00:00
|
|
|
|
2009-03-24 17:43:01 +00:00
|
|
|
#endif /** VENDOR_ID_PAYLOAD_H_ @}*/
|