libosmocore  0.9.3.20160317
Osmocom core library
utils.c File Reference
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <stdio.h>
#include <osmocom/core/utils.h>
#include "../config.h"

Functions

const char * get_value_string (const struct value_string *vs, uint32_t val)
 get human-readable string for given value More...
 
int get_string_value (const struct value_string *vs, const char *str)
 get numeric value for given human-readable string More...
 
char osmo_bcd2char (uint8_t bcd)
 Convert BCD-encoded digit into printable character. More...
 
uint8_t osmo_char2bcd (char c)
 Convert number in ASCII to BCD value. More...
 
int osmo_hexparse (const char *str, uint8_t *b, int max_len)
 Parse a string ocntaining hexadecimal digits. More...
 
static char * _osmo_hexdump (const unsigned char *buf, int len, char *delim)
 
char * osmo_ubit_dump (const uint8_t *bits, unsigned int len)
 Convert a sequence of unpacked bits to ASCII string. More...
 
char * osmo_hexdump (const unsigned char *buf, int len)
 Convert binary sequence to hexadecimal ASCII string. More...
 
char * osmo_hexdump_nospc (const unsigned char *buf, int len)
 Convert binary sequence to hexadecimal ASCII string. More...
 
char * osmo_osmo_hexdump_nospc (const unsigned char *buf, int len) __attribute__((__deprecated__))
 
char alias ("osmo_hexdump_nospc")))
 

Variables

static char namebuf [255]
 
static char hexd_buff [4096]
 
static const char hex_chars [] = "0123456789abcdef"