OpenVPN
Macros | Functions
integer.h File Reference
#include "error.h"
Include dependency graph for integer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define htonll(x)
 
#define ntohll(x)
 

Functions

static int clamp_size_to_int (size_t size)
 
static unsigned int max_uint (unsigned int x, unsigned int y)
 
static unsigned int min_uint (unsigned int x, unsigned int y)
 
static int max_int (int x, int y)
 
static int min_int (int x, int y)
 
static int constrain_int (int x, int min, int max)
 
static int modulo_subtract (int x, int y, int mod)
 
static int modulo_add (int x, int y, int mod)
 
static size_t adjust_power_of_2 (size_t u)
 
static int index_verify (int index, int size, const char *file, int line)
 
static size_t round_down_size (size_t num, size_t multiple)
 Rounds down num to the nearest multiple of multiple. More...
 

Macro Definition Documentation

◆ htonll

#define htonll (   x)
Value:
((1==htonl(1)) ? (x) : \
((uint64_t)htonl((x) & 0xFFFFFFFF) << 32) | htonl((x) >> 32))

Definition at line 30 of file integer.h.

◆ ntohll

#define ntohll (   x)
Value:
((1==ntohl(1)) ? (x) : \
((uint64_t)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((x) >> 32))

Definition at line 35 of file integer.h.

Function Documentation

◆ adjust_power_of_2()

static size_t adjust_power_of_2 ( size_t  u)
inlinestatic

Definition at line 168 of file integer.h.

References ASSERT.

Referenced by argv_grow(), hash_init(), and mbuf_init().

◆ clamp_size_to_int()

static int clamp_size_to_int ( size_t  size)
inlinestatic

Definition at line 40 of file integer.h.

References ASSERT.

Referenced by frame_calculate_fragment().

◆ constrain_int()

static int constrain_int ( int  x,
int  min,
int  max 
)
inlinestatic

◆ index_verify()

static int index_verify ( int  index,
int  size,
const char *  file,
int  line 
)
inlinestatic

Definition at line 182 of file integer.h.

References M_FATAL, and msg.

◆ max_int()

static int max_int ( int  x,
int  y 
)
inlinestatic

◆ max_uint()

static unsigned int max_uint ( unsigned int  x,
unsigned int  y 
)
inlinestatic

Definition at line 50 of file integer.h.

Referenced by receive_auth_pending(), and send_auth_pending_messages().

◆ min_int()

static int min_int ( int  x,
int  y 
)
inlinestatic

◆ min_uint()

static unsigned int min_uint ( unsigned int  x,
unsigned int  y 
)
inlinestatic

◆ modulo_add()

static int modulo_add ( int  x,
int  y,
int  mod 
)
inlinestatic

Definition at line 148 of file integer.h.

References ASSERT.

Referenced by fragment_list_get_buf(), fragment_outgoing(), and log_index().

◆ modulo_subtract()

static int modulo_subtract ( int  x,
int  y,
int  mod 
)
inlinestatic

Definition at line 133 of file integer.h.

References ASSERT.

Referenced by fragment_list_get_buf().

◆ round_down_size()

static size_t round_down_size ( size_t  num,
size_t  multiple 
)
inlinestatic

Rounds down num to the nearest multiple of multiple.

Definition at line 199 of file integer.h.

Referenced by adjust_payload_max_cbc().