Protocol++® (Protocolpp®)  v5.6.2
ProtocolPP::jwifisa Class Reference
Inheritance diagram for ProtocolPP::jwifisa:
Collaboration diagram for ProtocolPP::jwifisa:

Public Member Functions

 jwifisa ()
 
 jwifisa (direction_t dir, protocol_t mode, cipher_t cipher, auth_t auth, auth_t kdfalg, uint64_t addr1, uint64_t addr2, uint64_t addr3, uint64_t addr4, uint64_t pn, uint16_t framectl, wifictlext_t ctlext, uint16_t id, uint16_t seqctl, uint16_t qosctl, uint32_t htctl, uint8_t keyid, uint32_t icvlen, uint32_t ckeylen, std::shared_ptr< jarray< uint8_t >> cipherkey, uint32_t arlen, jarray< uint8_t > arwin, bool extiv, bool fcs, bool sppcap)
 
 jwifisa (jwifisa &rhs)
 
 jwifisa (std::shared_ptr< jwifisa > &rhs)
 
 ~jwifisa ()
 Standard deconstructor.
 
template<typename T >
void set_field (field_t field, T fieldval)
 
template<typename T >
get_field (field_t field)
 
void to_xml (tinyxml2::XMLPrinter &myxml, direction_t direction)
 
void to_json (std::ofstream &myjson, direction_t direction, std::string &indent)
 
 jwifisa (const jwifisa &rhs)=delete
 
- Public Member Functions inherited from ProtocolPP::jsecass
 jsecass ()
 
virtual ~jsecass ()=default
 Standard deconstructor.
 
 jsecass (jsecass &jsecass)=delete
 
 jsecass (const jsecass &jsecass)=delete
 

Constructor & Destructor Documentation

◆ jwifisa() [1/4]

ProtocolPP::jwifisa::jwifisa ( )

Standard constructor with default settings

WIFI/WIGIG Defaults
fieldDefault Value
dirdirection_t::ENCAP
modeprotocol_t::WIFI (or WIGIG)
ciphercipher_t::AES_CCM
authcipher_t::NULL_AUTH
kdfalgauth_t::SHA256
addr10
addr20
addr30
addr40
pn0
framectl0
ctlext0
id0
seqctl0
qosctl0
htctl0
keyid0
icvlen8
ckeylen16
arlen0
arwin0
extivtrue
fcstrue
sppcapfalse
cipherkey0

◆ jwifisa() [2/4]

ProtocolPP::jwifisa::jwifisa ( direction_t  dir,
protocol_t  mode,
cipher_t  cipher,
auth_t  auth,
auth_t  kdfalg,
uint64_t  addr1,
uint64_t  addr2,
uint64_t  addr3,
uint64_t  addr4,
uint64_t  pn,
uint16_t  framectl,
wifictlext_t  ctlext,
uint16_t  id,
uint16_t  seqctl,
uint16_t  qosctl,
uint32_t  htctl,
uint8_t  keyid,
uint32_t  icvlen,
uint32_t  ckeylen,
std::shared_ptr< jarray< uint8_t >>  cipherkey,
uint32_t  arlen,
jarray< uint8_t >  arwin,
bool  extiv,
bool  fcs,
bool  sppcap 
)

Security Association for Wifi/WiGig

Parameters
dir- Direction of processing (ENCAP or DECAP)
mode- Protocol (either WIFI or WIGIG)
cipher- Mode of encryption (AES_GCM, AES_CCM, SM4_GCM, SM4_CCM, NULL_CIPHER)
auth- Mode of authentication (AES_CMAC, AES_GMAC, NULL_AUTH)
kdfalg- Key derivation function (KDF) algorithm (SHA1, SHA256, SHA384, SHA512)
addr1- First address
addr2- Second address
addr3- Third address
addr4- Fourth address
pn- Six byte packet number
framectl- Frame control sequence
ctlext- Control frame extension
id- Duration Identification
seqctl- Sequence control
qosctl- Quality of Service (QoS) control
htctl- High Traffic (HT) control
keyid- Key identification field
icvlen- length of the ICV
ckeylen- length of the key
cipherkey- Key for the encryption algorithm
arlen- Number of packets to track with replay window
arwin- Anti-replay window for tracking packets
extiv- Extended IV (always present for CCMP)
fcs- Enables CRC-32 for the packet
sppcap- SPP A-MSDU Capable field

◆ jwifisa() [3/4]

ProtocolPP::jwifisa::jwifisa ( jwifisa rhs)

Constructor for Wifi

Parameters
rhs- Security association (SA) for this Wifi flow

◆ jwifisa() [4/4]

ProtocolPP::jwifisa::jwifisa ( std::shared_ptr< jwifisa > &  rhs)
explicit

Constructor for Wifi

Parameters
rhs- Security association (SA) for this Wifi flow

Member Function Documentation

◆ get_field()

template<typename T >
T ProtocolPP::jwifisa::get_field ( field_t  field)

Retrieve the field from the Wifi security association

