diff options
author | Harald Welte <laforge@osmocom.org> | 2020-12-21 12:34:46 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-12-21 15:45:45 +0100 |
commit | 4eb0f16e252dd76fa7009e85aba0f17fd69f445a (patch) | |
tree | 5ca3fe4acc6fc81df694ebca6298dd5d3e1a4ee2 /include/osmocom/core | |
parent | b8de188b5432aa8ae832e5150a4fe26342461336 (diff) |
fsm: Add osmo_fsm_inst_broadcast_children()
This is a helper function to broadcast an event to all of the
siblings of a specified FSM instance.
Change-Id: I2ce398741a8672d7b7c4058d056f46e2fe7353c1
Diffstat (limited to 'include/osmocom/core')
-rw-r--r-- | include/osmocom/core/fsm.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index 7b262c71..77ebe7c1 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -326,4 +326,15 @@ void _osmo_fsm_inst_term_children(struct osmo_fsm_inst *fi, void *data, const char *file, int line); +/*! dispatch an event to all children of an osmocom finite state machine instance + * + * This is a macro that calls _osmo_fsm_inst_broadcast_children() with the given + * parameters as well as the caller's source file and line number for logging + * purposes. See there for documentation. + */ +#define osmo_fsm_inst_broadcast_children(fi, cause, data) \ + _osmo_fsm_inst_broadcast_children(fi, cause, data, __FILE__, __LINE__) +void _osmo_fsm_inst_broadcast_children(struct osmo_fsm_inst *fi, uint32_t event, + void *data, const char *file, int line); + /*! @} */ |