lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/38413?usp=email )
Change subject: vlr: vlr_auth_fsm: make the fsm instance private ......................................................................
vlr: vlr_auth_fsm: make the fsm instance private
Like all the other libvlr fsm, they are private to their own files, keep the vlr_auth_fsm the same and be consistant.
Change-Id: Iec85f299cd99879475ab094998433d935e980394 --- M src/libvlr/vlr.c M src/libvlr/vlr_auth_fsm.c M src/libvlr/vlr_auth_fsm.h 3 files changed, 15 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/13/38413/1
diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index 65cbad6..50b60c5 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -1545,7 +1545,7 @@ osmo_tdefs_reset(msc_tdefs_vlr);
/* osmo_auth_fsm.c */ - OSMO_ASSERT(osmo_fsm_register(&vlr_auth_fsm) == 0); + vlr_auth_fsm_init(); /* osmo_lu_fsm.c */ vlr_lu_fsm_init(); /* vlr_access_request_fsm.c */ @@ -1693,7 +1693,7 @@
switch (logc) { case OSMO_VLR_LOGC_VLR: - vlr_auth_fsm.log_subsys = logc_num; + vlr_auth_fsm_set_loglevel(logc_num); vlr_lu_fsm_set_loglevel(logc_num); break; case OSMO_VLR_LOGC_SGS: diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c index 07e6e9e..2a806e0 100644 --- a/src/libvlr/vlr_auth_fsm.c +++ b/src/libvlr/vlr_auth_fsm.c @@ -603,7 +603,7 @@ }, };
-struct osmo_fsm vlr_auth_fsm = { +static struct osmo_fsm vlr_auth_fsm = { .name = "VLR_Authenticate", .states = auth_fsm_states, .num_states = ARRAY_SIZE(auth_fsm_states), @@ -614,6 +614,16 @@ .cleanup = auth_fsm_cleanup, };
+void vlr_auth_fsm_init(void) +{ + OSMO_ASSERT(osmo_fsm_register(&vlr_auth_fsm) == 0); +} + +void vlr_auth_fsm_set_loglevel(int log_level) +{ + vlr_auth_fsm.log_subsys = log_level; +} + /*********************************************************************** * User API (for SGSN/MSC code) ***********************************************************************/ diff --git a/src/libvlr/vlr_auth_fsm.h b/src/libvlr/vlr_auth_fsm.h index 441a8ca..bb4e192 100644 --- a/src/libvlr/vlr_auth_fsm.h +++ b/src/libvlr/vlr_auth_fsm.h @@ -29,8 +29,6 @@ VLR_AUTH_E_MS_ID_IMSI, };
-extern struct osmo_fsm vlr_auth_fsm; - struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, struct osmo_fsm_inst *parent, uint32_t parent_event_success, @@ -39,4 +37,6 @@ bool is_r99, bool is_utran);
+void vlr_auth_fsm_init(void); +void vlr_auth_fsm_set_loglevel(int log_level); bool auth_try_reuse_tuple(struct vlr_subscr *vsub, uint8_t key_seq);