diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2018-08-07 11:31:51 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-08-07 15:11:41 +0000 |
commit | 628a05e738b5f37e2fecd544780240e56db54036 (patch) | |
tree | 6f6d89d30b77177980ed5a01c00057dc6f05d32a /include | |
parent | bf4e29a7dff6e3b5ce9e4da150b8b1dfce86be83 (diff) |
GSCON: call api of a_reset.c with msc object directly
The API of a_reset.c is currently called with a pointer to struct
reset_ctx. This puts the responsibility of checking the presence of
msc->a.reset_fsm to the caller. It would be much more effective if the
caller would check if msc->a.reset_fsm before dereferencing it.
This also fixes at least one segfault that ocurrs when gscon_timer_cb()
is called but no sccp connection is present yet. Therefore the pointer
to bsc_msc_data would not be populated. This is now detected by
a_reset.c itsself.
- minor code cleanups
- call a_reset.c functions with msc (struct bsc_msc_data)
Change-Id: I0802aaadf0af4e58e41c98999e8c6823838adb61
Related: OS#3447
Diffstat (limited to 'include')
-rw-r--r-- | include/osmocom/bsc/a_reset.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/osmocom/bsc/a_reset.h b/include/osmocom/bsc/a_reset.h index 6b6ce814a..a09972e18 100644 --- a/include/osmocom/bsc/a_reset.h +++ b/include/osmocom/bsc/a_reset.h @@ -20,17 +20,19 @@ #pragma once +struct bsc_msc_data; + /* Create and start state machine which handles the reset/reset-ack procedure */ -struct osmo_fsm_inst *a_reset_alloc(void *ctx, const char *name, void *cb, void *priv); +void a_reset_alloc(struct bsc_msc_data *msc, const char *name, void *cb); /* Confirm that we sucessfully received a reset acknowlege message */ -void a_reset_ack_confirm(struct osmo_fsm_inst *reset_fsm); +void a_reset_ack_confirm(struct bsc_msc_data *msc); /* Report a failed connection */ -void a_reset_conn_fail(struct osmo_fsm_inst *reset_fsm); +void a_reset_conn_fail(struct bsc_msc_data *msc); /* Report a successful connection */ -void a_reset_conn_success(struct osmo_fsm_inst *reset_fsm); +void a_reset_conn_success(struct bsc_msc_data *msc); /* Check if we have a connection to a specified msc */ -bool a_reset_conn_ready(struct osmo_fsm_inst *reset_fsm); +bool a_reset_conn_ready(struct bsc_msc_data *msc); |