netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gmputil.c File Reference
#include <stddef.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <nftables.h>
#include <datatype.h>
#include <utils.h>
Include dependency graph for gmputil.c:

Macros

#define mpz_get_type(type, endian, op)
 

Functions

void mpz_bitmask (mpz_t rop, unsigned int width)
 
void mpz_init_bitmask (mpz_t rop, unsigned int width)
 
void mpz_prefixmask (mpz_t rop, unsigned int width, unsigned int prefix_len)
 
void mpz_lshift_ui (mpz_t rop, unsigned int n)
 
void mpz_rshift_ui (mpz_t rop, unsigned int n)
 
uint64_t mpz_get_uint64 (const mpz_t op)
 
uint32_t mpz_get_uint32 (const mpz_t op)
 
uint16_t mpz_get_uint16 (const mpz_t op)
 
uint8_t mpz_get_uint8 (const mpz_t op)
 
uint64_t mpz_get_be64 (const mpz_t op)
 
uint32_t mpz_get_be32 (const mpz_t op)
 
uint16_t mpz_get_be16 (const mpz_t op)
 
void * mpz_export_data (void *data, const mpz_t op, enum byteorder byteorder, unsigned int len)
 
void mpz_import_data (mpz_t rop, const void *data, enum byteorder byteorder, unsigned int len)
 
void mpz_switch_byteorder (mpz_t rop, unsigned int len)
 
int mpz_printf (const char *f, const mpz_t value)
 

Macro Definition Documentation

#define mpz_get_type (   type,
  endian,
  op 
)
Value:
({ \
type ret = 0; \
size_t cnt; \
mpz_export(&ret, &cnt, MPZ_LSWF, sizeof(ret), endian, 0, op); \
assert(cnt <= 1); \
ret; \
})
void size_t u_int16_t type
Definition: libnetfilter_conntrack.h:557
void * mpz_export(void *, size_t *, int, size_t, int, size_t, const mpz_t)
Definition: mini-gmp.c:4300
Definition: gmputil.h:19

Referenced by mpz_get_be16(), mpz_get_be32(), mpz_get_be64(), mpz_get_uint16(), mpz_get_uint32(), mpz_get_uint64(), and mpz_get_uint8().

Function Documentation

void mpz_bitmask ( mpz_t  rop,
unsigned int  width 
)

References mpz_set_ui(), mpz_setbit(), and mpz_sub_ui().

Referenced by constant_expr_splice(), mpz_init_bitmask(), and mpz_prefixmask().

Here is the call graph for this function:

Here is the caller graph for this function:

void* mpz_export_data ( void *  data,
const mpz_t  op,
enum byteorder byteorder  ,
unsigned int  len 
)

References BYTEORDER_BIG_ENDIAN, BYTEORDER_HOST_ENDIAN, data, MPZ_BIG_ENDIAN, mpz_export(), MPZ_HOST_ENDIAN, MPZ_MSWF, and NULL.

Referenced by constant_expr_join(), mpz_switch_byteorder(), netlink_gen_raw_data(), and symbolic_constant_print().

Here is the call graph for this function:

Here is the caller graph for this function:

uint16_t mpz_get_be16 ( const mpz_t  op)

References MPZ_BIG_ENDIAN, and mpz_get_type.

uint32_t mpz_get_be32 ( const mpz_t  op)

References MPZ_BIG_ENDIAN, and mpz_get_type.

uint64_t mpz_get_be64 ( const mpz_t  op)

References MPZ_BIG_ENDIAN, and mpz_get_type.

uint16_t mpz_get_uint16 ( const mpz_t  op)

References mpz_get_type, and MPZ_HOST_ENDIAN.

uint32_t mpz_get_uint32 ( const mpz_t  op)

References mpz_get_type, and MPZ_HOST_ENDIAN.

uint64_t mpz_get_uint64 ( const mpz_t  op)

References mpz_get_type, and MPZ_HOST_ENDIAN.

uint8_t mpz_get_uint8 ( const mpz_t  op)

References mpz_get_type, and MPZ_HOST_ENDIAN.

void mpz_import_data ( mpz_t  rop,
const void *  data,
enum byteorder byteorder  ,
unsigned int  len 
)

References BYTEORDER_BIG_ENDIAN, BYTEORDER_HOST_ENDIAN, MPZ_BIG_ENDIAN, MPZ_HOST_ENDIAN, mpz_import(), and MPZ_MSWF.

Referenced by constant_expr_alloc(), and mpz_switch_byteorder().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_init_bitmask ( mpz_t  rop,
unsigned int  width 
)

References mpz_bitmask(), and mpz_init2().

Referenced by interval_map_decompose(), and range_expr_value_high().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_lshift_ui ( mpz_t  rop,
unsigned int  n 
)

References mpz_mul_2exp().

Referenced by constant_expr_splice(), flag_expr_alloc(), and mpz_prefixmask().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_prefixmask ( mpz_t  rop,
unsigned int  width,
unsigned int  prefix_len 
)

References mpz_bitmask(), and mpz_lshift_ui().

Here is the call graph for this function:

int mpz_printf ( const char *  f,
const mpz_t  value 
)

References expr::base, len, mpz_get_str(), mpz_sizeinbase(), and NULL.

Here is the call graph for this function:

void mpz_rshift_ui ( mpz_t  rop,
unsigned int  n 
)

References mpz_tdiv_q_2exp().

Referenced by constant_expr_splice().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_switch_byteorder ( mpz_t  rop,
unsigned int  len 
)

References BYTEORDER_BIG_ENDIAN, BYTEORDER_HOST_ENDIAN, data, len, mpz_export_data(), and mpz_import_data().

Here is the call graph for this function: