Protocol++® (Protocolpp®)  v5.6.2
jstream Class Reference

#include "include/jstream.h"

Detailed Description

Stream class for Protocol++® (ProtocolPP®)

JSTREAM is the object in Protocol++® (ProtocolPP®) that holds all information pertaining to a stream or flow of packets. When processing packets in a cryptographic context, the packets require a set a parameters to process the information. This includes keys, IVs, salts, sequence numbers, type of flow, and other parameters

In Protocol++®, the parameters for a flow are gathered together in a security association. The type identifies to the user what protocol is being used in order to cast the jprotocol object to the correct type as well as the direction of processing. Streams that have packets with random IVs may also set the postprocess flag to signify to the testbench it's need to decrypt and verify the payload and checksum of the packet

The different constructors are useful for different situations. At times it may be necessary to keep the processing engine with the stream. In this case, the first constructor should be used:

std::shared_ptr<jwifisa> wifisec = std::make_shared<jwifisa>();
std::shared_ptr<jwifi> wifieng = std::make_shared<jwifi>(wifisec);
jstream(std::string("stream1"),
direction_t::DECAP,
protocol_t::WIFI,
false,
wifisec,
wifieng);

Engines update the security association with new sequence numbers and IV values during processing allowing the engine to be deleted after updating the security association in the jstream object. This reduces the memory footprint of the stream object to only the security association, a string for the name and an enumerator

The second constructor can be used to generate a stream object with all information necessary for processing data in the stream. Use of the second constructor is for these situations:

std::shared_ptr<jltesa> ltesec = std::make_shared<jltesa>();
jstream(std::string("stream2"),
direction_t::ENCAP,
protocol_t::LTE,
false,
ltesec);

The final constructor can be used with a security engine that's already been created

std::shared_ptr<jipsecsa> ipsec = std::make_shared<jipsecsa>();
std::shared_ptr<jipsec> ipeng = std::make_shared<jipsec>(ipsec);
jstream(std::string("stream3"),
direction_t::DECAP,
protocol_t::IPSEC,
true,
ipeng);

Fields may be set using the accessor function "set". They are templated to access the type of field desired. STREAMSIZE is necessary to provide support for CAAM/SEC shared descriptor size (in 32-bit words)

void set_field<std::string>(field_t::NAME, std::string("stream3"));
void set_field<uint32_t>(field_t::STREAMSIZE, 32);
void set_field<direction_t>(field_t::DIRECTION, direction_t::ENCAP);
void set_field<protocol_t>(field_t::TYPE, protocol_t::IPSEC);
void set_field<bool>(field_t::SETUP, true);

The security association and engine for the stream can be set using the functions below Security associations and engines are required to be wrapped in a shared pointer

void set_security(security);
void set_engine(engine);

Fields may be retrieved using the accessor "get" funcion. They are templated to retrieve the type of field requested

std::string name = get_field<std::string>(field_t::NAME);
uint32_t size = get_field<uint32_t>(field_t::STREAMSIZE);
direction_t dir = get_field<direction_t>(field_t::DIRECTION);
protocol_t prot = get_field<protocol_t>(field_t::TYPE);
bool postproc = get_field<bool>(field_t::POSTPROCESS);
bool setup = get_field<bool>(field_t::SETUP);
protocol_t
Definition: jenum.h:1321
direction_t
Definition: jenum.h:1688

The security association can be retrieved by passing a shared pointer of the correct type found by calling the get_field<protocol_t>(field_t::TYPE) function

std::shared_ptr<jipsecsa> ipsec;
void get_security(ipsec);

The encryption engine for the stream can be retrieved by passing the correct shared pointer to the get_engine() function. The type can be found in the field_t::TYPE

std::shared_ptr<jipsec> newengine = std::make_shared<jipsec>();
void get_engine(newengine);

The encryption engine if not needed can be deleted from the stream by using the following function

void jstream::clean();

For API Documentation:

