TSDuck v3.46-4964
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::SChannelBuffer Class Reference

#include <tsSChannelBuffer.h>

Public Member Functions

 SChannelBuffer (size_t max_buffers)
void add (unsigned long type, void *buffer=nullptr, size_t bufsize=0)
size_t currentSize () const
::SecBufferDesc * desc ()
void freeContextBuffer ()
::SecBuffer * get (unsigned long type)
size_t maxSize () const
void reset ()
void resize (size_t max_buffers)
size_t totalBufferSize () const

Static Public Member Functions

static const Names & TypeNames ()

Detailed Description

SChannel input/output buffers and their descriptors (Windows-specific). This class encapsulates an array of SecBuffer and its associated SecBufferDesc.

Constructor & Destructor Documentation

◆ SChannelBuffer()

ts::SChannelBuffer::SChannelBuffer ( size_t max_buffers)

Constructor.

Parameters
[in]max_buffersMaximum number of input/output buffers.

Member Function Documentation

◆ resize()

void ts::SChannelBuffer::resize ( size_t max_buffers)

Resize the number of buffers. All previously returned SecBuffer addresses are invalidated.

Parameters
[in]max_buffersMaximum number of input/output buffers.

◆ maxSize()

size_t ts::SChannelBuffer::maxSize ( ) const
inline

Get the maximum number of buffers.

Returns
The maximum number of buffers.

◆ currentSize()

size_t ts::SChannelBuffer::currentSize ( ) const
inline

Get the current number of used buffers.

Returns
The current number of buffers.

◆ totalBufferSize()

size_t ts::SChannelBuffer::totalBufferSize ( ) const

Get the total size in bytes of used buffers.

Returns
The total size in bytes of used buffers.

◆ reset()

void ts::SChannelBuffer::reset ( )
inline

Reset the list of buffers, before a sequence of add();

◆ add()

void ts::SChannelBuffer::add ( unsigned long type,
void * buffer = nullptr,
size_t bufsize = 0 )

Add the description of a new buffer. Throw std::out_of_range if there is no more free buffer.

Parameters
[in]typeThe channel type.
[in]bufferBuffer address.
[in]bufsizeBuffer size in bytes.

◆ desc()

::SecBufferDesc * ts::SChannelBuffer::desc ( )
inline

Get the address of the buffer descriptor, typically for an SChannel call.

Returns
Address of the buffer descriptor.

◆ get()

::SecBuffer * ts::SChannelBuffer::get ( unsigned long type)

Search the first buffer of a given type.

Parameters
[in]typeThe channel type to search.
Returns
Address of the first buffer of type type or the null pointer if there is none.

◆ freeContextBuffer()

void ts::SChannelBuffer::freeContextBuffer ( )

Properly free and clear TLS buffers, when allocated by InitializeSecurityContext or AcceptSecurityContext.

◆ TypeNames()

const Names & ts::SChannelBuffer::TypeNames ( )
static

Get names for SChannel buffer bytes.

Returns
A constant reference to the Names instance.

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