Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cNetTOP Class Reference

#include <cNetTOP.h>

Inheritance diagram for GrayLib::cNetTOP:
Gray::cStream Gray::cStreamStats Gray::cStreamInput Gray::cStreamOutput Gray::cStreamBase Gray::cStreamBase

Public Member Functions

 cNetTOP (const BYTE *pSecretKey)
 
 ~cNetTOP (void)
 
- Public Member Functions inherited from Gray::cStream
virtual STREAM_SEEKRET_t Seek (STREAM_OFFSET_t iOffset, SEEK_ORIGIN_TYPE eSeekOrigin=SEEK_Set) override
 Disambiguate Seek for cStreamBase to cStreamInput for stupid compiler. More...
 
virtual STREAM_POS_t GetPosition () const override
 
virtual STREAM_POS_t GetLength () const override
 
void SeekToBegin ()
 
STREAM_POS_t SeekToEnd ()
 
- Public Member Functions inherited from Gray::cStreamInput
 cStreamInput () noexcept
 
virtual ~cStreamInput ()
 
virtual size_t SetSeekSizeMin (size_t nSizeMin=k_FILE_BLOCK_SIZE)
 
virtual HRESULT ReadX (OUT void *pData, size_t nDataSize)
 
HRESULT ReadAll (OUT cHeapBlock &block, size_t nSizeExtra=0)
 
virtual HRESULT ReadStringLine (OUT char *pszBuffer, StrLen_t iSizeMax)
 
virtual HRESULT ReadStringLine (OUT wchar_t *pszBuffer, StrLen_t iSizeMax)
 
HRESULT ReadT (OUT void *pVal, size_t nSize)
 
template<typename TYPE >
HRESULT ReadT (OUT TYPE &val)
 
template<typename TYPE >
HRESULT ReadTN (OUT TYPE &val)
 
HRESULT ReadSize (OUT size_t &nSize)
 
template<typename TYPE >
HRESULT ReadSizeT (OUT TYPE &n)
 
HRESULT ReadHashCode (OUT UINT32 &nHashCode)
 
HRESULT ReadHashCode (OUT UINT64 &nHashCode)
 
HRESULT ReadN (OUT BYTE *pBuffer, size_t nSizeMax)
 
template<typename _CH >
HRESULT ReadStringN (OUT _CH *pszStr, StrLen_t iSizeMax)
 
virtual HRESULT ReadPeek (void *pData, size_t nDataSize)
 
- Public Member Functions inherited from Gray::cStreamBase
virtual ~cStreamBase ()
 
void SeekToBegin ()
 
STREAM_POS_t SeekToEnd ()
 
- Public Member Functions inherited from Gray::cStreamOutput
 cStreamOutput () noexcept
 
virtual ~cStreamOutput ()
 
virtual HRESULT WriteX (const void *pData, size_t nDataSize)
 
HRESULT WriteT (const void *pVal, size_t nDataSize)
 
template<typename TYPE >
HRESULT WriteT (TYPE val)
 
HRESULT WriteSize (size_t nSize)
 
HRESULT WriteHashCode (HASHCODE_t nHashCode)
 
HRESULT WriteN (const void *pBuffer, size_t nSize)
 
template<typename _CH >
HRESULT WriteStringN (const _CH *pszStr)
 
template<typename _CH >
HRESULT WriteCharRepeat (_CH nChar, int nCount=1)
 
virtual HRESULT WriteString (const char *pszStr)
 
virtual HRESULT WriteString (const wchar_t *pszStr)
 
StrLen_t VPrintf (const char *pszFormat, va_list args)
 
StrLen_t VPrintf (const wchar_t *pszFormat, va_list args)
 
StrLen_t _cdecl Printf (const char *pszFormat,...)
 
StrLen_t _cdecl Printf (const wchar_t *pszFormat,...)
 
HRESULT WriteStream (cStreamInput &sInp, STREAM_POS_t nSizeMax=k_FILE_BLOCK_SIZE, IStreamProgressCallback *pProgress=nullptr, TIMESYSD_t nTimeout=0)
 Copy cStreamInput to this stream. More...
 
virtual HRESULT FlushX ()
 
- Public Member Functions inherited from Gray::cStreamStats
void Add (const cStreamStats &n)
 

Static Public Attributes

static const size_t k_iSizeUnit = 512
 
- Static Public Attributes inherited from Gray::cStreamBase
static const BYTE k_SIZE_MASK = 0x80
 Used for WriteSize() More...
 
static const size_t k_FILE_BLOCK_SIZE = (32 * 1024)
 default arbitrary transfer block size. more than this is NOT more efficient. More...
 

Additional Inherited Members

- Public Attributes inherited from Gray::cStreamStats
cStreamStat m_StatOut
 
cStreamStat m_StatInp
 

Detailed Description

TODO Replace TCP for transport with a Send/Receive stream of UDP packets. Use this for private streaming protocol. Use as a drop in replacement for cNetStream Allows encrypted/private conversation without the telltale TCP wrapper. Both sides share a Key. Ensures proper order and integrity of the stream as TCP does. NOTE: This will of course require 2 way UDP traffic and may run afoul of routers/firewalls. obscure order of packets. send packets intentionally in random order. obscure packet id. Data channel is encrypted but fully raw. No protocol. Sub channels are intended to be implemented on a separate layer. Monitors/filters if any interference (MitM) is going on . Nonsense packets. Malicious packets. random errors. We can split packets to make them smaller for problem connections (wireless?). This will of course run afoul of some firewalls that want to inspect all traffic.

Constructor & Destructor Documentation

◆ cNetTOP()

GrayLib::cNetTOP::cNetTOP ( const BYTE *  pSecretKey)

◆ ~cNetTOP()

GrayLib::cNetTOP::~cNetTOP ( void  )

Member Data Documentation

◆ k_iSizeUnit

const size_t GrayLib::cNetTOP::k_iSizeUnit = 512
static

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