OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::lzo_asym_impl Namespace Reference

Enumerations

enum  {
  LZOASYM_E_OK = 0 , LZOASYM_E_EOF_NOT_FOUND = -1 , LZOASYM_E_INPUT_NOT_CONSUMED = -2 , LZOASYM_E_INPUT_OVERFLOW = -3 ,
  LZOASYM_E_OUTPUT_OVERFLOW = -4 , LZOASYM_E_MATCH_OVERFLOW = -5 , LZOASYM_E_ASSERT_FAILED = -6 , LZOASYM_E_INPUT_TOO_LARGE = -7
}
 
enum  { LZOASYM_EOF_CODE = 1 , LZOASYM_M2_MAX_OFFSET = 0x0800 }
 

Functions

template<typename T >
get_mem (const void *p)
 
template<typename T >
size_t ptr_diff (const T *a, const T *b)
 
size_t get_u16 (const unsigned char *p)
 
void incremental_copy (unsigned char *dest, const unsigned char *src, ssize_t len)
 
int lzo1x_decompress_safe (const unsigned char *input, size_t input_length, unsigned char *output, size_t *output_length)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LZOASYM_E_OK 
LZOASYM_E_EOF_NOT_FOUND 
LZOASYM_E_INPUT_NOT_CONSUMED 
LZOASYM_E_INPUT_OVERFLOW 
LZOASYM_E_OUTPUT_OVERFLOW 
LZOASYM_E_MATCH_OVERFLOW 
LZOASYM_E_ASSERT_FAILED 
LZOASYM_E_INPUT_TOO_LARGE 

Definition at line 61 of file lzoasym_impl.hpp.

◆ anonymous enum

anonymous enum
Enumerator
LZOASYM_EOF_CODE 
LZOASYM_M2_MAX_OFFSET 

Definition at line 74 of file lzoasym_impl.hpp.

Function Documentation

◆ get_mem()

template<typename T >
T openvpn::lzo_asym_impl::get_mem ( const void *  p)
inline

Definition at line 83 of file lzoasym_impl.hpp.

◆ get_u16()

size_t openvpn::lzo_asym_impl::get_u16 ( const unsigned char *  p)
inline

Definition at line 97 of file lzoasym_impl.hpp.

Here is the caller graph for this function:

◆ incremental_copy()

void openvpn::lzo_asym_impl::incremental_copy ( unsigned char *  dest,
const unsigned char *  src,
ssize_t  len 
)
inline

This function emulates copying bytes one by one from src to dest. if src+len and dest+len overlap it repeats the non-overlapping section of src until it copied 'len' bytes

A slow simple version of this method looks like this:

do { *dest++ = *src++; } while (–len);

Parameters
srcSource of the memory
destDestination of the memory, must be >= src
lenNumber of bytes to copy from src to dest

Definition at line 117 of file lzoasym_impl.hpp.

Here is the caller graph for this function:

◆ lzo1x_decompress_safe()

int openvpn::lzo_asym_impl::lzo1x_decompress_safe ( const unsigned char *  input,
size_t  input_length,
unsigned char *  output,
size_t *  output_length 
)
inline

Definition at line 134 of file lzoasym_impl.hpp.

Here is the caller graph for this function:

◆ ptr_diff()

template<typename T >
size_t openvpn::lzo_asym_impl::ptr_diff ( const T *  a,
const T *  b 
)
inline

Definition at line 91 of file lzoasym_impl.hpp.

Here is the caller graph for this function: