libtins 4.5
Loading...
Searching...
No Matches
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 ,
  BIP_CMAC_128 = 0x06ac0f00 , GCMP_128 = 0x08ac0f00 , GCMP_256 = 0x09ac0f00 , CCMP_256 = 0x10ac0f00 ,
  BIP_GMAC_128 = 0x11ac0f00 , BIP_GMAC_256 = 0x12ac0f00 , BIP_CMAC_256 = 0x13ac0f00
}
 Enum that represents the different cypher suites.
 
enum  AKMSuites {
  EAP = 0x01ac0f00 , PSK = 0x02ac0f00 , EAP_FT = 0x03ac0f00 , PSK_FT = 0x04ac0f00 ,
  EAP_SHA256 = 0x05ac0f00 , PSK_SHA256 = 0x06ac0f00 , TDLS = 0x07ac0f00 , SAE_SHA256 = 0x08ac0f00 ,
  SAE_FT = 0x09ac0f00 , APPEERKEY = 0x10ac0f00 , EAP_SHA256_FIPSB = 0x11ac0f00 , EAP_SHA384_FIPSB = 0x12ac0f00 ,
  EAP_SHA384 = 0x13ac0f00
}
 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.
 
 RSNInformation (const serialization_type &buffer)
 Constructs an RSNInformation object from a serialization_type object.
 
 RSNInformation (const uint8_t *buffer, uint32_t total_sz)
 Constructs a RSNInformation from a buffer.
 
void add_pairwise_cypher (CypherSuites cypher)
 Adds a pairwise cypher suite.
 
void add_akm_cypher (AKMSuites akm)
 Adds an akm suite.
 
void group_suite (CypherSuites group)
 Sets the group suite cypher.
 
void version (uint16_t ver)
 Sets the version.
 
void capabilities (uint16_t cap)
 Sets the capabilities field.
 
CypherSuites group_suite () const
 Getter for the group suite field.
 
uint16_t version () const
 Getter for the version field.
 
uint16_t capabilities () const
 Getter for the capabilities field.
 
const cyphers_typepairwise_cyphers () const
 Getter for the pairwise cypher suite list.
 
const akm_typeakm_cyphers () const
 Getter for the akm suite list.
 
serialization_type serialize () const
 Serializes this object.
 

Static Public Member Functions

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

Detailed Description

Class that models the RSN information structure.

Member Typedef Documentation

◆ akm_type

The type used to store the AKM suites.

◆ cyphers_type

The type used to store the cypher suites.

◆ serialization_type

The type returned on serialization.

Constructor & Destructor Documentation

◆ RSNInformation() [1/3]

Tins::RSNInformation::RSNInformation ( )

Constructs an RSNInformation object.

By default, the version is set to 1.

◆ RSNInformation() [2/3]

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.

◆ RSNInformation() [3/3]

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

◆ add_akm_cypher()

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

Adds an akm suite.

Parameters
akmThe akm suite to be added.

◆ add_pairwise_cypher()

void Tins::RSNInformation::add_pairwise_cypher ( CypherSuites cypher)

Adds a pairwise cypher suite.

Parameters
cypherThe pairwise cypher suite to be added.

◆ akm_cyphers()

const akm_type & Tins::RSNInformation::akm_cyphers ( ) const
inline

Getter for the akm suite list.

Returns
A list of akm suites.

◆ capabilities() [1/2]

uint16_t Tins::RSNInformation::capabilities ( ) const
inline

Getter for the capabilities field.

Returns
The version field.

◆ capabilities() [2/2]

void Tins::RSNInformation::capabilities ( uint16_t cap)

Sets the capabilities field.

Parameters
capThe capabilities to be set.

◆ from_option()

RSNInformation Tins::RSNInformation::from_option ( const PDUOption< uint8_t, Dot11 > & opt)
static

Constructs an RSNInformation object from a Dot11 tagged option.

◆ group_suite() [1/2]

CypherSuites Tins::RSNInformation::group_suite ( ) const
inline

Getter for the group suite field.

Returns
The group suite field.

◆ group_suite() [2/2]

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

Sets the group suite cypher.

Parameters
groupThe group suite cypher to be set.

◆ pairwise_cyphers()

const cyphers_type & Tins::RSNInformation::pairwise_cyphers ( ) const
inline

Getter for the pairwise cypher suite list.

Returns
A list of pairwise cypher suites.

◆ serialize()

RSNInformation::serialization_type Tins::RSNInformation::serialize ( ) const

Serializes this object.

Returns
The result of the serialization.

◆ version() [1/2]

uint16_t Tins::RSNInformation::version ( ) const
inline

Getter for the version field.

Returns
The version field.

◆ version() [2/2]

void Tins::RSNInformation::version ( uint16_t ver)

Sets the version.

Parameters
verThe version to be set.

◆ wpa2_psk()

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 files: