openikev2::Proposal Class Reference

This class represents a Proposal, used in a cryptographic suite negociation. More...

#include <proposal.h>

Inheritance diagram for openikev2::Proposal:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Proposal (Enums::PROTOCOL_ID protocol_id)
 Creates a new Proposal.
 Proposal (ByteBuffer &byte_buffer)
 Creates a new Proposal based on its binary representation.
virtual auto_ptr< Proposalclone () const
 Creates a new Proposal clonning this one.
virtual void addTransform (auto_ptr< Transform > transform)
 Adds a Transform to the Proposal object.
virtual TransformgetFirstTransformByType (Enums::TRANSFORM_TYPE type) const
 Gets the first Transform with indicated type from the Proposal.
virtual bool hasTransform (const Transform &transform) const
 Indicates if the Proposal has the indicated Transform.
virtual bool hasTheSameTransformTypes (const Proposal &other) const
 Indicates if the Proposals has the same transform types than other.
virtual void deleteTransformsByType (Enums::TRANSFORM_TYPE type)
 Detele all the transforms with the specified type.
virtual void setIkeSpi (uint64_t spi)
 Sets the SPI value when the protocol is IKE.
virtual void setIpsecSpi (uint32_t spi)
 Sets the SPI value when the protocol is AH or ESP.
virtual uint64_t getIkeSpi ()
 Gets the SPI value when the protocol is IKE.
virtual uint32_t getIpsecSpi ()
 Gets the SPI value when the protocol is AH or ESP.
virtual void getBinaryRepresentation (ByteBuffer &byte_buffer) const
 Appends the binary representation of the Proposal in the ByteBuffer.
virtual string toStringTab (uint8_t tabs) const
 Construct a textual representation of the object, preceded of a num of tabs of size TAB_SIZE.

Static Public Member Functions

static auto_ptr< Proposalintersection (const Proposal &proposal1, const Proposal &proposal2)
 Calculates the intersection between two proposals.

Public Attributes

AutoVector< Transformtransforms
 Transform collection.
auto_ptr< ByteArrayspi
 SPI value.
Enums::PROTOCOL_ID protocol_id
 Protocol id.
uint8_t proposal_number
 Number of the proposal.

Detailed Description

This class represents a Proposal, used in a cryptographic suite negociation.

Author:
Pedro J. Fernandez Ruiz, Alejandro Perez Mendez <pedroj.fernandez@dif.um.es, alejandro_perez@dif.um.es>


Constructor & Destructor Documentation

openikev2::Proposal::Proposal ( Enums::PROTOCOL_ID  protocol_id  ) 

Creates a new Proposal.

The SPI will be 0 length until it was assigned

Parameters:
protocol_id Protocol id

openikev2::Proposal::Proposal ( ByteBuffer byte_buffer  ) 

Creates a new Proposal based on its binary representation.

Parameters:
byte_buffer Buffer with its read pointer at the "proposal length" field


Member Function Documentation

auto_ptr< Proposal > openikev2::Proposal::clone (  )  const [virtual]

Creates a new Proposal clonning this one.

Returns:
New clonned protocol

void openikev2::Proposal::addTransform ( auto_ptr< Transform transform  )  [virtual]

Adds a Transform to the Proposal object.

Parameters:
transform Transform to be added.

Transform * openikev2::Proposal::getFirstTransformByType ( Enums::TRANSFORM_TYPE  type  )  const [virtual]

Gets the first Transform with indicated type from the Proposal.

Parameters:
type Transform type.
Returns:
Transform with indicated type. NULL if it isn't found.

bool openikev2::Proposal::hasTransform ( const Transform transform  )  const [virtual]

Indicates if the Proposal has the indicated Transform.

Parameters:
transform Searched transform
Returns:
TRUE if the Proposal has the Transform. FALSE otherwise

bool openikev2::Proposal::hasTheSameTransformTypes ( const Proposal other  )  const [virtual]

Indicates if the Proposals has the same transform types than other.

Parameters:
other Other proposal
Returns:
TRUE if both have the same transform types. FALSE otherwise

void openikev2::Proposal::deleteTransformsByType ( Enums::TRANSFORM_TYPE  type  )  [virtual]

Detele all the transforms with the specified type.

Parameters:
type Transform type.

void openikev2::Proposal::setIkeSpi ( uint64_t  spi  )  [virtual]

Sets the SPI value when the protocol is IKE.

Parameters:
spi SPI value for the IKE protocol (in network order)

void openikev2::Proposal::setIpsecSpi ( uint32_t  spi  )  [virtual]

Sets the SPI value when the protocol is AH or ESP.

Parameters:
spi SPI value for the IPsec protocol (in network order)

uint64_t openikev2::Proposal::getIkeSpi (  )  [virtual]

Gets the SPI value when the protocol is IKE.

Returns:
SPI value (in network order)

uint32_t openikev2::Proposal::getIpsecSpi (  )  [virtual]

Gets the SPI value when the protocol is AH or ESP.

Returns:
SPI value (in network order)

auto_ptr< Proposal > openikev2::Proposal::intersection ( const Proposal proposal1,
const Proposal proposal2 
) [static]

Calculates the intersection between two proposals.

The order will be the same as in the proposal1 The protocol_id and the SPI will be the same of proposal1.

Parameters:
proposal1 One Proposal
proposal2 Other Proposal
Returns:
The insertection Proposal

void openikev2::Proposal::getBinaryRepresentation ( ByteBuffer byte_buffer  )  const [virtual]

Appends the binary representation of the Proposal in the ByteBuffer.

Parameters:
byte_buffer ByteBuffer where append the binary representation

string openikev2::Proposal::toStringTab ( uint8_t  tabs  )  const [virtual]

Construct a textual representation of the object, preceded of a num of tabs of size TAB_SIZE.

Parameters:
tabs Num of tabs preceding the textual representation.
Returns:
Textual tabulated represetation of the object.

Implements openikev2::Printable.


Generated on Fri Jul 27 11:04:56 2007 for libopenikev2 by  doxygen 1.5.1