GNU Radio's GSM Package
Bit vectors

Files

file  bitvec.h
 

Classes

struct  bitvec
 

Enumerations

enum  bit_value { ZERO = 0, ONE = 1, L = 2, H = 3 }
 

Functions

enum bit_value bitvec_get_bit_pos (const struct bitvec *bv, unsigned int bitnr)
 
enum bit_value bitvec_get_bit_pos_high (const struct bitvec *bv, unsigned int bitnr)
 
unsigned int bitvec_get_nth_set_bit (const struct bitvec *bv, unsigned int n)
 
int bitvec_set_bit_pos (struct bitvec *bv, unsigned int bitnum, enum bit_value bit)
 
int bitvec_set_bit (struct bitvec *bv, enum bit_value bit)
 
int bitvec_get_bit_high (struct bitvec *bv)
 
int bitvec_set_bits (struct bitvec *bv, const enum bit_value *bits, unsigned int count)
 
int bitvec_set_u64 (struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh)
 
int bitvec_set_uint (struct bitvec *bv, unsigned int in, unsigned int count)
 
int bitvec_get_uint (struct bitvec *bv, unsigned int num_bits)
 
int bitvec_find_bit_pos (const struct bitvec *bv, unsigned int n, enum bit_value val)
 
int bitvec_spare_padding (struct bitvec *bv, unsigned int up_to_bit)
 
int bitvec_get_bytes (struct bitvec *bv, uint8_t *bytes, unsigned int count)
 
int bitvec_set_bytes (struct bitvec *bv, const uint8_t *bytes, unsigned int count)
 
int bitvec_unhex (struct bitvec *bv, const char *src)
 
unsigned int bitvec_pack (const struct bitvec *bv, uint8_t *buffer)
 
unsigned int bitvec_unpack (struct bitvec *bv, const uint8_t *buffer)
 
uint64_t bitvec_read_field (struct bitvec *bv, unsigned int *read_index, unsigned int len)
 
int bitvec_write_field (struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len)
 
int bitvec_fill (struct bitvec *bv, unsigned int num_bits, enum bit_value fill)
 
char bit_value_to_char (enum bit_value v)
 
void bitvec_to_string_r (const struct bitvec *bv, char *str)
 
void bitvec_zero (struct bitvec *bv)
 
unsigned bitvec_rl (const struct bitvec *bv, bool b)
 
unsigned bitvec_rl_curbit (struct bitvec *bv, bool b, int max_bits)
 
void bitvec_shiftl (struct bitvec *bv, unsigned int n)
 
int16_t bitvec_get_int16_msb (const struct bitvec *bv, unsigned int num_bits)
 
unsigned int bitvec_add_array (struct bitvec *bv, const uint32_t *array, unsigned int array_len, bool dry_run, unsigned int num_bits)
 

Detailed Description

Enumeration Type Documentation

◆ bit_value

enum bit_value

A single GSM bit

In GSM mac blocks, every bit can be 0 or 1, or L or H. L/H are defined relative to the 0x2b padding pattern

Enumerator
ZERO 

A zero (0) bit

ONE 

A one (1) bit

A CSN.1 "L" bit

A CSN.1 "H" bit

Function Documentation

◆ bit_value_to_char()

char bit_value_to_char ( enum bit_value  v)

◆ bitvec_add_array()

unsigned int bitvec_add_array ( struct bitvec bv,
const uint32_t *  array,
unsigned int  array_len,
bool  dry_run,
unsigned int  num_bits 
)

◆ bitvec_fill()

int bitvec_fill ( struct bitvec bv,
unsigned int  num_bits,
enum bit_value  fill 
)

◆ bitvec_find_bit_pos()

int bitvec_find_bit_pos ( const struct bitvec bv,
unsigned int  n,
enum bit_value  val 
)

◆ bitvec_get_bit_high()

int bitvec_get_bit_high ( struct bitvec bv)

◆ bitvec_get_bit_pos()

enum bit_value bitvec_get_bit_pos ( const struct bitvec bv,
unsigned int  bitnr 
)

◆ bitvec_get_bit_pos_high()

enum bit_value bitvec_get_bit_pos_high ( const struct bitvec bv,
unsigned int  bitnr 
)

◆ bitvec_get_bytes()

int bitvec_get_bytes ( struct bitvec bv,
uint8_t *  bytes,
unsigned int  count 
)

◆ bitvec_get_int16_msb()

int16_t bitvec_get_int16_msb ( const struct bitvec bv,
unsigned int  num_bits 
)

◆ bitvec_get_nth_set_bit()

unsigned int bitvec_get_nth_set_bit ( const struct bitvec bv,
unsigned int  n 
)

◆ bitvec_get_uint()

int bitvec_get_uint ( struct bitvec bv,
unsigned int  num_bits 
)

◆ bitvec_pack()

unsigned int bitvec_pack ( const struct bitvec bv,
uint8_t *  buffer 
)

◆ bitvec_read_field()

uint64_t bitvec_read_field ( struct bitvec bv,
unsigned int *  read_index,
unsigned int  len 
)

◆ bitvec_rl()

unsigned bitvec_rl ( const struct bitvec bv,
bool  b 
)

◆ bitvec_rl_curbit()

unsigned bitvec_rl_curbit ( struct bitvec bv,
bool  b,
int  max_bits 
)

◆ bitvec_set_bit()

int bitvec_set_bit ( struct bitvec bv,
enum bit_value  bit 
)

◆ bitvec_set_bit_pos()

int bitvec_set_bit_pos ( struct bitvec bv,
unsigned int  bitnum,
enum bit_value  bit 
)

◆ bitvec_set_bits()

int bitvec_set_bits ( struct bitvec bv,
const enum bit_value bits,
unsigned int  count 
)

◆ bitvec_set_bytes()

int bitvec_set_bytes ( struct bitvec bv,
const uint8_t *  bytes,
unsigned int  count 
)

◆ bitvec_set_u64()

int bitvec_set_u64 ( struct bitvec bv,
uint64_t  v,
uint8_t  num_bits,
bool  use_lh 
)

◆ bitvec_set_uint()

int bitvec_set_uint ( struct bitvec bv,
unsigned int  in,
unsigned int  count 
)

◆ bitvec_shiftl()

void bitvec_shiftl ( struct bitvec bv,
unsigned int  n 
)

◆ bitvec_spare_padding()

int bitvec_spare_padding ( struct bitvec bv,
unsigned int  up_to_bit 
)

◆ bitvec_to_string_r()

void bitvec_to_string_r ( const struct bitvec bv,
char *  str 
)

◆ bitvec_unhex()

int bitvec_unhex ( struct bitvec bv,
const char *  src 
)

◆ bitvec_unpack()

unsigned int bitvec_unpack ( struct bitvec bv,
const uint8_t *  buffer 
)

◆ bitvec_write_field()

int bitvec_write_field ( struct bitvec bv,
unsigned int *  write_index,
uint64_t  val,
unsigned int  len 
)

◆ bitvec_zero()

void bitvec_zero ( struct bitvec bv)