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

95 lines
2.4 KiB
C
Raw Normal View History

2012-12-12 17:16:58 +00:00
/*
* Copyright (C) 2012 Tobias Brunner
* HSR Hochschule fuer Technik Rapperswil
2012-12-12 17:16:58 +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 fragment_payload fragment_payload
* @{ @ingroup payloads
*/
#ifndef FRAGMENT_PAYLOAD_H_
#define FRAGMENT_PAYLOAD_H_
typedef struct fragment_payload_t fragment_payload_t;
#include <library.h>
#include <encoding/payloads/payload.h>
/**
* Object representing an IKEv1 fragment payload.
*/
struct fragment_payload_t {
/**
* The payload_t interface.
*/
payload_t payload_interface;
/**
* Get the fragment ID. Identifies the fragments for a particular IKE
* message.
*
* @return fragment ID
*/
2016-03-22 12:22:01 +00:00
uint16_t (*get_id)(fragment_payload_t *this);
2012-12-12 17:16:58 +00:00
/**
* Get the fragment number. Defines the order of the fragments.
*
* @return fragment number
*/
2016-03-22 12:22:01 +00:00
uint8_t (*get_number)(fragment_payload_t *this);
2012-12-12 17:16:58 +00:00
/**
* Check if this is the last fragment.
*
* @return TRUE if this is the last fragment
*/
bool (*is_last)(fragment_payload_t *this);
/**
* Get the fragment data.
*
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 chunk to internal fragment data
2012-12-12 17:16:58 +00:00
*/
chunk_t (*get_data)(fragment_payload_t *this);
/**
* Destroys an fragment_payload_t object.
*/
void (*destroy)(fragment_payload_t *this);
};
/**
* Creates an empty fragment_payload_t object.
*
* @return fragment_payload_t object
*/
fragment_payload_t *fragment_payload_create();
/**
* Creates a fragment payload from the given data. All fragments currently
* have the same fragment ID (1), which seems what other implementations are
* doing.
*
* @param num fragment number (first one should be 1)
* @param last TRUE to indicate that this is the last fragment
* @param data fragment data (gets cloned)
* @return fragment_payload_t object
*/
2016-03-22 12:22:01 +00:00
fragment_payload_t *fragment_payload_create_from_data(uint8_t num, bool last,
chunk_t data);
2012-12-12 17:16:58 +00:00
#endif /** FRAGMENT_PAYLOAD_H_ @}*/