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 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)
 

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.

Referenced by generate_auth_token(), and tls_crypt_v2_write_client_key_file().

◆ 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.

Referenced by verify_auth_token().

Function Documentation

◆ adjust_power_of_2()

static size_t adjust_power_of_2 ( size_t  u)
inlinestatic

Definition at line 161 of file integer.h.

References ASSERT.

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

◆ 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 175 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 43 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

Definition at line 56 of file integer.h.

Referenced by receive_auth_pending(), and send_auth_pending_messages().

◆ modulo_add()

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

Definition at line 141 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 126 of file integer.h.

References ASSERT.

Referenced by fragment_list_get_buf().