|
libosmocore 0.3.6
Osmocom core library
|
Data Structures | |
| struct | value_string |
| A mapping between human-readable string and numeric value. More... | |
Files | |
| file | panic.h |
| file | utils.h |
| file | panic.c |
| file | utils.c |
Typedefs | |
| typedef void(* | osmo_panic_handler_t )(const char *fmt, va_list args) |
| panic handler callback function type | |
Functions | |
| void | osmo_panic (const char *fmt,...) |
| Terminate the current program with a panic. | |
| void | osmo_set_panic_handler (osmo_panic_handler_t h) |
| Set the panic handler. | |
| const char * | get_value_string (const struct value_string *vs, uint32_t val) |
| get human-readable string for given value | |
| int | get_string_value (const struct value_string *vs, const char *str) |
| get numeric value for given human-readable string | |
| char | osmo_bcd2char (uint8_t bcd) |
| Convert BCD-encoded digit into printable character. | |
| uint8_t | osmo_char2bcd (char c) |
| int | osmo_hexparse (const char *str, uint8_t *b, int max_len) |
| char * | osmo_ubit_dump (const uint8_t *bits, unsigned int len) |
| Convert a sequence of unpacked bits to ASCII string. | |
| char * | osmo_hexdump (const unsigned char *buf, int len) |
| Convert binary sequence to hexadecimal ASCII string. | |
| char * | osmo_osmo_hexdump_nospc (const unsigned char *buf, int len) |
| Convert binary sequence to hexadecimal ASCII string. | |
| void | osmo_str2lower (char *out, const char *in) |
| Convert an entire string to lower case. | |
| void | osmo_str2upper (char *out, const char *in) |
| Convert an entire string to upper case. | |
| static void | osmo_panic_default (const char *fmt, va_list args) |
| static char * | _osmo_hexdump (const unsigned char *buf, int len, char *delim) |
Variables | |
| const char * | value_string::str |
| human-readable string | |
| static osmo_panic_handler_t | osmo_panic_handler = (void*)0 |
| static char | namebuf [255] |
| static char | hexd_buff [4096] |
| int get_string_value | ( | const struct value_string * | vs, |
| const char * | str | ||
| ) |
get numeric value for given human-readable string
| [in] | vs | Array of value_string tuples |
| [in] | str | human-readable string |
References value_string::value.
Referenced by log_parse_level().
| const char * get_value_string | ( | const struct value_string * | vs, |
| uint32_t | val | ||
| ) |
get human-readable string for given value
| [in] | vs | Array of value_string tuples |
| [in] | val | Value to be converted |
References value_string::str.
Referenced by log_level_str().
| char osmo_bcd2char | ( | uint8_t | bcd | ) |
Convert BCD-encoded digit into printable character.
| [in] | bcd | A single BCD-encoded digit |
| char * osmo_hexdump | ( | const unsigned char * | buf, |
| int | len | ||
| ) |
Convert binary sequence to hexadecimal ASCII string.
| [in] | buf | pointer to sequence of bytes |
| [in] | len | length of buf in number of bytes |
This function will print a sequence of bytes as hexadecimal numbers, adding one space character between each byte (e.g. "1a ef d9")
| char * osmo_osmo_hexdump_nospc | ( | const unsigned char * | buf, |
| int | len | ||
| ) |
Convert binary sequence to hexadecimal ASCII string.
| [in] | buf | pointer to sequence of bytes |
| [in] | len | length of buf in number of bytes |
This function will print a sequence of bytes as hexadecimal numbers, without any space character between each byte (e.g. "1aefd9")
| void osmo_str2lower | ( | char * | out, |
| const char * | in | ||
| ) |
Convert an entire string to lower case.
| [out] | out | output string, caller-allocated |
| [in] | in | input string |
| void osmo_str2upper | ( | char * | out, |
| const char * | in | ||
| ) |
Convert an entire string to upper case.
| [out] | out | output string, caller-allocated |
| [in] | in | input string |
| char * osmo_ubit_dump | ( | const uint8_t * | bits, |
| unsigned int | len | ||
| ) |
Convert a sequence of unpacked bits to ASCII string.
| [in] | bits | A sequence of unpacked bits |
| [in] | len | Length of bits |