|
Protocol++® (Protocolpp®)
v5.7.0
|


Public Member Functions | |
| jmacsecsa () | |
| jmacsecsa (direction_t dir, macsecmode_t mode, bool fcs, bool usext, bool enreceive, bool entransmit, bool protectframes, uint8_t tcian, uint8_t sl, uint16_t ethtype, uint32_t vlantag1, uint32_t vlantag2, uint32_t pn, uint32_t xpn, uint32_t ssci, uint32_t arlen, uint32_t icvlen, uint32_t keylen, uint64_t src, uint64_t dst, uint64_t sci, jarray< uint8_t > arwin, std::shared_ptr< jarray< uint8_t >> sakey, std::shared_ptr< jarray< uint8_t >> salt) | |
| jmacsecsa (jmacsecsa &rhs) | |
| jmacsecsa (std::shared_ptr< jmacsecsa > &rhs) | |
| ~jmacsecsa () | |
| Standard deconstructor. | |
| template<typename T > | |
| void | set_field (field_t field, T fieldval) |
| template<typename T > | |
| 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) |
| jmacsecsa (const jmacsecsa &rhs)=delete | |
Public Member Functions inherited from ProtocolPP::jsecass | |
| jsecass () | |
| virtual | ~jsecass ()=default |
| Standard deconstructor. | |
| jsecass (jsecass &jsecass)=delete | |
| jsecass (const jsecass &jsecass)=delete | |
| ProtocolPP::jmacsecsa::jmacsecsa | ( | ) |
Standard Constructor with defaults
| field | Default Value |
|---|---|
| dir | direction_t::ENCAP |
| mode | macsecmode_t::AES_GCM_128 |
| fcs | false |
| usext | false |
| enreceive | false |
| entransmit | false |
| protectframes | true |
| tcian | 0 |
| sl | 0 |
| ethtype | 0x88E5 |
| vlantag1 | 0 |
| vlantag2 | 0 |
| pn | 0 |
| xpn | 0 |
| ssci | 0 |
| icvlen | 16 |
| keylen | 16 |
| src | 0 |
| dst | 0 |
| sci | 0 |
| arlen | 0 |
| arwin | 0 |
| ProtocolPP::jmacsecsa::jmacsecsa | ( | direction_t | dir, |
| macsecmode_t | mode, | ||
| bool | fcs, | ||
| bool | usext, | ||
| bool | enreceive, | ||
| bool | entransmit, | ||
| bool | protectframes, | ||
| uint8_t | tcian, | ||
| uint8_t | sl, | ||
| uint16_t | ethtype, | ||
| uint32_t | vlantag1, | ||
| uint32_t | vlantag2, | ||
| uint32_t | pn, | ||
| uint32_t | xpn, | ||
| uint32_t | ssci, | ||
| uint32_t | arlen, | ||
| uint32_t | icvlen, | ||
| uint32_t | keylen, | ||
| uint64_t | src, | ||
| uint64_t | dst, | ||
| uint64_t | sci, | ||
| jarray< uint8_t > | arwin, | ||
| std::shared_ptr< jarray< uint8_t >> | sakey, | ||
| std::shared_ptr< jarray< uint8_t >> | salt | ||
| ) |
Security Association for MacSec
| dir | - Direction for processing (ENCAP or DECAP) |
| mode | - Mode for MACSEC (AES-GCM with 128-bit or 256-bit key with or without extended packet number) |
| fcs | - Calculate the CRC-IEEE over the packet and add to packet (ENCAP) or verify (DECAP) |
| usext | - use extended sequence number |
| enreceive | - SA receiving frames |
| entransmit | - SA transmitting frames |
| protectframes | - SA protecting frames |
| tcian | - TAG control information |
| sl | - short length parameter |
| ethtype | - ethernet type |
| vlantag1 | - customer virtual LAN tag (CVLAN), service virtual LAN tag (SVLAN), or service instance virtual LAN tag (IVLAN) |
| vlantag2 | - customer virtual LAN tag (CVLAN), service virtual LAN tag (SVLAN), or service instance virtual LAN tag (IVLAN) |
| pn | - packet number this Phy is generating/receiving |
| xpn | - if extended packet numbers are used, upper half of the PN |
| ssci | - short security control index (for extended packet number) |
| arlen | - Number of packets to track in the replay window |
| icvlen | - length of the ICV. Default is 16 |
| keylen | - length of the key (either 16 or 32 bytes) |
| src | - source address for the stream |
| dst | - destination address for the stream |
| sci | - security control index (64-bits) |
| arwin | - Anti-replay window to track packets |
| sakey | - AES-GCM key for integrity of user data |
| salt | - salt to XOR with SSCI, XPN, and PN when using extended packet numbers |
| ProtocolPP::jmacsecsa::jmacsecsa | ( | jmacsecsa & | rhs | ) |
Create an instance of the macsec protocol. Use update_sec to create the security association
| rhs | - security association for this flow |
|
explicit |
Create an instance of the macsec protocol. Use update_sec to create the security association
| rhs | - security association for this flow |
| T ProtocolPP::jmacsecsa::get_field | ( | field_t | field | ) |
Return the macsec field
| field type | field name | Example |
|---|---|---|
| direction_t | DIRECTION | direction_t mydir = get_field<direction_t>(field_t::DIRECTION) |
| macsecmode_t | MODE | macsecmode_t mymode = get_field<macsecmode_t>(field_t::MODE) |
| bool | FCS | bool myfcs = get_field<bool>(field_t::FCS) |
| bool | USEXT | bool myusext = get_field<bool>(field_t::USEXT) |
| uint8_t | TCIAN | uint8_t mytcian = get_field<uint8_t>(field_t::TCIAN) |
| SL | uint8_t mysl = get_field<uint8_t>(field_t::SL) | |
| uint16_t | ETHERTYPE | uint16_t myethtype = get_field<uint16_t>(field_t::ETHERTYPE) |
| uint32_t | VLANTAG1 | uint32_t cvlantag = get_field<uint32_t>(field_t::VLANTAG1) |
| uint32_t | VLANTAG2 | uint32_t svlantag = get_field<uint32_t>(field_t::VLANTAG2) |
| uint32_t | PN | uint32_t mypn = get_field<uint32_t>(field_t::PN) |
| XPN | uint32_t myxpn = get_field<uint32_t>(field_t::XPN) | |
| SSCI | uint32_t myssci = get_field<uint32_t>(field_t::SSCI) | |
| ARLEN | uint32_t myarlen = get_field<uint32_t>(field_t::ARLEN) | |
| ICVLEN | uint32_t myicvlen = get_field<uint32_t>(field_t::ICVLEN) | |
| KEYLEN | uint32_t mykeylen = get_field<uint32_t>(field_t::KEYLEN) | |
| uint64_t | SOURCE | uint64_t mysrc = get_field<uint64_t>(field_t::SOURCE) |
| DESTINATION | uint64_t mydst = get_field<uint64_t>(field_t::DESTINATION) | |
| jarray<uint8_t | ARWIN | jarray<uint8_t> myarwin = get_field<jarray<uint8_t>>(field_t::ARWIN) |
| std::shared_ptr<jarray<uint8_t>> | SAKEY | std::shared_ptr<jarray<uint8_t>> mysakey = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::SAKEY) |
| SALT | std::shared_ptr<jarray<uint8_t>> mysalt = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::SALT) |
| field | - MACSEC field to retrieve |
| void ProtocolPP::jmacsecsa::set_field | ( | field_t | field, |
| T | fieldval | ||
| ) |
Update MACSEC field
| field type | field name | Example |
|---|---|---|
| direction_t | DIRECTION | set_field<direction_t>(field_t::DIRECTION, direction_t::ENCAP) |
| macsecmode_t | MODE | set_field<macsecmode_t>(field_t::MODE, macsecmode_t::AES_256_GCM) |
| bool | FCS | set_field<bool>(field_t::FCS, true) |
| bool | USEXT | set_field<bool>(field_t::USEXT, true) |
| uint8_t | TCIAN | set_field<uint8_t>(field_t::TCIAN, 0x88) |
| SL | set_field<uint8_t>(field_t::SL, 0x88) | |
| uint16_t | ETHERTYPE | set_field<uint16_t>(field_t::ETHERTYPE, 0x88FF) |
| uint32_t | VLANTAG1 | set_field<uint32_t>(field_t::VLANTAG1, 0x810000FE) |
| uint32_t | VLANTAG2 | set_field<uint32_t>(field_t::VLANTAG2, 0x88A800FE) |
| uint32_t | PN | set_field<uint32_t>(field_t::PN, 0x000088FF) |
| XPN | set_field<uint32_t>(field_t::XPN, 0x088FF0AA) | |
| SSCI | set_field<uint32_t>(field_t::SSCI, 0x8FF0AACC) | |
| ARLEN | set_field<uint32_t>(field_t::ARLEN, 128) | |
| ICVLEN | set_field<uint32_t>(field_t::ICVLEN, 8) | |
| KEYLEN | set_field<uint32_t>(field_t::KEYLEN, 32) | |
| uint64_t | SOURCE | set_field<uint64_t>(field_t::SOURCE, 0xAABBCCDD11223344) |
| DESTINATION | set_field<uint64_t>(field_t::DESTINATION, 0x1122334455667788) | |
| jarray<uint8_t> | ARWIN | set_field<jarray<uint8_t>>(field_t::ARWIN, jarray<uint8_t>("00000000000000000000000000000001") |
| std::shared_ptr<jarray<uint8_t>> | SAKEY | set_field<std::shared_ptr<jarray<uint8_t>>>(field_t::SAKEY, std::make_shared<jarray<uint8_t>("AAAABBECEDEDEDED")) |
| SALT | set_field<std::shared_ptr<jarray<uint8_t>>>(field_t::SALT, std::make_shared<jarray<uint8_t>("AAAABBEC")) |
| field | - MACSEC field to update |
| fieldval | - new value for the MACSEC field |
|
virtual |
Write the protocol and security objects as JSON
| myjson | - JSON object to print with |
| direction | - randomization |
| indent | - indentation for JSON output |
Implements ProtocolPP::jsecass.
|
virtual |
Write the protocol and security objects as XML
| myxml | - XMLPrinter object to print with |
| direction | - randomization |
Implements ProtocolPP::jsecass.