|
GNU Radio's GSM Package
|
Files | |
| file | defs.h |
| file | panic.h |
| file | utils.h |
Classes | |
| struct | value_string |
Macros | |
| #define | OSMO_GNUC_PREREQ(maj, min) 0 |
| #define | OSMO_DEPRECATED(text) |
| #define | OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE OSMO_DEPRECATED("For internal use inside libosmocore only.") |
| #define | ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
| #define | OSMO_MAX(a, b) ((a) >= (b) ? (a) : (b)) |
| #define | OSMO_MIN(a, b) ((a) >= (b) ? (b) : (a)) |
| #define | OSMO_STRINGIFY(x) #x |
| #define | OSMO_STRINGIFY_VAL(x) OSMO_STRINGIFY(x) |
| #define | OSMO_VALUE_STRING(x) { x, #x } |
| #define | OSMO_BYTES_FOR_BITS(BITS) ((BITS + 8 - 1) / 8) |
| #define | osmo_static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1] __attribute__((__unused__)); |
| #define | OSMO_SNPRINTF_RET(ret, rem, offset, len) |
| #define | OSMO_ASSERT(exp) |
Typedefs | |
| typedef void(* | osmo_panic_handler_t) (const char *fmt, va_list args) |
Functions | |
| void | osmo_panic (const char *fmt,...) |
| void | osmo_set_panic_handler (osmo_panic_handler_t h) |
| const char * | get_value_string_or_null (const struct value_string *vs, uint32_t val) |
| int | get_string_value (const struct value_string *vs, const char *str) |
| char | osmo_bcd2char (uint8_t bcd) |
| uint8_t | osmo_char2bcd (char c) |
| char * | osmo_ubit_dump (const uint8_t *bits, unsigned int len) |
| char * | osmo_hexdump (const unsigned char *buf, int len) |
| char * | osmo_hexdump_nospc (const unsigned char *buf, int len) |
| char * | osmo_osmo_hexdump_nospc (const unsigned char *buf, int len) __attribute__((__deprecated__)) |
| void | osmo_str2lower (char *out, const char *in) |
| void | osmo_str2upper (char *out, const char *in) |
| int | osmo_constant_time_cmp (const uint8_t *exp, const uint8_t *rel, const int count) |
| uint64_t | osmo_decode_big_endian (const uint8_t *data, size_t data_len) |
| uint8_t * | osmo_encode_big_endian (uint64_t value, size_t data_len) |
| size_t | osmo_strlcpy (char *dst, const char *src, size_t siz) |
| bool | osmo_is_hexstr (const char *str, int min_digits, int max_digits, bool require_even) |
| bool | osmo_identifier_valid (const char *str) |
| bool | osmo_separated_identifiers_valid (const char *str, const char *sep_chars) |
| const char * | osmo_escape_str (const char *str, int len) |
| const char * | osmo_escape_str_buf (const char *str, int in_len, char *buf, size_t bufsize) |
| #define ARRAY_SIZE | ( | x | ) | (sizeof(x) / sizeof((x)[0])) |
Determine number of elements in an array of static size
| #define OSMO_ASSERT | ( | exp | ) |
Helper macro to terminate when an assertion failes
| [in] | exp | Predicate to verify This function will generate a backtrace and terminate the program if the predicate evaluates to false (0). |
| #define OSMO_BYTES_FOR_BITS | ( | BITS | ) | ((BITS + 8 - 1) / 8) |
Number of bytes necessary to store given BITS
| #define OSMO_DEPRECATED | ( | text | ) |
Set the deprecated attribute with a message.
| #define OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE OSMO_DEPRECATED("For internal use inside libosmocore only.") |
| #define OSMO_GNUC_PREREQ | ( | maj, | |
| min | |||
| ) | 0 |
Check for gcc and version.
| #define OSMO_MAX | ( | a, | |
| b | |||
| ) | ((a) >= (b) ? (a) : (b)) |
Return the maximum of two specified values
| #define OSMO_MIN | ( | a, | |
| b | |||
| ) | ((a) >= (b) ? (b) : (a)) |
Return the minimum of two specified values
| #define OSMO_SNPRINTF_RET | ( | ret, | |
| rem, | |||
| offset, | |||
| len | |||
| ) |
| #define osmo_static_assert | ( | exp, | |
| name | |||
| ) | typedef int dummy##name [(exp) ? 1 : -1] __attribute__((__unused__)); |
| #define OSMO_STRINGIFY | ( | x | ) | #x |
Stringify the name of a macro x, e.g. an FSM event name. Note: if nested within another preprocessor macro, this will stringify the value of x instead of its name.
| #define OSMO_STRINGIFY_VAL | ( | x | ) | OSMO_STRINGIFY(x) |
Stringify the value of a macro x, e.g. a port number.
| #define OSMO_VALUE_STRING | ( | x | ) | { x, #x } |
Make a value_string entry from an enum value name
| typedef void(* osmo_panic_handler_t) (const char *fmt, va_list args) |
panic handler callback function type
| int get_string_value | ( | const struct value_string * | vs, |
| const char * | str | ||
| ) |
| const char* get_value_string_or_null | ( | const struct value_string * | vs, |
| uint32_t | val | ||
| ) |
| char osmo_bcd2char | ( | uint8_t | bcd | ) |
| uint8_t osmo_char2bcd | ( | char | c | ) |
| int osmo_constant_time_cmp | ( | const uint8_t * | exp, |
| const uint8_t * | rel, | ||
| const int | count | ||
| ) |
duplicate a string using talloc and release its prior content (if any)
| [in] | ctx | Talloc context to use for allocation |
| [out] | dst | pointer to string, will be updated with ptr to new string |
| [in] | newstr | String that will be copieed to newly allocated string |
Append to a string and re-/allocate if necessary.
| [in] | ctx | Talloc context to use for initial allocation. |
| [in,out] | dest | char* to re-/allocate and append to. |
| [in] | fmt | printf-like string format. |
| [in] | args | Arguments for fmt. |
dest may be passed in NULL, or a string previously allocated by talloc. If an existing string is passed in, it will remain associated with whichever ctx it was allocated before, regardless whether it matches ctx or not.
| uint64_t osmo_decode_big_endian | ( | const uint8_t * | data, |
| size_t | data_len | ||
| ) |
| uint8_t* osmo_encode_big_endian | ( | uint64_t | value, |
| size_t | data_len | ||
| ) |
| const char* osmo_escape_str | ( | const char * | str, |
| int | len | ||
| ) |
| const char* osmo_escape_str_buf | ( | const char * | str, |
| int | in_len, | ||
| char * | buf, | ||
| size_t | bufsize | ||
| ) |
| char* osmo_hexdump | ( | const unsigned char * | buf, |
| int | len | ||
| ) |
| char* osmo_hexdump_nospc | ( | const unsigned char * | buf, |
| int | len | ||
| ) |
| bool osmo_identifier_valid | ( | const char * | str | ) |
| bool osmo_is_hexstr | ( | const char * | str, |
| int | min_digits, | ||
| int | max_digits, | ||
| bool | require_even | ||
| ) |
| char* osmo_osmo_hexdump_nospc | ( | const unsigned char * | buf, |
| int | len | ||
| ) |
| void osmo_panic | ( | const char * | fmt, |
| ... | |||
| ) |
| bool osmo_separated_identifiers_valid | ( | const char * | str, |
| const char * | sep_chars | ||
| ) |
| void osmo_set_panic_handler | ( | osmo_panic_handler_t | h | ) |
| void osmo_str2lower | ( | char * | out, |
| const char * | in | ||
| ) |
| void osmo_str2upper | ( | char * | out, |
| const char * | in | ||
| ) |
| size_t osmo_strlcpy | ( | char * | dst, |
| const char * | src, | ||
| size_t | siz | ||
| ) |
| char* osmo_ubit_dump | ( | const uint8_t * | bits, |
| unsigned int | len | ||
| ) |