12#ifndef OPENVPN_COMPRESS_SNAPPY_H
13#define OPENVPN_COMPRESS_SNAPPY_H
38 const char *
name()
const override
63 snappy::RawCompress((
const char *)buf.
c_data(), buf.
size(), (
char *)
work.
data(), &comp_size);
66 if (comp_size < buf.
size())
101 if (!snappy::GetUncompressedLength((
const char *)buf.
c_data(), buf.
size(), &decomp_size)
102 || decomp_size > payload_size)
107 if (!snappy::RawUncompress((
const char *)buf.
c_data(), buf.
size(), (
char *)
work.
data()))
void swap(BufferAllocatedType< T_ > &other)
Swaps the contents of this BufferAllocatedType object with another BufferAllocatedType object.
const char * name() const override
void decompress(BufferAllocated &buf) override
CompressSnappy(const Frame::Ptr &frame, const SessionStats::Ptr &stats, const bool asym_arg)
void compress(BufferAllocated &buf, const bool hint) override
void do_swap(Buffer &buf, unsigned char op)
void error(BufferAllocated &buf)
void do_unswap(Buffer &buf)
const T * c_data() const
Returns a const pointer to the start of the buffer.
size_t max_size() const
Return the maximum allowable size value in T objects given the current offset (without considering re...
size_t size() const
Returns the size of the buffer in T objects.
T * data()
Get a mutable pointer to the start of the array.
T pop_front()
Removes and returns the first element from the buffer.
void set_size(const size_t size)
After an external method, operating on the array as a mutable unsigned char buffer,...
size_t prepare(const unsigned int context, Buffer &buf) const
#define OVPN_LOG_INFO(args)
#define OVPN_LOG_VERBOSE(args)