libtins  3.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Tins::RSNInformation Class Reference

Class that models the RSN information structure. More...

#include <rsn_information.h>

Public Types

enum  CypherSuites { WEP_40 = 0x01ac0f00, TKIP = 0x02ac0f00, CCMP = 0x04ac0f00, WEP_104 = 0x05ac0f00 }
 Enum that represents the different cypher suites.
 
enum  AKMSuites { PMKSA = 0x01ac0f00, PSK = 0x02ac0f00 }
 Enum that represents the different akm suites.
 
typedef std::vector< CypherSuitescyphers_type
 
typedef std::vector< AKMSuitesakm_type
 
typedef std::vector< uint8_t > serialization_type
 

Public Member Functions

 RSNInformation ()
 Constructs an RSNInformation object. More...
 
 RSNInformation (const serialization_type &buffer)
 Constructs an RSNInformation object from a serialization_type object. More...
 
 RSNInformation (const uint8_t *buffer, uint32_t total_sz)
 Constructs a RSNInformation from a buffer. More...
 
void add_pairwise_cypher (CypherSuites cypher)
 Adds a pairwise cypher suite. More...
 
void add_akm_cypher (AKMSuites akm)
 Adds an akm suite. More...
 
void group_suite (CypherSuites group)
 Sets the group suite cypher. More...
 
void version (uint16_t ver)
 Sets the version. More...
 
void capabilities (uint16_t cap)
 Sets the capabilities field. More...
 
CypherSuites group_suite () const
 Getter for the group suite field. More...
 
uint16_t version () const
 Getter for the version field. More...
 
uint16_t capabilities () const
 Getter for the capabilities field. More...
 
const cyphers_typepairwise_cyphers () const
 Getter for the pairwise cypher suite list. More...
 
const akm_typeakm_cyphers () const
 Getter for the akm suite list. More...
 
serialization_type serialize () const
 Serializes this object. More...
 

Static Public Member Functions

static RSNInformation wpa2_psk ()
 Helper function to create a WPA2-PSK RSNInformation. More...
 
static RSNInformation from_option (const PDUOption< uint8_t, Dot11 > &opt)
 

Detailed Description

Class that models the RSN information structure.

Member Typedef Documentation

The type used to store the AKM suites.

The type used to store the cypher suites.

typedef std::vector<uint8_t> Tins::RSNInformation::serialization_type

The type returned on serialization.

Constructor & Destructor Documentation

Tins::RSNInformation::RSNInformation ( )

Constructs an RSNInformation object.

By default, the version is set to 1.

Tins::RSNInformation::RSNInformation ( const serialization_type buffer)

Constructs an RSNInformation object from a serialization_type object.

Parameters
bufferThe buffer from which to construct this object.
Tins::RSNInformation::RSNInformation ( const uint8_t *  buffer,
uint32_t  total_sz 
)

Constructs a RSNInformation from a buffer.

If the input is malformed, a malformed_packet exception is thrown.

Parameters
bufferThe buffer from which this object will be constructed.
total_szThe total size of the buffer.

Member Function Documentation

void Tins::RSNInformation::add_akm_cypher ( AKMSuites  akm)

Adds an akm suite.

Parameters
akmThe akm suite to be added.
void Tins::RSNInformation::add_pairwise_cypher ( CypherSuites  cypher)

Adds a pairwise cypher suite.

Parameters
cypherThe pairwise cypher suite to be added.
const akm_type& Tins::RSNInformation::akm_cyphers ( ) const
inline

Getter for the akm suite list.

Returns
A list of akm suites.
void Tins::RSNInformation::capabilities ( uint16_t  cap)

Sets the capabilities field.

Parameters
capThe capabilities to be set.
uint16_t Tins::RSNInformation::capabilities ( ) const
inline

Getter for the capabilities field.

Returns
The version field.
static RSNInformation Tins::RSNInformation::from_option ( const PDUOption< uint8_t, Dot11 > &  opt)
static

Constructs an RSNInformation object from a Dot11 tagged option.

void Tins::RSNInformation::group_suite ( CypherSuites  group)

Sets the group suite cypher.

Parameters
groupThe group suite cypher to be set.
CypherSuites Tins::RSNInformation::group_suite ( ) const
inline

Getter for the group suite field.

Returns
The group suite field.
const cyphers_type& Tins::RSNInformation::pairwise_cyphers ( ) const
inline

Getter for the pairwise cypher suite list.

Returns
A list of pairwise cypher suites.
serialization_type Tins::RSNInformation::serialize ( ) const

Serializes this object.

Returns
The result of the serialization.
void Tins::RSNInformation::version ( uint16_t  ver)

Sets the version.

Parameters
verThe version to be set.
uint16_t Tins::RSNInformation::version ( ) const
inline

Getter for the version field.

Returns
The version field.
static RSNInformation Tins::RSNInformation::wpa2_psk ( )
static

Helper function to create a WPA2-PSK RSNInformation.

Returns
An instance RSNInformation which contains information for a WPA2-PSK AP.

The documentation for this class was generated from the following file: