diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2017-06-30 11:12:18 +0200 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2017-06-30 11:12:18 +0200 |
commit | e2b37af93a084abf57c496938746cc66e65c120f (patch) | |
tree | 0a3e9dc4583dc0bdbd09a6422f7cf1cf05b0878a /openbsc/include | |
parent | 9244306db501a2e94a43861b67f619d4a4b8a958 (diff) |
reset: fix allocation and add deallocator for reset procedure
When the reset is started, state machines are allocated. The user
must provide a correctly filled structure where the reset start
function adds the state machine into.
This is prone to errors, besides of that, a proper deallocator
function which tears down the osmo fsm is missing.
make a more cofmortable allocator function and add deallocator
function.
Diffstat (limited to 'openbsc/include')
-rw-r--r-- | openbsc/include/openbsc/a_reset.h | 5 | ||||
-rw-r--r-- | openbsc/include/openbsc/bsc_msc.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/a_reset.h b/openbsc/include/openbsc/a_reset.h index 124cf13f1..343454a28 100644 --- a/openbsc/include/openbsc/a_reset.h +++ b/openbsc/include/openbsc/a_reset.h @@ -45,7 +45,10 @@ struct a_reset_ctx { }; /* Create and start state machine which handles the reset/reset-ack procedure */ -void a_reset_start(struct a_reset_ctx *reset); +struct a_reset_ctx *a_reset_alloc(void *ctx, char *name, void *cb, void *priv); + +/* Tear down state machine */ +void a_reset_free(struct a_reset_ctx *reset); /* Confirm that we sucessfully received a reset acknowlege message */ void a_reset_ack_confirm(struct a_reset_ctx *reset); diff --git a/openbsc/include/openbsc/bsc_msc.h b/openbsc/include/openbsc/bsc_msc.h index a7c881b84..380eb17c1 100644 --- a/openbsc/include/openbsc/bsc_msc.h +++ b/openbsc/include/openbsc/bsc_msc.h @@ -61,7 +61,7 @@ struct bsc_msc_connection { struct osmo_sccp_user *sccp_user; struct osmo_sccp_addr g_calling_addr; struct osmo_sccp_addr g_called_addr; - struct a_reset_ctx reset; + struct a_reset_ctx *reset; int conn_id_counter; }; |