97 #define osmo_tdef_for_each(t, tdefs) \ 98 for (t = tdefs; t && (t->T || t->default_val || t->desc); t++) 102 long val_if_not_present);
159 #define osmo_tdef_fsm_inst_state_chg(fi, state, timeouts_array, tdefs, default_timeout) \ 160 _osmo_tdef_fsm_inst_state_chg(fi, state, timeouts_array, tdefs, default_timeout, \ 165 const char *
file,
int line);
181 #define osmo_tdef_groups_for_each(g, tdef_groups) \ 182 for (g = tdef_groups; g && g->tdefs; g++) unsigned long val
Currently active timeout value, e.g.
Definition: tdef.h:79
int osmo_tdef_set(struct osmo_tdef *tdefs, int T, unsigned long val, enum osmo_tdef_unit val_unit)
Set value in entry matching T, converting val from val_unit to unit of T.
Definition: tdef.c:230
static const char * osmo_tdef_unit_name(enum osmo_tdef_unit val)
Definition: tdef.h:47
const char * get_value_string(const struct value_string *vs, uint32_t val)
get human-readable string for given value
Definition: utils.c:58
unsigned long osmo_tdef_get(const struct osmo_tdef *tdefs, int T, enum osmo_tdef_unit as_unit, long val_if_not_present)
Return the value of a T timer from a list of osmo_tdef, in the given unit.
Definition: tdef.c:195
int osmo_tdef_range_str_buf(char *buf, size_t buf_len, struct osmo_tdef *t)
Write string representation of osmo_tdef range into buf.
Definition: tdef.c:263
const struct osmo_tdef_state_timeout * osmo_tdef_get_state_timeout(uint32_t state, const struct osmo_tdef_state_timeout *timeouts_array)
Using osmo_tdef for osmo_fsm_inst: find a given state's osmo_tdef_state_timeout entry.
Definition: tdef.c:307
most T are in seconds, keep 0 as default.
Definition: tdef.h:39
bool keep_timer
If true, call osmo_fsm_inst_state_chg_keep_timer().
Definition: tdef.h:117
minutes
Definition: tdef.h:41
A mapping between human-readable string and numeric value.
Definition: utils.h:42
enum osmo_tdef_unit unit
Definition: tdef.h:73
const unsigned long default_val
Timeout duration (according to unit), default value; type corresponds to osmo_fsm_inst_state_chg()'s ...
Definition: tdef.h:72
write Write running configuration to or terminal n Write configuration to the file(same as write file)\n") ALIAS(config_write_file
Manage timer definitions in named groups.
Definition: tdef.h:171
const char * desc
Definition: tdef.h:173
milliseconds
Definition: tdef.h:40
const char * desc
Human readable description.
Definition: tdef.h:76
struct osmo_tdef * tdefs
Definition: tdef.h:174
a single instanceof an osmocom finite state machine
Definition: fsm.h:87
osmo_tdef_unit
Definition: tdef.h:38
Using osmo_tdef for osmo_fsm_inst: array entry for a mapping of state numbers to timeout definitions...
Definition: tdef.h:110
const char * name
Definition: tdef.h:172
unspecified unit, explained in osmo_tdef.desc.
Definition: tdef.h:42
void osmo_tdefs_reset(struct osmo_tdef *tdefs)
Set all osmo_tdef values to the default_val.
Definition: tdef.c:143
unsigned long min_val
Minimum timer value (in this tdef unit), checked if set (not zero).
Definition: tdef.h:81
const int T
T1234 or X1234 number, corresponding to struct osmo_fsm_inst::T.
Definition: tdef.h:69
struct osmo_tdef * osmo_tdef_get_entry(struct osmo_tdef *tdefs, int T)
Find tdef entry matching T.
Definition: tdef.c:212
int _osmo_tdef_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t state, const struct osmo_tdef_state_timeout *timeouts_array, const struct osmo_tdef *tdefs, unsigned long default_timeout, const char *file, int line)
See invocation macro osmo_tdef_fsm_inst_state_chg() instead.
Definition: tdef.c:321
Define a GSM timer of the form Tnnn, with unit, default value and doc string.
Definition: tdef.h:64
int T
Timer number to match struct osmo_tdef.T, and to pass to osmo_fsm_inst_state_chg().
Definition: tdef.h:114
bool osmo_tdef_val_in_range(struct osmo_tdef *tdef, unsigned long new_val)
Check if value new_val is in range of valid possible values for timer entry tdef. ...
Definition: tdef.c:250
unsigned long max_val
Maximum timer value (in this tdef unit), checked if set (not zero).
Definition: tdef.h:83
const struct value_string osmo_tdef_unit_names[]
Definition: tdef.c:349