move osmo_fsm_register() of fsm into constructor of l2tp_fsm.c

This commit is contained in:
Alexander Couzens 2016-12-05 13:30:10 +01:00 committed by Harald Welte
parent 923f4c9f1c
commit c41a310fe2
2 changed files with 8 additions and 4 deletions

View File

@ -83,10 +83,6 @@ int main(int argc, char **argv)
l2tpd_log_init();
/* register fsms */
osmo_fsm_register(&l2tp_cc_fsm);
osmo_fsm_register(&l2tp_ic_fsm);
osmo_fsm_register(&l2tp_conf_fsm);
l2i = talloc_zero(tall_l2tp_ctx, struct l2tpd_instance);
l2i->cfg.bind_ip = "0.0.0.0";

View File

@ -361,3 +361,11 @@ struct osmo_fsm l2tp_ic_fsm = {
.allstate_event_mask = S(L2IC_E_RX_CDN) | S(L2IC_E_LOCAL_CLOSE_REQ),
.allstate_action = l2tp_ic_allstate,
};
static __attribute__((constructor)) void l2tp_fsm_init(void)
{
/* register fsms */
osmo_fsm_register(&l2tp_cc_fsm);
osmo_fsm_register(&l2tp_ic_fsm);
osmo_fsm_register(&l2tp_conf_fsm);
}