See also
ProtocolPP::tinyxml2
ProtocolPP::jarray
ProtocolPP::jrand
ProtocolPP::jreplay
ProtocolPP::ciphers
ProtocolPP::jprotocol
ProtocolPP::jsecass
ProtocolPP::jconfidentsa
ProtocolPP::jconfident
ProtocolPP::jdilithiumsa
ProtocolPP::jdilithium
ProtocolPP::jdsasa
ProtocolPP::jdsa
ProtocolPP::jecdsaf2msa
ProtocolPP::jecdsaf2m
ProtocolPP::jecdsafpsa
ProtocolPP::jecdsafp
ProtocolPP::jfalconsa
ProtocolPP::jfalcon
ProtocolPP::jgresa
ProtocolPP::jgre
ProtocolPP::jicmpsa
ProtocolPP::jicmp
ProtocolPP::jintegritysa
ProtocolPP::jintegrity
ProtocolPP::jipsa
ProtocolPP::jip
ProtocolPP::jipsecsa
ProtocolPP::jipsec
ProtocolPP::jkybersa
ProtocolPP::jkyber
ProtocolPP::jltesa
ProtocolPP::jlte
ProtocolPP::jmacsecsa
ProtocolPP::jmacsec
ProtocolPP::jmemblobsa
ProtocolPP::jmemblob
ProtocolPP::jrsasa
ProtocolPP::jrsa
ProtocolPP::jsrtpsa
ProtocolPP::jsrtp
ProtocolPP::jtcpsa
ProtocolPP::jtcp
ProtocolPP::jtlsa
ProtocolPP::jtls
ProtocolPP::judpsa
ProtocolPP::judp
ProtocolPP::jwifisa
ProtocolPP::jwifi
ProtocolPP::jwimaxsa
ProtocolPP::jwimax
ProtocolPP::jxmssa
ProtocolPP::jxmss

For Additional Documentation:

See also
tinyxml2
jarray
jrand
jreplay
ciphers
jprotocol
jsecass
jconfidentsa
jconfident
jdilithiumsa
jdilithium
jdsasa
jdsa
jecdsaf2msa
jecdsaf2m
jecdsafpsa
jecdsafp
jfalconsa
jfalcon
jgresa
jgre
jicmpsa
jicmp
jintegritysa
jintegrity
jipsa
jip
jipsecsa
jipsec
jkybersa
jkyber
jltesa
jlte
jmacsecsa
jmacsec
jmemblobsa
jmemblob
jrsasa
jrsa
jsrtpsa
jsrtp
jtcpsa
jtcp
jtlsa
jtls
judpsa
judp
jwifisa
jwifi
jwimaxsa
jwimax
jxmssa
jxmss
Protocol++® (ProtocolPP®) written by : John Peter Greninger • © John Peter Greninger 2015-2024 • All Rights Reserved
All copyrights and trademarks are the property of their respective owners

The source code contained or described herein and all documents related to the source code (herein called "Material") are owned by John Peter Greninger and Sheila Rocha Greninger. Title to the Material remains with John Peter Greninger and Sheila Rocha Greninger. The Material contains trade secrets and proprietary and confidential information of John Peter Greninger and Sheila Rocha Greninger. The Material is protected by worldwide copyright and trade secret laws and treaty provisions. No part of the Material may be used, copied, reproduced, modified, published, uploaded, posted, transmitted, distributed, or disclosed in any way without prior express written consent of John Peter Greninger and Sheila Rocha Greninger (both are required)

No license under any patent, copyright, trade secret, or other intellectual property right is granted to or conferred upon you by disclosure or delivery of the Materials, either expressly, by implication, inducement, estoppel, or otherwise. Any license under such intellectual property rights must be express and approved by John Peter Greninger and Sheila Rocha Greninger in writing

Licensing information can be found at www.protocolpp.com/license with use of the binary forms permitted provided that the following conditions are met:

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution
  • Any and all modifications must be returned to John Peter Greninger at GitHub.com https://github.com/jpgreninger/protocolpp for evaluation. Inclusion of modifications in the source code shall be determined solely by John Peter Greninger. Failure to provide modifications shall render this license NULL and VOID and revoke any rights to use of Protocol++®
  • Commercial use (incidental or not) requires a fee-based license obtainable at www.protocolpp.com/shop
  • Academic or research use requires prior written and notarized permission from John Peter and Sheila Rocha Greninger

Use of the source code requires purchase of the source code. Source code can be purchased at www.protocolpp.com/shop

  • US Copyrights at https://www.copyright.gov/
    • TXu002059872 (Version 1.0.0)
    • TXu002066632 (Version 1.2.7)
    • TXu002082674 (Version 1.4.0)
    • TXu002097880 (Version 2.0.0)
    • TXu002169236 (Version 3.0.1)
    • TXu002182417 (Version 4.0.0)
    • TXu002219402 (Version 5.0.0)
    • TXu002272076 (Version 5.2.1)
    • TXu002383571 (Version 5.4.3)

The name of its contributor may not be used to endorse or promote products derived from this software without specific prior written permission and licensing

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE


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