strongswan/src/libcharon/encoding/payloads/id_payload.h

97 lines
2.5 KiB
C
Raw Normal View History

2005-11-29 10:02:34 +00:00
/*
2007-10-02 11:55:10 +00:00
* Copyright (C) 2007 Tobias Brunner
2006-07-07 08:49:06 +00:00
* Copyright (C) 2005-2006 Martin Willi
* Copyright (C) 2005 Jan Hutter
* HSR Hochschule fuer Technik Rapperswil
2005-11-29 10:02:34 +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.
*/
/**
* @defgroup id_payload id_payload
* @{ @ingroup payloads
*/
2005-11-29 10:02:34 +00:00
#ifndef ID_PAYLOAD_H_
#define ID_PAYLOAD_H_
2005-11-29 10:02:34 +00:00
typedef struct id_payload_t id_payload_t;
#include <library.h>
2005-12-01 19:53:48 +00:00
#include <utils/identification.h>
2005-11-29 10:02:34 +00:00
#include <encoding/payloads/payload.h>
#include <selectors/traffic_selector.h>
2005-11-29 10:02:34 +00:00
/**
* Object representing an IKEv1 or an IKEv2 ID payload.
2005-11-29 10:02:34 +00:00
*/
struct id_payload_t {
2005-11-29 10:02:34 +00:00
/**
* The payload_t interface.
*/
payload_t payload_interface;
2005-12-01 19:53:48 +00:00
/**
* Creates an identification object of this id payload.
*
* @return identification_t object
2005-12-01 19:53:48 +00:00
*/
identification_t *(*get_identification) (id_payload_t *this);
/**
* Creates a traffic selector form a ID_ADDR_SUBNET/RANGE identity.
*
* @return traffic selector, NULL on failure
*/
traffic_selector_t* (*get_ts)(id_payload_t *this);
/**
* Get encoded payload without fixed payload header (used for IKEv1).
*
* @return encoded payload (gets allocated)
*/
chunk_t (*get_encoded)(id_payload_t *this);
2005-11-29 10:02:34 +00:00
/**
* Destroys an id_payload_t object.
2005-11-29 10:02:34 +00:00
*/
void (*destroy) (id_payload_t *this);
};
/**
* Creates an empty id_payload_t object.
*
* @param type one of PLV2_ID_INITIATOR, PLV2_ID_RESPONDER, PLV1_ID and PLV1_NAT_OA
* @return id_payload_t object
2005-11-29 10:02:34 +00:00
*/
2011-12-19 09:27:40 +00:00
id_payload_t *id_payload_create(payload_type_t type);
2005-11-29 10:02:34 +00:00
2005-12-01 19:53:48 +00:00
/**
* Creates an id_payload_t from an existing identification_t object.
*
* @param type one of PLV2_ID_INITIATOR, PLV2_ID_RESPONDER, PLV1_ID and PLV1_NAT_OA
* @param id identification_t object
* @return id_payload_t object
2005-12-01 19:53:48 +00:00
*/
id_payload_t *id_payload_create_from_identification(payload_type_t type,
identification_t *id);
2005-11-29 10:02:34 +00:00
/**
* Create an IKEv1 ID_ADDR_SUBNET/RANGE identity from a traffic selector.
*
* @param ts traffic selector
Spelling fixes * accumulating * acquire * alignment * appropriate * argument * assign * attribute * authenticate * authentication * authenticator * authority * auxiliary * brackets * callback * camellia * can't * cancelability * certificate * choinyambuu * chunk * collector * collision * communicating * compares * compatibility * compressed * confidentiality * configuration * connection * consistency * constraint * construction * constructor * database * decapsulated * declaration * decrypt * derivative * destination * destroyed * details * devised * dynamic * ecapsulation * encoded * encoding * encrypted * enforcing * enumerator * establishment * excluded * exclusively * exited * expecting * expire * extension * filter * firewall * foundation * fulfillment * gateways * hashing * hashtable * heartbeats * identifier * identifiers * identities * identity * implementers * indicating * initialize * initiate * initiation * initiator * inner * instantiate * legitimate * libraries * libstrongswan * logger * malloc * manager * manually * measurement * mechanism * message * network * nonexistent * object * occurrence * optional * outgoing * packages * packets * padding * particular * passphrase * payload * periodically * policies * possible * previously * priority * proposal * protocol * provide * provider * pseudo * pseudonym * public * qualifier * quantum * quintuplets * reached * reading * recommendation to * recommendation * recursive * reestablish * referencing * registered * rekeying * reliable * replacing * representing * represents * request * request * resolver * result * resulting * resynchronization * retriable * revocation * right * rollback * rule * rules * runtime * scenario * scheduled * security * segment * service * setting * signature * specific * specified * speed * started * steffen * strongswan * subjectaltname * supported * threadsafe * traffic * tremendously * treshold * unique * uniqueness * unknown * until * upper * using * validator * verification * version * version * warrior Closes strongswan/strongswan#164.
2020-02-05 04:30:52 +00:00
* @return PLV1_ID id_payload_t object.
*/
id_payload_t *id_payload_create_from_ts(traffic_selector_t *ts);
#endif /** ID_PAYLOAD_H_ @}*/