WifiSA Get Fields
field typefield nameExample
direction_tDIRECTIONdirection_t tmp = get_field<direction_t>(field_t::DIRECTION)
protocol_tMODEprotocol_t tmp = get_field<protocol_t>(field_t::MODE)
cipher_tCIPHERcipher_t tmp = get_field<cipher_t>(field_t::CIPHER)
auth_tKDFALGauth_t tmp = get_field<auth_t>(field_t::KDFALG)
AUTHauth_t tmp = get_field<auth_t>(field_t::AUTH)
wifictlext_tCTLEXTwifictlext_t tmp = get_field<wifictlext_t>(field_t::CTLEXT)
boolEXTIVbool tmp = get_field<bool>(field_t::EXTIV)
FCSbool tmp = get_field<bool>(field_t::FCS)
SPPCAPbool tmp = get_field<bool>(field_t::COUNT)
uint8_tKEYIDuint8_t tmp = get_field<uint8_t>(field_t::KEYID)
uint16_tFRAMECTLuint16_t tmp = get_field<uint8_t>(field_t::FRAMECTL)
IDuint16_t tmp = get_field<uint8_t>(field_t::ID)
SEQCTLuint16_t tmp = get_field<uint8_t>(field_t::SEQCTL)
QOSCTLuint16_t tmp = get_field<uint8_t>(field_t::QOSCTL)
uint32_tHTCTLuint32_t tmp = get_field<uint32_t>(field_t::HTCTL)
ICVLENuint32_t tmp = get_field<uint32_t>(field_t::ICVLEN)
CKEYLENuint32_t tmp = get_field<uint32_t>(field_t::CKEYLEN)
ARLENuint32_t tmp = get_field<uint32_t>(field_t::ARLEN)
uint64_tADDR1uint64_t tmp = get_field<uint64_t>(field_t::ADDR1)
ADDR2uint64_t tmp = get_field<uint64_t>(field_t::ADDR2)
ADDR3uint64_t tmp = get_field<uint64_t>(field_t::ADDR3)
ADDR4uint64_t tmp = get_field<uint64_t>(field_t::ADDR4)
PNuint64_t tmp = get_field<uint64_t>(field_t::PN)
jarray<uint8_t>ARWINjarray<uint8_t> tmp = get_field<jarray<uint8_t>>(field_t::ARWIN)
CIPHERKEYjarray<uint8_t> tmp = get_field<jarray<uint8_t>>(field_t::CIPHERKEY)
std::shared_ptr<jarray<uint8_t>>ARWINstd::shared_ptr<jarray<uint8_t>> tmp = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::ARWIN)
CIPHERKEYstd::shared_ptr<jarray<uint8_t>> tmp = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CIPHERKEY)
Parameters
field- field to retrieve
Returns
field value

◆ set_field()

template<typename T >
void ProtocolPP::jwifisa::set_field ( field_t  field,
fieldval 
)

Update Wifi field with the new value

Wifisa Set Fields
field typefield nameExample
direction_tDIRECTIONset_field<direction_t>(field_t::DIRECTION, direction_t::ENC)
protocol_tMODEset_field<protocol_t>(field_t::MODE, protocol_t::WIGIG)
cipher_tCIPHERset_field<cipher_t>(field_t::CIPHER, cipher_t::AES_CCM)
auth_tKDFALGset_field<auth_t>(field_t::KDFALG, auth_t::SHA384)
AUTHset_field<auth_t>(field_t::AUTH, auth_t::SHA256)
wifictlext_tCTLEXTset_field<wifictlext_t>(field_t::CTLEXT, wifictlext_t::POLL)
boolEXTIVset_field<bool>(field_t::EXTIV, true)
FCSset_field<bool>(field_t::FCS, false)
SPPCAPset_field<bool>(field_t::COUNT, true)
uint8_tKEYIDset_field<uint8_t>(field_t::KEYID, 5)
uint16_tFRAMECTLset_field<uint8_t>(field_t::FRAMECTL, 0x1100)
IDset_field<uint8_t>(field_t::ID, 0x1355)
SEQCTLset_field<uint8_t>(field_t::SEQCTL, 0x0811)
QOSCTLset_field<uint8_t>(field_t::QOSCTL, 0x1FC0)
uint32_tHTCTLset_field<uint32_t>(field_t::HTCTL, 8)
ICVLENset_field<uint32_t>(field_t::ICVLEN, 12)
CKEYLENset_field<uint32_t>(field_t::CKEYLEN, 16)
ARLENset_field<uint32_t>(field_t::ARLEN, 1024)
uint64_tADDR1set_field<uint64_t>(field_t::ADDR1, 0x0102030405060708)
ADDR1set_field<uint64_t>(field_t::ADDR1, 0x2102030405060708)
ADDR1set_field<uint64_t>(field_t::ADDR1, 0x3102030405060708)
ADDR1set_field<uint64_t>(field_t::ADDR1, 0x4102030405060708)
PNset_field<uint64_t>(field_t::PN, 0x1102034405067708)
jarray<uint8_t>ARWINset_field<jarray<uint8_t>>(field_t::ARWIN, myarwin)
CIPHERKEYset_field<jarray<uint8_t>>(field_t::CIPHERKEY, mykey)
std::shared_ptr<jarray<uint8_t>>ARWINset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::ARWIN, myarwinptr)
CIPHERKEYset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CIPHERKEY, mykeyptr)
Parameters
field- field to update
fieldval- new value for the field

◆ to_json()

void ProtocolPP::jwifisa::to_json ( std::ofstream &  myjson,
direction_t  direction,
std::string &  indent 
)
virtual

Print the protocol and security objects to JSON

Parameters
myjson- JSON object to print with
direction- facilitator for random generation
indent- indentation for JSON output

Implements ProtocolPP::jsecass.

◆ to_xml()

void ProtocolPP::jwifisa::to_xml ( tinyxml2::XMLPrinter myxml,
direction_t  direction 
)
virtual

Print the protocol and security objects to XML

Parameters
myxml- XMLPrinter object to print with
direction- facilitator for random generation

Implements ProtocolPP::jsecass.


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