mirror of https://gerrit.osmocom.org/libosmocore
doxygen: enable AUTOBRIEF, drop \brief
Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87changes/83/2983/4
parent
249fb71a2e
commit
87e4550585
|
@ -150,15 +150,15 @@ SHORT_NAMES = NO
|
|||
# comments will behave just like regular Qt-style comments
|
||||
# (thus requiring an explicit @brief command for a brief description.)
|
||||
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
|
||||
# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
|
||||
# interpret the first line (until the first dot) of a Qt-style
|
||||
# comment as the brief description. If set to NO, the comments
|
||||
# will behave just like regular Qt-style comments (thus requiring
|
||||
# an explicit \brief command for a brief description.)
|
||||
# an explicit command for a brief description.)
|
||||
|
||||
QT_AUTOBRIEF = NO
|
||||
QT_AUTOBRIEF = YES
|
||||
|
||||
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
|
||||
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
|
||||
|
|
|
@ -150,15 +150,15 @@ SHORT_NAMES = NO
|
|||
# comments will behave just like regular Qt-style comments
|
||||
# (thus requiring an explicit @brief command for a brief description.)
|
||||
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
|
||||
# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
|
||||
# interpret the first line (until the first dot) of a Qt-style
|
||||
# comment as the brief description. If set to NO, the comments
|
||||
# will behave just like regular Qt-style comments (thus requiring
|
||||
# an explicit \brief command for a brief description.)
|
||||
# an explicit command for a brief description.)
|
||||
|
||||
QT_AUTOBRIEF = NO
|
||||
QT_AUTOBRIEF = YES
|
||||
|
||||
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
|
||||
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
|
||||
|
|
|
@ -150,15 +150,15 @@ SHORT_NAMES = NO
|
|||
# comments will behave just like regular Qt-style comments
|
||||
# (thus requiring an explicit @brief command for a brief description.)
|
||||
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
|
||||
# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
|
||||
# interpret the first line (until the first dot) of a Qt-style
|
||||
# comment as the brief description. If set to NO, the comments
|
||||
# will behave just like regular Qt-style comments (thus requiring
|
||||
# an explicit \brief command for a brief description.)
|
||||
# an explicit command for a brief description.)
|
||||
|
||||
QT_AUTOBRIEF = NO
|
||||
QT_AUTOBRIEF = YES
|
||||
|
||||
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
|
||||
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
|
||||
|
|
|
@ -156,7 +156,7 @@ JAVADOC_AUTOBRIEF = YES
|
|||
# interpret the first line (until the first dot) of a Qt-style
|
||||
# comment as the brief description. If set to NO, the comments
|
||||
# will behave just like regular Qt-style comments (thus requiring
|
||||
# an explicit \brief command for a brief description.)
|
||||
# an explicit command for a brief description.)
|
||||
|
||||
QT_AUTOBRIEF = YES
|
||||
|
||||
|
|
|
@ -150,15 +150,15 @@ SHORT_NAMES = NO
|
|||
# comments will behave just like regular Qt-style comments
|
||||
# (thus requiring an explicit @brief command for a brief description.)
|
||||
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
|
||||
# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
|
||||
# interpret the first line (until the first dot) of a Qt-style
|
||||
# comment as the brief description. If set to NO, the comments
|
||||
# will behave just like regular Qt-style comments (thus requiring
|
||||
# an explicit \brief command for a brief description.)
|
||||
# an explicit command for a brief description.)
|
||||
|
||||
QT_AUTOBRIEF = NO
|
||||
QT_AUTOBRIEF = YES
|
||||
|
||||
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
|
||||
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
|
||||
|
|
|
@ -150,15 +150,15 @@ SHORT_NAMES = NO
|
|||
# comments will behave just like regular Qt-style comments
|
||||
# (thus requiring an explicit @brief command for a brief description.)
|
||||
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
|
||||
# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
|
||||
# interpret the first line (until the first dot) of a Qt-style
|
||||
# comment as the brief description. If set to NO, the comments
|
||||
# will behave just like regular Qt-style comments (thus requiring
|
||||
# an explicit \brief command for a brief description.)
|
||||
# an explicit command for a brief description.)
|
||||
|
||||
QT_AUTOBRIEF = NO
|
||||
QT_AUTOBRIEF = YES
|
||||
|
||||
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
|
||||
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
|
||||
|
|
|
@ -42,7 +42,7 @@ enum osmo_amr_quality {
|
|||
AMR_GOOD = 1
|
||||
};
|
||||
|
||||
/*! \brief Check if given AMR Frame Type is a speech frame
|
||||
/*! Check if given AMR Frame Type is a speech frame
|
||||
* \param[in] ft AMR Frame Type
|
||||
* \returns true if AMR with given Frame Type contains voice, false otherwise
|
||||
*/
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
/*! \file gsm0503_coding.h
|
||||
* \brief GSM TS 05.03 coding
|
||||
* GSM TS 05.03 coding
|
||||
*/
|
||||
|
||||
#define GSM0503_GPRS_BURSTS_NBITS (116 * 4)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
/*! \file gsm0503_interleaving.h
|
||||
* \brief GSM TS 05.03 interleaving
|
||||
* GSM TS 05.03 interleaving
|
||||
*/
|
||||
|
||||
void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
/*! \file gsm0503_mapping.c
|
||||
* \brief GSM TS 05.03 burst mapping
|
||||
* GSM TS 05.03 burst mapping
|
||||
*/
|
||||
|
||||
void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
/*! \file gsm0503_parity.h
|
||||
* \brief GSM TS 05.03 parity
|
||||
* GSM TS 05.03 parity
|
||||
*/
|
||||
|
||||
const struct osmo_crc64gen_code gsm0503_fire_crc40;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
/*! \file gsm0503_tables.h
|
||||
* \brief GSM TS 05.03 tables
|
||||
* GSM TS 05.03 tables
|
||||
*/
|
||||
|
||||
extern const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8];
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
/*!
|
||||
* \file application.h
|
||||
* \brief Routines for helping with the osmocom application setup.
|
||||
* Routines for helping with the osmocom application setup.
|
||||
*/
|
||||
|
||||
/*! \brief information containing the available logging subsystems */
|
||||
/*! information containing the available logging subsystems */
|
||||
struct log_info;
|
||||
|
||||
/*! \brief one instance of a logging target (file, stderr, ...) */
|
||||
/*! one instance of a logging target (file, stderr, ...) */
|
||||
struct log_target;
|
||||
|
||||
/*! \brief the default logging target, logging to stderr */
|
||||
/*! the default logging target, logging to stderr */
|
||||
extern struct log_target *osmo_stderr_target;
|
||||
|
||||
void osmo_init_ignore_signals(void);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
/*! \brief load unaligned n-byte integer (little-endian encoding) into uintXX_t
|
||||
/*! load unaligned n-byte integer (little-endian encoding) into uintXX_t
|
||||
* \param[in] p Buffer where integer is stored
|
||||
* \param[in] n Number of bytes stored in p
|
||||
* \returns XX bit unsigned integer
|
||||
|
@ -36,7 +36,7 @@ static inline uintXX_t osmo_loadXXle_ext(const void *p, uint8_t n)
|
|||
return r;
|
||||
}
|
||||
|
||||
/*! \brief load unaligned n-byte integer (big-endian encoding) into uintXX_t
|
||||
/*! load unaligned n-byte integer (big-endian encoding) into uintXX_t
|
||||
* \param[in] p Buffer where integer is stored
|
||||
* \param[in] n Number of bytes stored in p
|
||||
* \returns XX bit unsigned integer
|
||||
|
@ -51,7 +51,7 @@ static inline uintXX_t osmo_loadXXbe_ext(const void *p, uint8_t n)
|
|||
}
|
||||
|
||||
|
||||
/*! \brief store unaligned n-byte integer (little-endian encoding) from uintXX_t
|
||||
/*! store unaligned n-byte integer (little-endian encoding) from uintXX_t
|
||||
* \param[in] x unsigned XX bit integer
|
||||
* \param[out] p Buffer to store integer
|
||||
* \param[in] n Number of bytes to store
|
||||
|
@ -63,7 +63,7 @@ static inline void osmo_storeXXle_ext(uintXX_t x, void *p, uint8_t n)
|
|||
for(i = 0; i < n; q[i] = (x >> i * 8) & 0xFF, i++);
|
||||
}
|
||||
|
||||
/*! \brief store unaligned n-byte integer (big-endian encoding) from uintXX_t
|
||||
/*! store unaligned n-byte integer (big-endian encoding) from uintXX_t
|
||||
* \param[in] x unsigned XX bit integer
|
||||
* \param[out] p Buffer to store integer
|
||||
* \param[in] n Number of bytes to store
|
||||
|
@ -79,26 +79,26 @@ static inline void osmo_storeXXbe_ext(uintXX_t x, void *p, uint8_t n)
|
|||
/* Convenience function for most-used cases */
|
||||
|
||||
|
||||
/*! \brief load unaligned XX-bit integer (little-endian encoding) */
|
||||
/*! load unaligned XX-bit integer (little-endian encoding) */
|
||||
static inline uintXX_t osmo_loadXXle(const void *p)
|
||||
{
|
||||
return osmo_loadXXle_ext(p, XX / 8);
|
||||
}
|
||||
|
||||
/*! \brief load unaligned XX-bit integer (big-endian encoding) */
|
||||
/*! load unaligned XX-bit integer (big-endian encoding) */
|
||||
static inline uintXX_t osmo_loadXXbe(const void *p)
|
||||
{
|
||||
return osmo_loadXXbe_ext(p, XX / 8);
|
||||
}
|
||||
|
||||
|
||||
/*! \brief store unaligned XX-bit integer (little-endian encoding) */
|
||||
/*! store unaligned XX-bit integer (little-endian encoding) */
|
||||
static inline void osmo_storeXXle(uintXX_t x, void *p)
|
||||
{
|
||||
osmo_storeXXle_ext(x, p, XX / 8);
|
||||
}
|
||||
|
||||
/*! \brief store unaligned XX-bit integer (big-endian encoding) */
|
||||
/*! store unaligned XX-bit integer (big-endian encoding) */
|
||||
static inline void osmo_storeXXbe(uintXX_t x, void *p)
|
||||
{
|
||||
osmo_storeXXbe_ext(x, p, XX / 8);
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
/*! \file bitcomp.h
|
||||
* \brief Osmocom bit compression routines
|
||||
* Osmocom bit compression routines
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
|
|
@ -12,18 +12,18 @@
|
|||
*/
|
||||
|
||||
/*! \file bits.h
|
||||
* \brief Osmocom bit level support code
|
||||
* Osmocom bit level support code
|
||||
*
|
||||
* NOTE on the endianess of pbit_t:
|
||||
* Bits in a pbit_t are ordered MSB first, i.e. 0x80 is the first bit.
|
||||
* Bit i in a pbit_t array is array[i/8] & (1<<(7-i%8))
|
||||
*/
|
||||
|
||||
typedef int8_t sbit_t; /*!< \brief soft bit (-127...127) */
|
||||
typedef uint8_t ubit_t; /*!< \brief unpacked bit (0 or 1) */
|
||||
typedef uint8_t pbit_t; /*!< \brief packed bis (8 bits in a byte) */
|
||||
typedef int8_t sbit_t; /*!< soft bit (-127...127) */
|
||||
typedef uint8_t ubit_t; /*!< unpacked bit (0 or 1) */
|
||||
typedef uint8_t pbit_t; /*!< packed bis (8 bits in a byte) */
|
||||
|
||||
/*! \brief determine how many bytes we would need for \a num_bits packed bits
|
||||
/*! determine how many bytes we would need for \a num_bits packed bits
|
||||
* \param[in] num_bits Number of packed bits
|
||||
* \returns number of bytes needed for \a num_bits packed bits
|
||||
*/
|
||||
|
@ -81,31 +81,31 @@ int osmo_pbit2ubit_ext(ubit_t *out, unsigned int out_ofs,
|
|||
|
||||
/* BIT REVERSAL */
|
||||
|
||||
/*! \brief bit-reversal mode for osmo_bit_reversal() */
|
||||
/*! bit-reversal mode for osmo_bit_reversal() */
|
||||
enum osmo_br_mode {
|
||||
/*! \brief reverse all bits in a 32bit dword */
|
||||
/*! reverse all bits in a 32bit dword */
|
||||
OSMO_BR_BITS_IN_DWORD = 31,
|
||||
/*! \brief reverse byte order in a 32bit dword */
|
||||
/*! reverse byte order in a 32bit dword */
|
||||
OSMO_BR_BYTES_IN_DWORD = 24,
|
||||
/*! \brief reverse bits of each byte in a 32bit dword */
|
||||
/*! reverse bits of each byte in a 32bit dword */
|
||||
OSMO_BR_BITS_IN_BYTE = 7,
|
||||
/*! \brief swap the two 16bit words in a 32bit dword */
|
||||
/*! swap the two 16bit words in a 32bit dword */
|
||||
OSMO_BR_WORD_SWAP = 16,
|
||||
};
|
||||
|
||||
/*! \brief generic bit reversal function */
|
||||
/*! generic bit reversal function */
|
||||
uint32_t osmo_bit_reversal(uint32_t x, enum osmo_br_mode k);
|
||||
|
||||
/* \brief reverse the bits within each byte of a 32bit word */
|
||||
/* reverse the bits within each byte of a 32bit word */
|
||||
uint32_t osmo_revbytebits_32(uint32_t x);
|
||||
|
||||
/* \brief reverse the bits within a byte */
|
||||
/* reverse the bits within a byte */
|
||||
uint32_t osmo_revbytebits_8(uint8_t x);
|
||||
|
||||
/* \brief reverse the bits of each byte in a given buffer */
|
||||
/* reverse the bits of each byte in a given buffer */
|
||||
void osmo_revbytebits_buf(uint8_t *buf, int len);
|
||||
|
||||
/*! \brief left circular shift
|
||||
/*! left circular shift
|
||||
* \param[in] in The 16 bit unsigned integer to be rotated
|
||||
* \param[in] shift Number of bits to shift \a in to, [0;16] bits
|
||||
* \returns shifted value
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
/*! \file bitvec.h
|
||||
* \brief Osmocom bit vector abstraction
|
||||
* Osmocom bit vector abstraction
|
||||
*
|
||||
* These functions assume a MSB (most significant bit) first layout of the
|
||||
* bits, so that for instance the 5 bit number abcde (a is MSB) can be
|
||||
|
@ -44,22 +44,22 @@
|
|||
#include <osmocom/core/talloc.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/*! \brief A single GSM bit
|
||||
/*! 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 */
|
||||
enum bit_value {
|
||||
ZERO = 0, /*!< \brief A zero (0) bit */
|
||||
ONE = 1, /*!< \brief A one (1) bit */
|
||||
L = 2, /*!< \brief A CSN.1 "L" bit */
|
||||
H = 3, /*!< \brief A CSN.1 "H" bit */
|
||||
ZERO = 0, /*!< A zero (0) bit */
|
||||
ONE = 1, /*!< A one (1) bit */
|
||||
L = 2, /*!< A CSN.1 "L" bit */
|
||||
H = 3, /*!< A CSN.1 "H" bit */
|
||||
};
|
||||
|
||||
/*! \brief structure describing a bit vector */
|
||||
/*! structure describing a bit vector */
|
||||
struct bitvec {
|
||||
unsigned int cur_bit; /*!< \brief cursor to the next unused bit */
|
||||
unsigned int data_len; /*!< \brief length of data array in bytes */
|
||||
uint8_t *data; /*!< \brief pointer to data array */
|
||||
unsigned int cur_bit; /*!< cursor to the next unused bit */
|
||||
unsigned int data_len; /*!< length of data array in bytes */
|
||||
uint8_t *data; /*!< pointer to data array */
|
||||
};
|
||||
|
||||
enum bit_value bitvec_get_bit_pos(const struct bitvec *bv, unsigned int bitnr);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <stdint.h>
|
||||
#include <osmocom/core/endian.h>
|
||||
|
||||
/*! \brief byte-swap a 32bit word
|
||||
/*! byte-swap a 32bit word
|
||||
* \param[in] in to be swapped 32bit word
|
||||
* \returns byte-swapped 32bit word */
|
||||
static inline uint32_t osmo_swab32(uint32_t in)
|
||||
|
@ -17,7 +17,7 @@ static inline uint32_t osmo_swab32(uint32_t in)
|
|||
return out;
|
||||
}
|
||||
|
||||
/*! \brief byte-swap a 16bit word
|
||||
/*! byte-swap a 16bit word
|
||||
* \param[in] in to be swapped 16bit word
|
||||
* \returns byte-swapped 16bit word */
|
||||
static inline uint16_t osmo_swab16(uint16_t in)
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
#include <osmocom/core/bits.h>
|
||||
|
||||
/*! \brief possibe termination types
|
||||
/*! possibe termination types
|
||||
*
|
||||
* The termination type will determine which state the encoder/decoder
|
||||
* can start/end with. This is mostly taken care of in the high level API
|
||||
|
@ -42,31 +42,31 @@
|
|||
* proper calls yourself.
|
||||
*/
|
||||
enum osmo_conv_term {
|
||||
CONV_TERM_FLUSH = 0, /*!< \brief Flush encoder state */
|
||||
CONV_TERM_TRUNCATION, /*!< \brief Direct truncation */
|
||||
CONV_TERM_TAIL_BITING, /*!< \brief Tail biting */
|
||||
CONV_TERM_FLUSH = 0, /*!< Flush encoder state */
|
||||
CONV_TERM_TRUNCATION, /*!< Direct truncation */
|
||||
CONV_TERM_TAIL_BITING, /*!< Tail biting */
|
||||
};
|
||||
|
||||
/*! \brief structure describing a given convolutional code
|
||||
/*! structure describing a given convolutional code
|
||||
*
|
||||
* The only required fields are N,K and the next_output/next_state arrays. The
|
||||
* other can be left to default value of zero depending on what the code does.
|
||||
* If 'len' is left at 0 then only the low level API can be used.
|
||||
*/
|
||||
struct osmo_conv_code {
|
||||
int N; /*!< \brief Inverse of code rate */
|
||||
int K; /*!< \brief Constraint length */
|
||||
int len; /*!< \brief # of data bits */
|
||||
int N; /*!< Inverse of code rate */
|
||||
int K; /*!< Constraint length */
|
||||
int len; /*!< # of data bits */
|
||||
|
||||
enum osmo_conv_term term; /*!< \brief Termination type */
|
||||
enum osmo_conv_term term; /*!< Termination type */
|
||||
|
||||
const uint8_t (*next_output)[2];/*!< \brief Next output array */
|
||||
const uint8_t (*next_state)[2]; /*!< \brief Next state array */
|
||||
const uint8_t (*next_output)[2];/*!< Next output array */
|
||||
const uint8_t (*next_state)[2]; /*!< Next state array */
|
||||
|
||||
const uint8_t *next_term_output;/*!< \brief Flush termination output */
|
||||
const uint8_t *next_term_state; /*!< \brief Flush termination state */
|
||||
const uint8_t *next_term_output;/*!< Flush termination output */
|
||||
const uint8_t *next_term_state; /*!< Flush termination state */
|
||||
|
||||
const int *puncture; /*!< \brief Punctured bits indexes */
|
||||
const int *puncture; /*!< Punctured bits indexes */
|
||||
};
|
||||
|
||||
|
||||
|
@ -80,12 +80,12 @@ int osmo_conv_get_output_length(const struct osmo_conv_code *code, int len);
|
|||
|
||||
/* Low level API */
|
||||
|
||||
/*! \brief convolutional encoder state */
|
||||
/*! convolutional encoder state */
|
||||
struct osmo_conv_encoder {
|
||||
const struct osmo_conv_code *code; /*!< \brief for which code? */
|
||||
int i_idx; /*!< \brief Next input bit index */
|
||||
int p_idx; /*!< \brief Current puncture index */
|
||||
uint8_t state; /*!< \brief Current state */
|
||||
const struct osmo_conv_code *code; /*!< for which code? */
|
||||
int i_idx; /*!< Next input bit index */
|
||||
int p_idx; /*!< Current puncture index */
|
||||
uint8_t state; /*!< Current state */
|
||||
};
|
||||
|
||||
void osmo_conv_encode_init(struct osmo_conv_encoder *encoder,
|
||||
|
@ -105,20 +105,20 @@ int osmo_conv_encode(const struct osmo_conv_code *code,
|
|||
|
||||
/* Low level API */
|
||||
|
||||
/*! \brief convolutional decoder state */
|
||||
/*! convolutional decoder state */
|
||||
struct osmo_conv_decoder {
|
||||
const struct osmo_conv_code *code; /*!< \brief for which code? */
|
||||
const struct osmo_conv_code *code; /*!< for which code? */
|
||||
|
||||
int n_states; /*!< \brief number of states */
|
||||
int n_states; /*!< number of states */
|
||||
|
||||
int len; /*!< \brief Max o_idx (excl. termination) */
|
||||
int len; /*!< Max o_idx (excl. termination) */
|
||||
|
||||
int o_idx; /*!< \brief output index */
|
||||
int p_idx; /*!< \brief puncture index */
|
||||
int o_idx; /*!< output index */
|
||||
int p_idx; /*!< puncture index */
|
||||
|
||||
unsigned int *ae; /*!< \brief accumulated error */
|
||||
unsigned int *ae_next; /*!< \brief next accumulated error (tmp in scan) */
|
||||
uint8_t *state_history; /*!< \brief state history [len][n_states] */
|
||||
unsigned int *ae; /*!< accumulated error */
|
||||
unsigned int *ae_next; /*!< next accumulated error (tmp in scan) */
|
||||
uint8_t *state_history; /*!< state history [len][n_states] */
|
||||
};
|
||||
|
||||
void osmo_conv_decode_init(struct osmo_conv_decoder *decoder,
|
||||
|
|
|
@ -35,12 +35,12 @@
|
|||
#include <osmocom/core/bits.h>
|
||||
|
||||
|
||||
/*! \brief structure describing a given CRC code of max XX bits */
|
||||
/*! structure describing a given CRC code of max XX bits */
|
||||
struct osmo_crcXXgen_code {
|
||||
int bits; /*!< \brief Actual number of bits of the CRC */
|
||||
uintXX_t poly; /*!< \brief Polynom (normal representation, MSB omitted */
|
||||
uintXX_t init; /*!< \brief Initialization value of the CRC state */
|
||||
uintXX_t remainder; /*!< \brief Remainder of the CRC (final XOR) */
|
||||
int bits; /*!< Actual number of bits of the CRC */
|
||||
uintXX_t poly; /*!< Polynom (normal representation, MSB omitted */
|
||||
uintXX_t init; /*!< Initialization value of the CRC state */
|
||||
uintXX_t remainder; /*!< Remainder of the CRC (final XOR) */
|
||||
};
|
||||
|
||||
uintXX_t osmo_crcXXgen_compute_bits(const struct osmo_crcXXgen_code *code,
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
*/
|
||||
|
||||
/*! \file defs.h
|
||||
* \brief General definitions that are meant to be included from header files.
|
||||
* General definitions that are meant to be included from header files.
|
||||
*/
|
||||
|
||||
/*! \brief Check for gcc and version.
|
||||
/*! Check for gcc and version.
|
||||
*
|
||||
* \note Albeit glibc provides a features.h file that contains a similar
|
||||
* definition (__GNUC_PREREQ), this definition has been copied from there
|
||||
|
@ -23,7 +23,7 @@
|
|||
# define OSMO_GNUC_PREREQ(maj, min) 0
|
||||
#endif
|
||||
|
||||
/*! \brief Set the deprecated attribute with a message.
|
||||
/*! Set the deprecated attribute with a message.
|
||||
*/
|
||||
#if defined(__clang__)
|
||||
# define _OSMO_HAS_ATTRIBUTE_DEPRECATED __has_attribute(deprecated)
|
||||
|
|
|
@ -12,21 +12,21 @@
|
|||
*/
|
||||
|
||||
/*! \file fsm.h
|
||||
* \brief Finite State Machine
|
||||
* Finite State Machine
|
||||
*/
|
||||
|
||||
struct osmo_fsm_inst;
|
||||
|
||||
enum osmo_fsm_term_cause {
|
||||
/*! \brief terminate because parent terminated */
|
||||
/*! terminate because parent terminated */
|
||||
OSMO_FSM_TERM_PARENT,
|
||||
/*! \brief terminate on explicit user request */
|
||||
/*! terminate on explicit user request */
|
||||
OSMO_FSM_TERM_REQUEST,
|
||||
/*! \brief regular termination of process */
|
||||
/*! regular termination of process */
|
||||
OSMO_FSM_TERM_REGULAR,
|
||||
/*! \brief erroneous termination of process */
|
||||
/*! erroneous termination of process */
|
||||
OSMO_FSM_TERM_ERROR,
|
||||
/*! \brief termination due to time-out */
|
||||
/*! termination due to time-out */
|
||||
OSMO_FSM_TERM_TIMEOUT,
|
||||
};
|
||||
|
||||
|
@ -37,80 +37,80 @@ static inline const char *osmo_fsm_term_cause_name(enum osmo_fsm_term_cause caus
|
|||
}
|
||||
|
||||
|
||||
/*! \brief description of a rule in the FSM */
|
||||
/*! description of a rule in the FSM */
|
||||
struct osmo_fsm_state {
|
||||
/*! \brief bit-mask of permitted input events for this state */
|
||||
/*! bit-mask of permitted input events for this state */
|
||||
uint32_t in_event_mask;
|
||||
/*! \brief bit-mask to which other states this state may transiton */
|
||||
/*! bit-mask to which other states this state may transiton */
|
||||
uint32_t out_state_mask;
|
||||
/*! \brief human-readable name of this state */
|
||||
/*! human-readable name of this state */
|
||||
const char *name;
|
||||
/*! \brief function to be called for events arriving in this state */
|
||||
/*! function to be called for events arriving in this state */
|
||||
void (*action)(struct osmo_fsm_inst *fi, uint32_t event, void *data);
|
||||
/*! \brief function to be called just after entering the state */
|
||||
/*! function to be called just after entering the state */
|
||||
void (*onenter)(struct osmo_fsm_inst *fi, uint32_t prev_state);
|
||||
/*! \brief function to be called just before leaving the state */
|
||||
/*! function to be called just before leaving the state */
|
||||
void (*onleave)(struct osmo_fsm_inst *fi, uint32_t next_state);
|
||||
};
|
||||
|
||||
/*! \brief a description of an osmocom finite state machine */
|
||||
/*! a description of an osmocom finite state machine */
|
||||
struct osmo_fsm {
|
||||
/*! \brief global list */
|
||||
/*! global list */
|
||||
struct llist_head list;
|
||||
/*! \brief list of instances of this FSM */
|
||||
/*! list of instances of this FSM */
|
||||
struct llist_head instances;
|
||||
/*! \brief human readable name */
|
||||
/*! human readable name */
|
||||
const char *name;
|
||||
/*! \brief table of state transition rules */
|
||||
/*! table of state transition rules */
|
||||
const struct osmo_fsm_state *states;
|
||||
/*! \brief number of entries in \ref states */
|
||||
/*! number of entries in \ref states */
|
||||
unsigned int num_states;
|
||||
/*! \brief bit-mask of events permitted in all states */
|
||||
/*! bit-mask of events permitted in all states */
|
||||
uint32_t allstate_event_mask;
|
||||
/*! \brief function pointer to be called for allstate events */
|
||||
/*! function pointer to be called for allstate events */
|
||||
void (*allstate_action)(struct osmo_fsm_inst *fi, uint32_t event, void *data);
|
||||
/*! \brief clean-up function, called during termination */
|
||||
/*! clean-up function, called during termination */
|
||||
void (*cleanup)(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause);
|
||||
/*! \brief timer call-back for states with time-out.
|
||||
/*! timer call-back for states with time-out.
|
||||
* \returns 1 to request termination, 0 to keep running. */
|
||||
int (*timer_cb)(struct osmo_fsm_inst *fi);
|
||||
/*! \brief logging sub-system for this FSM */
|
||||
/*! logging sub-system for this FSM */
|
||||
int log_subsys;
|
||||
/*! \brief human-readable names of events */
|
||||
/*! human-readable names of events */
|
||||
const struct value_string *event_names;
|
||||
};
|
||||
|
||||
/*! \brief a single instanceof an osmocom finite state machine */
|
||||
/*! a single instanceof an osmocom finite state machine */
|
||||
struct osmo_fsm_inst {
|
||||
/*! \brief member in the fsm->instances list */
|
||||
/*! member in the fsm->instances list */
|
||||
struct llist_head list;
|
||||
/*! \brief back-pointer to the FSM of which we are an instance */
|
||||
/*! back-pointer to the FSM of which we are an instance */
|
||||
struct osmo_fsm *fsm;
|
||||
/*! \brief human readable identifier */
|
||||
/*! human readable identifier */
|
||||
const char *id;
|
||||
/*! \brief human readable fully-qualified name */
|
||||
/*! human readable fully-qualified name */
|
||||
const char *name;
|
||||
/*! \brief some private data of this instance */
|
||||
/*! some private data of this instance */
|
||||
void *priv;
|
||||
/*! \brief logging level for this FSM */
|
||||
/*! logging level for this FSM */
|
||||
int log_level;
|
||||
/*! \brief current state of the FSM */
|
||||
/*! current state of the FSM */
|
||||
uint32_t state;
|
||||
|
||||
/*! \brief timer number for states with time-out */
|
||||
/*! timer number for states with time-out */
|
||||
int T;
|
||||
/*! \brief timer back-end for states with time-out */
|
||||
/*! timer back-end for states with time-out */
|
||||
struct osmo_timer_list timer;
|
||||
|
||||
/*! \brief support for fsm-based procedures */
|
||||
/*! support for fsm-based procedures */
|
||||
struct {
|
||||
/*! \brief the parent FSM that has created us */
|
||||
/*! the parent FSM that has created us */
|
||||
struct osmo_fsm_inst *parent;
|
||||
/*! \brief the event we should send upon termination */
|
||||
/*! the event we should send upon termination */
|
||||
uint32_t parent_term_event;
|
||||
/*! \brief a list of children processes */
|
||||
/*! a list of children processes */
|
||||
struct llist_head children;
|
||||
/*! \brief \ref llist_head linked to parent->proc.children */
|
||||
/*! \ref llist_head linked to parent->proc.children */
|
||||
struct llist_head child;
|
||||
} proc;
|
||||
};
|
||||
|
@ -156,11 +156,11 @@ const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event);
|
|||
const char *osmo_fsm_inst_name(struct osmo_fsm_inst *fi);
|
||||
const char *osmo_fsm_state_name(struct osmo_fsm *fsm, uint32_t state);
|
||||
|
||||
/*! \brief return the name of the state the FSM instance is currently in. */
|
||||
/*! return the name of the state the FSM instance is currently in. */
|
||||
static inline const char *osmo_fsm_inst_state_name(struct osmo_fsm_inst *fi)
|
||||
{ return osmo_fsm_state_name(fi->fsm, fi->state); }
|
||||
|
||||
/*! \brief perform a state change of the given FSM instance
|
||||
/*! perform a state change of the given FSM instance
|
||||
*
|
||||
* This is a macro that calls _osmo_fsm_inst_state_chg() with the given
|
||||
* parameters as well as the caller's source file and line number for logging
|
||||
|
@ -173,7 +173,7 @@ int _osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state,
|
|||
unsigned long timeout_secs, int T,
|
||||
const char *file, int line);
|
||||
|
||||
/*! \brief dispatch an event to an osmocom finite state machine instance
|
||||
/*! dispatch an event to an osmocom finite state machine instance
|
||||
*
|
||||
* This is a macro that calls _osmo_fsm_inst_dispatch() with the given
|
||||
* parameters as well as the caller's source file and line number for logging
|
||||
|
@ -184,7 +184,7 @@ int _osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state,
|
|||
int _osmo_fsm_inst_dispatch(struct osmo_fsm_inst *fi, uint32_t event, void *data,
|
||||
const char *file, int line);
|
||||
|
||||
/*! \brief Terminate FSM instance with given cause
|
||||
/*! Terminate FSM instance with given cause
|
||||
*
|
||||
* This is a macro that calls _osmo_fsm_inst_term() with the given parameters
|
||||
* as well as the caller's source file and line number for logging purposes.
|
||||
|
@ -196,7 +196,7 @@ void _osmo_fsm_inst_term(struct osmo_fsm_inst *fi,
|
|||
enum osmo_fsm_term_cause cause, void *data,
|
||||
const char *file, int line);
|
||||
|
||||
/*! \brief Terminate all child FSM instances of an FSM instance.
|
||||
/*! Terminate all child FSM instances of an FSM instance.
|
||||
*
|
||||
* This is a macro that calls _osmo_fsm_inst_term_children() with the given
|
||||
* parameters as well as the caller's source file and line number for logging
|
||||
|
|
|
@ -238,7 +238,7 @@ enum {
|
|||
};
|
||||
|
||||
/* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */
|
||||
/*! \brief Structure of the GTMTAP pseudo-header */
|
||||
/*! Structure of the GTMTAP pseudo-header */
|
||||
struct gsmtap_hdr {
|
||||
uint8_t version; /*!< version, set to 0x01 currently */
|
||||
uint8_t hdr_len; /*!< length in number of 32bit words */
|
||||
|
@ -258,7 +258,7 @@ struct gsmtap_hdr {
|
|||
|
||||
} __attribute__((packed));
|
||||
|
||||
/*! \brief Structure of the GTMTAP libosmocore logging header */
|
||||
/*! Structure of the GTMTAP libosmocore logging header */
|
||||
struct gsmtap_osmocore_log_hdr {
|
||||
struct {
|
||||
uint32_t sec;
|
||||
|
|
|
@ -19,14 +19,14 @@ struct msgb *gsmtap_makemsg(uint16_t arfcn, uint8_t ts, uint8_t chan_type,
|
|||
uint8_t ss, uint32_t fn, int8_t signal_dbm,
|
||||
uint8_t snr, const uint8_t *data, unsigned int len);
|
||||
|
||||
/*! \brief one gsmtap instance */
|
||||
/*! one gsmtap instance */
|
||||
struct gsmtap_inst {
|
||||
int ofd_wq_mode; /*!< \brief wait queue mode? */
|
||||
struct osmo_wqueue wq; /*!< \brief the wait queue */
|
||||
struct osmo_fd sink_ofd;/*!< \brief file descriptor */
|
||||
int ofd_wq_mode; /*!< wait queue mode? */
|
||||
struct osmo_wqueue wq; /*!< the wait queue */
|
||||
struct osmo_fd sink_ofd;/*!< file descriptor */
|
||||
};
|
||||
|
||||
/*! \brief obtain the file descriptor associated with a gsmtap instance
|
||||
/*! obtain the file descriptor associated with a gsmtap instance
|
||||
* \param[in] gti GSMTAP instance
|
||||
* \returns file descriptor of GSMTAP instance */
|
||||
static inline int gsmtap_inst_fd(struct gsmtap_inst *gti)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
/*!
|
||||
* \file linuxlist.h
|
||||
*
|
||||
* \brief Simple doubly linked list implementation.
|
||||
* Simple doubly linked list implementation.
|
||||
*
|
||||
* Some of the internal functions ("__xxx") are useful when
|
||||
* manipulating whole llists rather than single entries, as
|
||||
|
@ -24,7 +24,7 @@
|
|||
|
||||
static inline void prefetch(const void *x) {;}
|
||||
|
||||
/*! \brief cast a member of a structure out to the containing structure
|
||||
/*! cast a member of a structure out to the containing structure
|
||||
*
|
||||
* \param[in] ptr the pointer to the member.
|
||||
* \param[in] type the type of the container struct this is embedded in.
|
||||
|
@ -43,15 +43,15 @@ static inline void prefetch(const void *x) {;}
|
|||
#define LLIST_POISON1 ((void *) 0x00100100)
|
||||
#define LLIST_POISON2 ((void *) 0x00200200)
|
||||
|
||||
/*! \brief (double) linked list header structure */
|
||||
/*! (double) linked list header structure */
|
||||
struct llist_head {
|
||||
/*! \brief Pointer to next and previous item */
|
||||
/*! Pointer to next and previous item */
|
||||
struct llist_head *next, *prev;
|
||||
};
|
||||
|
||||
#define LLIST_HEAD_INIT(name) { &(name), &(name) }
|
||||
|
||||
/*! \brief define a statically-initialized \ref llist_head
|
||||
/*! define a statically-initialized \ref llist_head
|
||||
* \param[in] name Variable name
|
||||
*
|
||||
* This is a helper macro that will define a named variable of type
|
||||
|
@ -59,12 +59,12 @@ struct llist_head {
|
|||
#define LLIST_HEAD(name) \
|
||||
struct llist_head name = LLIST_HEAD_INIT(name)
|
||||
|
||||
/*! \brief initialize a \ref llist_head to point back to self */
|
||||
/*! initialize a \ref llist_head to point back to self */
|
||||
#define INIT_LLIST_HEAD(ptr) do { \
|
||||
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
|
||||
} while (0)
|
||||
|
||||
/*! \brief Insert a new entry between two known consecutive entries.
|
||||
/*! Insert a new entry between two known consecutive entries.
|
||||
*
|
||||
* This is only for internal llist manipulation where we know
|
||||
* the prev/next entries already!
|
||||
|
@ -79,7 +79,7 @@ static inline void __llist_add(struct llist_head *_new,
|
|||
prev->next = _new;
|
||||
}
|
||||
|
||||
/*! \brief add a new entry into a linked list (at head)
|
||||
/*! add a new entry into a linked list (at head)
|
||||
* \param _new New entry to be added
|
||||
* \param head \ref llist_head to add it after
|
||||
*
|
||||
|
@ -91,7 +91,7 @@ static inline void llist_add(struct llist_head *_new, struct llist_head *head)
|
|||
__llist_add(_new, head, head->next);
|
||||
}
|
||||
|
||||
/*! \brief add a new entry into a linked list (at tail)
|
||||
/*! add a new entry into a linked list (at tail)
|
||||
* \param _new New entry to be added
|
||||
* \param head Head of linked list to whose tail we shall add \a _new
|
||||
*
|
||||
|
@ -116,7 +116,7 @@ static inline void __llist_del(struct llist_head * prev, struct llist_head * nex
|
|||
prev->next = next;
|
||||
}
|
||||
|
||||
/*! \brief Delete entry from linked list
|
||||
/*! Delete entry from linked list
|
||||
* \param entry The element to delete from the llist
|
||||
*
|
||||
* Note: llist_empty on entry does not return true after this, the entry is
|
||||
|
@ -129,7 +129,7 @@ static inline void llist_del(struct llist_head *entry)
|
|||
entry->prev = (struct llist_head *)LLIST_POISON2;
|
||||
}
|
||||
|
||||
/*! \brief Delete entry from linked list and reinitialize it
|
||||
/*! Delete entry from linked list and reinitialize it
|
||||
* \param entry The element to delete from the list
|
||||
*/
|
||||
static inline void llist_del_init(struct llist_head *entry)
|
||||
|
@ -138,7 +138,7 @@ static inline void llist_del_init(struct llist_head *entry)
|
|||
INIT_LLIST_HEAD(entry);
|
||||
}
|
||||
|
||||
/*! \brief Delete from one llist and add as another's head
|
||||
/*! Delete from one llist and add as another's head
|
||||
* \param llist The entry to move
|
||||
* \param head The head that will precede our entry
|
||||
*/
|
||||
|
@ -148,7 +148,7 @@ static inline void llist_move(struct llist_head *llist, struct llist_head *head)
|
|||
llist_add(llist, head);
|
||||
}
|
||||
|
||||
/*! \brief Delete from one llist and add as another's tail
|
||||
/*! Delete from one llist and add as another's tail
|
||||
* \param llist The entry to move
|
||||
* \param head The head that will follow our entry
|
||||
*/
|
||||
|
@ -159,7 +159,7 @@ static inline void llist_move_tail(struct llist_head *llist,
|
|||
llist_add_tail(llist, head);
|
||||
}
|
||||
|
||||
/*! \brief Test whether a linked list is empty
|
||||
/*! Test whether a linked list is empty
|
||||
* \param[in] head The llist to test.
|
||||
* \returns 1 if the list is empty, 0 otherwise
|
||||
*/
|
||||
|
@ -182,7 +182,7 @@ static inline void __llist_splice(struct llist_head *llist,
|
|||
at->prev = last;
|
||||
}
|
||||
|
||||
/*! \brief Join two llists
|
||||
/*! Join two llists
|
||||
* \param llist The new linked list to add
|
||||
* \param head The place to add \a llist in the other list
|
||||
*/
|
||||
|
@ -192,7 +192,7 @@ static inline void llist_splice(struct llist_head *llist, struct llist_head *hea
|
|||
__llist_splice(llist, head);
|
||||
}
|
||||
|
||||
/*! \brief join two llists and reinitialise the emptied llist.
|
||||
/*! join two llists and reinitialise the emptied llist.
|
||||
* \param llist The new linked list to add.
|
||||
* \param head The place to add it in the first llist.
|
||||
*
|
||||
|
@ -207,7 +207,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
}
|
||||
}
|
||||
|
||||
/*! \brief Get the struct containing this list entry
|
||||
/*! Get the struct containing this list entry
|
||||
* \param ptr The \ref llist_head pointer
|
||||
* \param type The type of the struct this is embedded in
|
||||
* \param @member The name of the \ref llist_head within the struct
|
||||
|
@ -215,7 +215,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
#define llist_entry(ptr, type, member) \
|
||||
container_of(ptr, type, member)
|
||||
|
||||
/*! \brief Get the first element from a list
|
||||
/*! Get the first element from a list
|
||||
* \param ptr the list head to take the element from.
|
||||
* \param type the type of the struct this is embedded in.
|
||||
* \param member the name of the list_head within the struct.
|
||||
|
@ -225,7 +225,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
#define llist_first_entry(ptr, type, member) \
|
||||
llist_entry((ptr)->next, type, member)
|
||||
|
||||
/*! \brief Get the last element from a list
|
||||
/*! Get the last element from a list
|
||||
* \param ptr the list head to take the element from.
|
||||
* \param type the type of the struct this is embedded in.
|
||||
* \param member the name of the llist_head within the struct.
|
||||
|
@ -235,7 +235,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
#define llist_last_entry(ptr, type, member) \
|
||||
llist_entry((ptr)->prev, type, member)
|
||||
|
||||
/*! \brief Get the first element from a list, or NULL
|
||||
/*! Get the first element from a list, or NULL
|
||||
* \param ptr the list head to take the element from.
|
||||
* \param type the type of the struct this is embedded in.
|
||||
* \param member the name of the list_head within the struct.
|
||||
|
@ -245,7 +245,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
#define llist_first_entry_or_null(ptr, type, member) \
|
||||
(!llist_empty(ptr) ? llist_first_entry(ptr, type, member) : NULL)
|
||||
|
||||
/*! \brief Iterate over a linked list
|
||||
/*! Iterate over a linked list
|
||||
* \param pos The \ref llist_head to use as a loop counter
|
||||
* \param head The head of the list over which to iterate
|
||||
*/
|
||||
|
@ -253,7 +253,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
for (pos = (head)->next, prefetch(pos->next); pos != (head); \
|
||||
pos = pos->next, prefetch(pos->next))
|
||||
|
||||
/*! \brief Iterate over a llist (no prefetch)
|
||||
/*! Iterate over a llist (no prefetch)
|
||||
* \param pos The \ref llist_head to use as a loop counter
|
||||
* \param head The head of the list over which to iterate
|
||||
*
|
||||
|
@ -265,7 +265,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
#define __llist_for_each(pos, head) \
|
||||
for (pos = (head)->next; pos != (head); pos = pos->next)
|
||||
|
||||
/*! \brief Iterate over a llist backwards
|
||||
/*! Iterate over a llist backwards
|
||||
* \param pos The \ref llist_head to use as a loop counter
|
||||
* \param head The head of the list over which to iterate
|
||||
*/
|
||||
|
@ -273,7 +273,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
|
||||
pos = pos->prev, prefetch(pos->prev))
|
||||
|
||||
/*! \brief Iterate over a list; safe against removal of llist entry
|
||||
/*! Iterate over a list; safe against removal of llist entry
|
||||
* \param pos The \ref llist_head to use as a loop counter
|
||||
* \param n Another \ref llist_head to use as temporary storage
|
||||
* \param head The head of the list over which to iterate
|
||||
|
@ -282,7 +282,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
for (pos = (head)->next, n = pos->next; pos != (head); \
|
||||
pos = n, n = pos->next)
|
||||
|
||||
/*! \brief Iterate over llist of given type
|
||||
/*! Iterate over llist of given type
|
||||
* \param pos The 'type *' to use as a loop counter
|
||||
* \param head The head of the list over which to iterate
|
||||
* \param member The name of the \ref llist_head within struct \a pos
|
||||
|
@ -294,7 +294,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
pos = llist_entry(pos->member.next, typeof(*pos), member), \
|
||||
prefetch(pos->member.next))
|
||||
|
||||
/*! \brief Iterate backwards over llist of given type.
|
||||
/*! Iterate backwards over llist of given type.
|
||||
* \param pos The 'type *' to use as a loop counter
|
||||
* \param head The head of the list over which to iterate
|
||||
* \param member The name of the \ref llist_head within struct \a pos
|
||||
|
@ -306,7 +306,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
pos = llist_entry(pos->member.prev, typeof(*pos), member), \
|
||||
prefetch(pos->member.prev))
|
||||
|
||||
/*! \brief iterate over llist of given type continuing after existing
|
||||
/*! iterate over llist of given type continuing after existing
|
||||
* point
|
||||
* \param pos The 'type *' to use as a loop counter
|
||||
* \param head The head of the list over which to iterate
|
||||
|
@ -319,7 +319,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
pos = llist_entry(pos->member.next, typeof(*pos), member), \
|
||||
prefetch(pos->member.next))
|
||||
|
||||
/*! \brief iterate over llist of given type, safe against removal of
|
||||
/*! iterate over llist of given type, safe against removal of
|
||||
* non-consecutive(!) llist entries
|
||||
* \param pos The 'type *' to use as a loop counter
|
||||
* \param n Another type * to use as temporary storage
|
||||
|
@ -381,7 +381,7 @@ static inline void llist_splice_init(struct llist_head *llist,
|
|||
for ((pos) = (pos)->next, prefetch((pos)->next); (pos) != (head); \
|
||||
(pos) = (pos)->next, ({ smp_read_barrier_depends(); 0;}), prefetch((pos)->next))
|
||||
|
||||
/*! \brief count nr of llist items by iterating.
|
||||
/*! count nr of llist items by iterating.
|
||||
* \param head The llist head to count items of.
|
||||
* \returns Number of items.
|
||||
*
|
||||
|
|
|
@ -13,15 +13,15 @@
|
|||
#include <osmocom/core/defs.h>
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
|
||||
/*! \brief Maximum number of logging contexts */
|
||||
/*! Maximum number of logging contexts */
|
||||
#define LOG_MAX_CTX 8
|
||||
/*! \brief Maximum number of logging filters */
|
||||
/*! Maximum number of logging filters */
|
||||
#define LOG_MAX_FILTERS 8
|
||||
|
||||
#define DEBUG
|
||||
|
||||
#ifdef DEBUG
|
||||
/*! \brief Log a debug message through the Osmocom logging framework
|
||||
/*! Log a debug message through the Osmocom logging framework
|
||||
* \param[in] ss logging subsystem (e.g. \ref DLGLOBAL)
|
||||
* \param[in] fmt format string
|
||||
* \param[in] args variable argument list
|
||||
|
@ -39,7 +39,7 @@ void osmo_vlogp(int subsys, int level, const char *file, int line,
|
|||
|
||||
void logp(int subsys, const char *file, int line, int cont, const char *format, ...) OSMO_DEPRECATED("Use DEBUGP* macros instead");
|
||||
|
||||
/*! \brief Log a new message through the Osmocom logging framework
|
||||
/*! Log a new message through the Osmocom logging framework
|
||||
* \param[in] ss logging subsystem (e.g. \ref DLGLOBAL)
|
||||
* \param[in] level logging level (e.g. \ref LOGL_NOTICE)
|
||||
* \param[in] fmt format string
|
||||
|
@ -48,7 +48,7 @@ void logp(int subsys, const char *file, int line, int cont, const char *format,
|
|||
#define LOGP(ss, level, fmt, args...) \
|
||||
LOGPSRC(ss, level, NULL, 0, fmt, ## args)
|
||||
|
||||
/*! \brief Continue a log message through the Osmocom logging framework
|
||||
/*! Continue a log message through the Osmocom logging framework
|
||||
* \param[in] ss logging subsystem (e.g. \ref DLGLOBAL)
|
||||
* \param[in] level logging level (e.g. \ref LOGL_NOTICE)
|
||||
* \param[in] fmt format string
|
||||
|
@ -60,7 +60,7 @@ void logp(int subsys, const char *file, int line, int cont, const char *format,
|
|||
logp2(ss, level, __BASE_FILE__, __LINE__, 1, fmt, ##args); \
|
||||
} while(0)
|
||||
|
||||
/*! \brief Log through the Osmocom logging framework with explicit source.
|
||||
/*! Log through the Osmocom logging framework with explicit source.
|
||||
* If caller_file is passed as NULL, __BASE_FILE__ and __LINE__ are used
|
||||
* instead of caller_file and caller_line (so that this macro here defines
|
||||
* both cases in the same place, and to catch cases where callers fail to pass
|
||||
|
@ -82,12 +82,12 @@ void logp(int subsys, const char *file, int line, int cont, const char *format,
|
|||
}\
|
||||
} while(0)
|
||||
|
||||
/*! \brief different log levels */
|
||||
#define LOGL_DEBUG 1 /*!< \brief debugging information */
|
||||
#define LOGL_INFO 3 /*!< \brief general information */
|
||||
#define LOGL_NOTICE 5 /*!< \brief abnormal/unexpected condition */
|
||||
#define LOGL_ERROR 7 /*!< \brief error condition, requires user action */
|
||||
#define LOGL_FATAL 8 /*!< \brief fatal, program aborted */
|
||||
/*! different log levels */
|
||||
#define LOGL_DEBUG 1 /*!< debugging information */
|
||||
#define LOGL_INFO 3 /*!< general information */
|
||||
#define LOGL_NOTICE 5 /*!< abnormal/unexpected condition */
|
||||
#define LOGL_ERROR 7 /*!< error condition, requires user action */
|
||||
#define LOGL_FATAL 8 /*!< fatal, program aborted */
|
||||
|
||||
/* logging levels defined by the library itself */
|
||||
#define DLGLOBAL -1 /*!< global logging */
|
||||
|
@ -114,7 +114,7 @@ struct log_category {
|
|||
uint8_t enabled; /*!< is logging enabled? */
|
||||
};
|
||||
|
||||
/*! \brief Information regarding one logging category */
|
||||
/*! Information regarding one logging category */
|
||||
struct log_info_cat {
|
||||
const char *name; /*!< name of category */
|
||||
const char *color; /*!< color string for cateyory */
|
||||
|
@ -123,12 +123,12 @@ struct log_info_cat {
|
|||
uint8_t enabled; /*!< is this category enabled or not */
|
||||
};
|
||||
|
||||
/*! \brief Log context information, passed to filter */
|
||||
/*! Log context information, passed to filter */
|
||||
struct log_context {
|
||||
void *ctx[LOG_MAX_CTX+1];
|
||||
};
|
||||
|
||||
/*! \brief Indexes to indicate the object currently acted upon.
|
||||
/*! Indexes to indicate the object currently acted upon.
|
||||
* Array indexes for the global \a log_context array. */
|
||||
enum log_ctx_index {
|
||||
LOG_CTX_GB_NSVC,
|
||||
|
@ -138,7 +138,7 @@ enum log_ctx_index {
|
|||
_LOG_CTX_COUNT
|
||||
};
|
||||
|
||||
/*! \brief Indexes to indicate objects that should be logged.
|
||||
/*! Indexes to indicate objects that should be logged.
|
||||
* Array indexes to log_target->filter_data and bit indexes for
|
||||
* log_target->filter_map. */
|
||||
enum log_filter_index {
|
||||
|
@ -150,18 +150,18 @@ enum log_filter_index {
|
|||
_LOG_FLT_COUNT
|
||||
};
|
||||
|
||||
/*! \brief Compatibility with older libosmocore versions */
|
||||
/*! Compatibility with older libosmocore versions */
|
||||
#define LOG_FILTER_ALL (1<<LOG_FLT_ALL)
|
||||
/*! \brief Compatibility with older libosmocore versions */
|
||||
/*! Compatibility with older libosmocore versions */
|
||||
#define GPRS_CTX_NSVC LOG_CTX_GB_NSVC
|
||||
/*! \brief Compatibility with older libosmocore versions */
|
||||
/*! Compatibility with older libosmocore versions */
|
||||
#define GPRS_CTX_BVC LOG_CTX_GB_BVC
|
||||
/*! \brief Indexes to indicate the object currently acted upon.
|
||||
/*! Indexes to indicate the object currently acted upon.
|
||||
* Array indexes for the global \a log_context array. */
|
||||
|
||||
struct log_target;
|
||||
|
||||
/*! \brief Log filter function */
|
||||
/*! Log filter function */
|
||||
typedef int log_filter(const struct log_context *ctx,
|
||||
struct log_target *target);
|
||||
|
||||
|
@ -177,60 +177,60 @@ typedef void log_save_filters(struct vty *vty,
|
|||
const struct log_info *info,
|
||||
const struct log_target *tgt);
|
||||
|
||||
/*! \brief Logging configuration, passed to \ref log_init */
|
||||
/*! Logging configuration, passed to \ref log_init */
|
||||
struct log_info {
|
||||
/* \brief filter callback function */
|
||||
/* filter callback function */
|
||||
log_filter *filter_fn;
|
||||
|
||||
/*! \brief per-category information */
|
||||
/*! per-category information */
|
||||
const struct log_info_cat *cat;
|
||||
/*! \brief total number of categories */
|
||||
/*! total number of categories */
|
||||
unsigned int num_cat;
|
||||
/*! \brief total number of user categories (not library) */
|
||||
/*! total number of user categories (not library) */
|
||||
unsigned int num_cat_user;
|
||||
|
||||
/*! \brief filter saving function */
|
||||
/*! filter saving function */
|
||||
log_save_filters *save_fn;
|
||||
/*! \brief filter saving function */
|
||||
/*! filter saving function */
|
||||
log_print_filters *print_fn;
|
||||
};
|
||||
|
||||
/*! \brief Type of logging target */
|
||||
/*! Type of logging target */
|
||||
enum log_target_type {
|
||||
LOG_TGT_TYPE_VTY, /*!< \brief VTY logging */
|
||||
LOG_TGT_TYPE_SYSLOG, /*!< \brief syslog based logging */
|
||||
LOG_TGT_TYPE_FILE, /*!< \brief text file logging */
|
||||
LOG_TGT_TYPE_STDERR, /*!< \brief stderr logging */
|
||||
LOG_TGT_TYPE_STRRB, /*!< \brief osmo_strrb-backed logging */
|
||||
LOG_TGT_TYPE_GSMTAP, /*!< \brief GSMTAP network logging */
|
||||
LOG_TGT_TYPE_VTY, /*!< VTY logging */
|
||||
LOG_TGT_TYPE_SYSLOG, /*!< syslog based logging */
|
||||
LOG_TGT_TYPE_FILE, /*!< text file logging */
|
||||
LOG_TGT_TYPE_STDERR, /*!< stderr logging */
|
||||
LOG_TGT_TYPE_STRRB, /*!< osmo_strrb-backed logging */
|
||||
LOG_TGT_TYPE_GSMTAP, /*!< GSMTAP network logging */
|
||||
};
|
||||
|
||||
/*! \brief structure representing a logging target */
|
||||
/*! structure representing a logging target */
|
||||
struct log_target {
|
||||
struct llist_head entry; /*!< \brief linked list */
|
||||
struct llist_head entry; /*!< linked list */
|
||||
|
||||
/*! \brief Internal data for filtering */
|
||||
/*! Internal data for filtering */
|
||||
int filter_map;
|
||||
/*! \brief Internal data for filtering */
|
||||
/*! Internal data for filtering */
|
||||
void *filter_data[LOG_MAX_FILTERS+1];
|
||||
|
||||
/*! \brief logging categories */
|
||||
/*! logging categories */
|
||||
struct log_category *categories;
|
||||
|
||||
/*! \brief global log level */
|
||||
/*! global log level */
|
||||
uint8_t loglevel;
|
||||
/*! \brief should color be used when printing log messages? */
|
||||
/*! should color be used when printing log messages? */
|
||||
unsigned int use_color:1;
|
||||
/*! \brief should log messages be prefixed with a timestamp? */
|
||||
/*! should log messages be prefixed with a timestamp? */
|
||||
unsigned int print_timestamp:1;
|
||||
/*! \brief should log messages be prefixed with a filename? */
|
||||
/*! should log messages be prefixed with a filename? */
|
||||
unsigned int print_filename:1;
|
||||
/*! \brief should log messages be prefixed with a category name? */
|
||||
/*! should log messages be prefixed with a category name? */
|
||||
unsigned int print_category:1;
|
||||
/*! \brief should log messages be prefixed with an extended timestamp? */
|
||||
/*! should log messages be prefixed with an extended timestamp? */
|
||||
unsigned int print_ext_timestamp:1;
|
||||
|
||||
/*! \brief the type of this log taget */
|
||||
/*! the type of this log taget */
|
||||
enum log_target_type type;
|
||||
|
||||
union {
|
||||
|
@ -259,7 +259,7 @@ struct log_target {
|
|||
} tgt_gsmtap;
|
||||
};
|
||||
|
||||
/*! \brief call-back function to be called when the logging framework
|
||||
/*! call-back function to be called when the logging framework
|
||||
* wants to log a fully formatted string
|
||||
* \param[in] target logging target
|
||||
* \param[in] level log level of currnet message
|
||||
|
@ -268,7 +268,7 @@ struct log_target {
|
|||
void (*output) (struct log_target *target, unsigned int level,
|
||||
const char *string);
|
||||
|
||||
/*! \brief alternative call-back function to which the logging
|
||||
/*! alternative call-back function to which the logging
|
||||
* framework passes the unfortmatted input arguments,
|
||||
* i.e. bypassing the internal string formatter
|
||||
* \param[in] target logging target
|
||||
|
|
|
@ -33,33 +33,33 @@
|
|||
|
||||
#define MSGB_DEBUG
|
||||
|
||||
/*! \brief Osmocom message buffer */
|
||||
/*! Osmocom message buffer */
|
||||
struct msgb {
|
||||
struct llist_head list; /*!< \brief linked list header */
|
||||
struct llist_head list; /*!< linked list header */
|
||||
|
||||
|
||||
/* Part of which TRX logical channel we were received / transmitted */
|
||||
/* FIXME: move them into the control buffer */
|
||||
union {
|
||||
void *dst; /*!< \brief reference of origin/destination */
|
||||
void *dst; /*!< reference of origin/destination */
|
||||
struct gsm_bts_trx |