Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
CCMHelper::DecryptorStream Class Reference
Inheritance diagram for CCMHelper::DecryptorStream:
WrappedStream SyncStream

Public Member Functions

 DecryptorStream (std::string *tag_out, const std::string *expected_tag, SyncStream *consumer)
 
ssize_t write (const void *data, size_t len) override
 Main entry point to the data consumption.
 
int finalize (int status) override
 Called once after all data has been written to close the stream and release resources.
 
- Public Member Functions inherited from WrappedStream
 WrappedStream (SyncStream *delegate)
 
void set_delegate (SyncStream *delegate)
 Overrides the target where to send the incoming data onwards.
 
int finalize (int status) override
 Called once after all data has been written to close the stream and release resources.
 
- Public Member Functions inherited from SyncStream
ssize_t write_all (const void *data, size_t len)
 Repeatedly writes until all data has been consumed or an error occurs.
 

Private Attributes

std::string * tagOut_
 
const std::string * expectedTag_
 

Additional Inherited Members

- Static Protected Member Functions inherited from SyncStream
static const uint8_t * to_8 (const void *d)
 Converts a void pointer to an equivalent byte pointer.
 
static uint8_t * to_8 (void *d)
 Converts a void pointer to an equivalent byte pointer.
 
- Protected Attributes inherited from WrappedStream
std::unique_ptr< SyncStreamdelegate_
 Where to write the data to.
 

Detailed Description

Definition at line 279 of file CC32xxAes.hxx.

Constructor & Destructor Documentation

◆ DecryptorStream()

CCMHelper::DecryptorStream::DecryptorStream ( std::string *  tag_out,
const std::string *  expected_tag,
SyncStream consumer 
)
inline

Definition at line 282 of file CC32xxAes.hxx.

Member Function Documentation

◆ finalize()

int CCMHelper::DecryptorStream::finalize ( int  status)
inlineoverridevirtual

Called once after all data has been written to close the stream and release resources.

Return 0 on success, <0 on failure.

Parameters
statusis an error code seen by wrapping streams. Default 0 (OK), if negative, streams might want to roll back their changes.

Reimplemented from SyncStream.

Definition at line 309 of file CC32xxAes.hxx.

◆ write()

ssize_t CCMHelper::DecryptorStream::write ( const void *  data,
size_t  len 
)
inlineoverridevirtual

Main entry point to the data consumption.

Parameters
datais the pointer to a block of data to consume.
lenis the number of bytes to consume.
Returns
0 if the stream is completed/EOF (not consuming data anymore); negative value if there is an error; or the number of bytes consumed from the stream.

Implements SyncStream.

Definition at line 290 of file CC32xxAes.hxx.

Member Data Documentation

◆ expectedTag_

const std::string* CCMHelper::DecryptorStream::expectedTag_
private

Definition at line 320 of file CC32xxAes.hxx.

◆ tagOut_

std::string* CCMHelper::DecryptorStream::tagOut_
private

Definition at line 319 of file CC32xxAes.hxx.


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