From: Pablo Neira Ayuso pablo@gnumonks.org
This patch gets openBSC in sync with the namespace pollution fixes available in the libosmocore pablo/namespace branch.
See: [PATCH 0/5] libosmocore: namespace pollution fixes (1/*) 2nd try For further details.
You can find this changes in the pablo/namespace branch. Please, merge it!
Pablo Neira Ayuso (5): src: use namespace prefix osmo_timer* for timer functions src: use namespace prefix osmo_fd* and osmo_select* src: use namespace prefix osmo_signal* src: use namespace prefix osmo_wqueue* src: use namespace prefix osmo_counter*
openbsc/doc/e1-data-model.txt | 2 +- openbsc/include/openbsc/bsc_msc.h | 6 +- openbsc/include/openbsc/bsc_nat.h | 32 ++++++------ openbsc/include/openbsc/db.h | 4 +- openbsc/include/openbsc/e1_input.h | 8 ++-- openbsc/include/openbsc/gprs_llc.h | 4 +- openbsc/include/openbsc/gprs_ns.h | 6 +- openbsc/include/openbsc/gprs_sgsn.h | 4 +- openbsc/include/openbsc/gsm_data.h | 76 ++++++++++++++-------------- openbsc/include/openbsc/ipaccess.h | 4 +- openbsc/include/openbsc/mgcp.h | 2 +- openbsc/include/openbsc/mgcp_internal.h | 4 +- openbsc/include/openbsc/osmo_bsc.h | 4 +- openbsc/include/openbsc/osmo_bsc_rf.h | 10 ++-- openbsc/include/openbsc/osmo_msc_data.h | 6 +- openbsc/include/openbsc/paging.h | 2 +- openbsc/include/openbsc/rtp_proxy.h | 2 +- openbsc/include/openbsc/sgsn.h | 8 ++-- openbsc/include/openbsc/socket.h | 4 +- openbsc/include/openbsc/transaction.h | 4 +- openbsc/src/gprs/gb_proxy_main.c | 6 +- openbsc/src/gprs/gprs_gmm.c | 18 +++--- openbsc/src/gprs/gprs_sndcp.h | 2 +- openbsc/src/gprs/sgsn_libgtp.c | 10 ++-- openbsc/src/gprs/sgsn_main.c | 4 +- openbsc/src/ipaccess/ipaccess-config.c | 6 +- openbsc/src/ipaccess/ipaccess-find.c | 16 +++--- openbsc/src/ipaccess/ipaccess-proxy.c | 72 ++++++++++++++-------------- openbsc/src/ipaccess/network_listen.c | 4 +- openbsc/src/libabis/e1_input.c | 12 ++-- openbsc/src/libabis/input/dahdi.c | 22 ++++---- openbsc/src/libabis/input/hsl.c | 24 +++++----- openbsc/src/libabis/input/ipaccess.c | 58 +++++++++++----------- openbsc/src/libabis/input/lapd.c | 8 ++-- openbsc/src/libabis/input/misdn.c | 18 +++--- openbsc/src/libbsc/abis_nm.c | 20 ++++---- openbsc/src/libbsc/abis_om2000.c | 6 +- openbsc/src/libbsc/abis_rsl.c | 26 +++++----- openbsc/src/libbsc/bsc_api.c | 14 +++--- openbsc/src/libbsc/bsc_init.c | 10 ++-- openbsc/src/libbsc/bsc_msc.c | 36 +++++++------- openbsc/src/libbsc/bsc_rll.c | 10 ++-- openbsc/src/libbsc/bsc_vty.c | 18 +++--- openbsc/src/libbsc/bts_ericsson_rbs2000.c | 6 +- openbsc/src/libbsc/bts_hsl_femtocell.c | 2 +- openbsc/src/libbsc/bts_ipaccess_nanobts.c | 2 +- openbsc/src/libbsc/bts_siemens_bs11.c | 4 +- openbsc/src/libbsc/chan_alloc.c | 14 +++--- openbsc/src/libbsc/gsm_04_08_utils.c | 2 +- openbsc/src/libbsc/handover_decision.c | 2 +- openbsc/src/libbsc/handover_logic.c | 26 +++++----- openbsc/src/libbsc/meas_proc.c | 2 +- openbsc/src/libbsc/paging.c | 20 ++++---- openbsc/src/libcommon/gsm_data.c | 60 +++++++++++----------- openbsc/src/libcommon/socket.c | 6 +- openbsc/src/libgb/gprs_ns.c | 36 +++++++------- openbsc/src/libgb/gprs_ns_frgre.c | 10 ++-- openbsc/src/libmgcp/mgcp_network.c | 24 +++++----- openbsc/src/libmsc/db.c | 2 +- openbsc/src/libmsc/gsm_04_08.c | 48 +++++++++--------- openbsc/src/libmsc/gsm_04_11.c | 22 ++++---- openbsc/src/libmsc/gsm_subscriber.c | 6 +- openbsc/src/libmsc/mncc_sock.c | 28 +++++----- openbsc/src/libmsc/rrlp.c | 4 +- openbsc/src/libmsc/silent_call.c | 4 +- openbsc/src/libmsc/sms_queue.c | 16 +++--- openbsc/src/libmsc/token_auth.c | 4 +- openbsc/src/libmsc/vty_interface_layer3.c | 46 +++++++++--------- openbsc/src/libtrau/rtp_proxy.c | 14 +++--- openbsc/src/osmo-bsc/osmo_bsc_audio.c | 2 +- openbsc/src/osmo-bsc/osmo_bsc_grace.c | 2 +- openbsc/src/osmo-bsc/osmo_bsc_main.c | 4 +- openbsc/src/osmo-bsc/osmo_bsc_msc.c | 30 ++++++------ openbsc/src/osmo-bsc/osmo_bsc_rf.c | 38 +++++++------- openbsc/src/osmo-bsc/osmo_bsc_sccp.c | 14 +++--- openbsc/src/osmo-bsc_mgcp/mgcp_main.c | 6 +- openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c | 12 ++-- openbsc/src/osmo-bsc_nat/bsc_nat.c | 48 +++++++++--------- openbsc/src/osmo-bsc_nat/bsc_nat_utils.c | 22 ++++---- openbsc/src/osmo-bsc_nat/bsc_nat_vty.c | 10 ++-- openbsc/src/osmo-bsc_nat/bsc_sccp.c | 2 +- openbsc/src/osmo-bsc_nat/bsc_ussd.c | 20 ++++---- openbsc/src/osmo-nitb/bsc_hack.c | 14 +++--- openbsc/src/utils/bs11_config.c | 8 ++-- openbsc/src/utils/rs232.c | 12 ++-- openbsc/tests/channel/channel_test.c | 2 +- 86 files changed, 634 insertions(+), 634 deletions(-)
From: Pablo Neira Ayuso pablo@gnumonks.org
Summary of changes:
s/struct timer_list/struct osmo_timer_list/g s/bsc_add_timer/osmo_timer_add/g s/bsc_schedule_timer/osmo_timer_schedule/g s/bsc_del_timer/osmo_timer_del/g s/bsc_timer_pending/osmo_timer_pending/g s/bsc_nearest_timer/osmo_timers_nearest/g s/bsc_prepare_timers/osmo_timers_prepare/g s/bsc_update_timers/osmo_timers_update/g s/bsc_timer_check/osmo_timers_check/g --- openbsc/include/openbsc/bsc_msc.h | 4 ++-- openbsc/include/openbsc/bsc_nat.h | 8 ++++---- openbsc/include/openbsc/e1_input.h | 2 +- openbsc/include/openbsc/gprs_llc.h | 4 ++-- openbsc/include/openbsc/gprs_ns.h | 2 +- openbsc/include/openbsc/gprs_sgsn.h | 4 ++-- openbsc/include/openbsc/gsm_data.h | 16 ++++++++-------- openbsc/include/openbsc/osmo_bsc.h | 4 ++-- openbsc/include/openbsc/osmo_bsc_rf.h | 6 +++--- openbsc/include/openbsc/osmo_msc_data.h | 4 ++-- openbsc/include/openbsc/paging.h | 2 +- openbsc/include/openbsc/sgsn.h | 2 +- openbsc/include/openbsc/transaction.h | 4 ++-- openbsc/src/gprs/gprs_gmm.c | 18 +++++++++--------- openbsc/src/gprs/gprs_sndcp.h | 2 +- openbsc/src/gprs/sgsn_libgtp.c | 2 +- openbsc/src/ipaccess/ipaccess-find.c | 6 +++--- openbsc/src/ipaccess/ipaccess-proxy.c | 8 ++++---- openbsc/src/libabis/e1_input.c | 6 +++--- openbsc/src/libabis/input/dahdi.c | 2 +- openbsc/src/libabis/input/hsl.c | 2 +- openbsc/src/libabis/input/ipaccess.c | 2 +- openbsc/src/libabis/input/lapd.c | 8 ++++---- openbsc/src/libabis/input/misdn.c | 2 +- openbsc/src/libbsc/abis_rsl.c | 10 +++++----- openbsc/src/libbsc/bsc_api.c | 12 ++++++------ openbsc/src/libbsc/bsc_msc.c | 8 ++++---- openbsc/src/libbsc/bsc_rll.c | 8 ++++---- openbsc/src/libbsc/chan_alloc.c | 8 ++++---- openbsc/src/libbsc/handover_logic.c | 10 +++++----- openbsc/src/libbsc/paging.c | 14 +++++++------- openbsc/src/libgb/gprs_ns.c | 12 ++++++------ openbsc/src/libmsc/gsm_04_08.c | 14 +++++++------- openbsc/src/libmsc/gsm_04_11.c | 10 +++++----- openbsc/src/libmsc/sms_queue.c | 12 ++++++------ openbsc/src/osmo-bsc/osmo_bsc_msc.c | 10 +++++----- openbsc/src/osmo-bsc/osmo_bsc_rf.c | 16 ++++++++-------- openbsc/src/osmo-bsc/osmo_bsc_sccp.c | 12 ++++++------ openbsc/src/osmo-bsc_nat/bsc_nat.c | 22 +++++++++++----------- openbsc/src/osmo-bsc_nat/bsc_ussd.c | 6 +++--- openbsc/src/osmo-nitb/bsc_hack.c | 6 +++--- openbsc/src/utils/bs11_config.c | 4 ++-- 42 files changed, 157 insertions(+), 157 deletions(-)
diff --git a/openbsc/include/openbsc/bsc_msc.h b/openbsc/include/openbsc/bsc_msc.h index e3653ac..88f0de4 100644 --- a/openbsc/include/openbsc/bsc_msc.h +++ b/openbsc/include/openbsc/bsc_msc.h @@ -44,8 +44,8 @@ struct bsc_msc_connection {
void (*connection_loss) (struct bsc_msc_connection *); void (*connected) (struct bsc_msc_connection *); - struct timer_list reconnect_timer; - struct timer_list timeout_timer; + struct osmo_timer_list reconnect_timer; + struct osmo_timer_list timeout_timer; };
struct bsc_msc_connection *bsc_msc_create(void *ctx, struct llist_head *dest); diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index 19f8efa..7d8c37e 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -82,11 +82,11 @@ struct bsc_connection { struct bsc_config *cfg;
/* a timeout node */ - struct timer_list id_timeout; + struct osmo_timer_list id_timeout;
/* pong timeout */ - struct timer_list ping_timeout; - struct timer_list pong_timeout; + struct osmo_timer_list ping_timeout; + struct osmo_timer_list pong_timeout;
/* mgcp related code */ char *_endpoint_status; @@ -290,7 +290,7 @@ struct bsc_nat_ussd_con { struct bsc_nat *nat; int authorized;
- struct timer_list auth_timeout; + struct osmo_timer_list auth_timeout; };
/* create and init the structures */ diff --git a/openbsc/include/openbsc/e1_input.h b/openbsc/include/openbsc/e1_input.h index 8a966ad..cd8abca 100644 --- a/openbsc/include/openbsc/e1_input.h +++ b/openbsc/include/openbsc/e1_input.h @@ -69,7 +69,7 @@ struct e1inp_ts { /* delay for the queue */ int delay; /* timer when to dequeue next frame */ - struct timer_list tx_timer; + struct osmo_timer_list tx_timer; } sign; struct { /* subchannel demuxer for frames from E1 */ diff --git a/openbsc/include/openbsc/gprs_llc.h b/openbsc/include/openbsc/gprs_llc.h index 02945e1..9f17605 100644 --- a/openbsc/include/openbsc/gprs_llc.h +++ b/openbsc/include/openbsc/gprs_llc.h @@ -99,8 +99,8 @@ struct gprs_llc_lle {
enum gprs_llc_lle_state state;
- struct timer_list t200; - struct timer_list t201; /* wait for acknowledgement */ + struct osmo_timer_list t200; + struct osmo_timer_list t201; /* wait for acknowledgement */
uint16_t v_sent; uint16_t v_ack; diff --git a/openbsc/include/openbsc/gprs_ns.h b/openbsc/include/openbsc/gprs_ns.h index 0b50149..f497e23 100644 --- a/openbsc/include/openbsc/gprs_ns.h +++ b/openbsc/include/openbsc/gprs_ns.h @@ -163,7 +163,7 @@ struct gprs_nsvc { uint32_t state; uint32_t remote_state;
- struct timer_list timer; + struct osmo_timer_list timer; enum nsvc_timer_mode timer_mode; int alive_retries;
diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h index bd60d4e..5023d06 100644 --- a/openbsc/include/openbsc/gprs_sgsn.h +++ b/openbsc/include/openbsc/gprs_sgsn.h @@ -102,7 +102,7 @@ struct sgsn_mm_ctx { uint16_t nsei; uint16_t bvci; struct rate_ctr_group *ctrg; - struct timer_list timer; + struct osmo_timer_list timer; unsigned int T; /* Txxxx number */ unsigned int num_T_exp; /* number of consecutive T expirations */
@@ -168,7 +168,7 @@ struct sgsn_pdp_ctx { //uint32_t charging_id; int reordering_reqd;
- struct timer_list timer; + struct osmo_timer_list timer; unsigned int T; /* Txxxx number */ unsigned int num_T_exp; /* number of consecutive T expirations */ }; diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 31044ec..e6d6467 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -177,7 +177,7 @@ struct gsm_nm_state { * - Accept/Reject according to global policy */ struct gsm_loc_updating_operation { - struct timer_list updating_timer; + struct osmo_timer_list updating_timer; unsigned int waiting_for_imsi : 1; unsigned int waiting_for_imei : 1; unsigned int key_seq : 4; @@ -197,7 +197,7 @@ struct gsm_security_operation { * a couple of seconds to work around MSC issues. */ struct gsm_anchor_operation { - struct timer_list timeout; + struct osmo_timer_list timeout; };
/* Maximum number of neighbor cells whose average we track */ @@ -263,7 +263,7 @@ struct gsm_subscriber_connection { struct gsm_bts *bts;
/* for assignment handling */ - struct timer_list T10; + struct osmo_timer_list T10; struct gsm_lchan *secondary_lchan;
}; @@ -291,9 +291,9 @@ struct gsm_lchan { uint8_t key[MAX_A5_KEY_LEN]; } encr;
- struct timer_list T3101; - struct timer_list T3111; - struct timer_list error_timer; + struct osmo_timer_list T3101; + struct osmo_timer_list T3111; + struct osmo_timer_list error_timer;
/* AMR bits */ struct gsm48_multi_rate_conf mr_conf; @@ -464,8 +464,8 @@ struct gsm_bts_paging_state { struct llist_head pending_requests; struct gsm_bts *bts;
- struct timer_list work_timer; - struct timer_list credit_timer; + struct osmo_timer_list work_timer; + struct osmo_timer_list credit_timer;
/* free chans needed */ int free_chans_need; diff --git a/openbsc/include/openbsc/osmo_bsc.h b/openbsc/include/openbsc/osmo_bsc.h index ef0f11a..2620147 100644 --- a/openbsc/include/openbsc/osmo_bsc.h +++ b/openbsc/include/openbsc/osmo_bsc.h @@ -16,8 +16,8 @@ struct osmo_bsc_sccp_con { /* SCCP connection realted */ struct sccp_connection *sccp; struct bsc_msc_connection *msc_con; - struct timer_list sccp_it_timeout; - struct timer_list sccp_cc_timeout; + struct osmo_timer_list sccp_it_timeout; + struct osmo_timer_list sccp_cc_timeout;
struct llist_head sccp_queue; unsigned int sccp_queue_size; diff --git a/openbsc/include/openbsc/osmo_bsc_rf.h b/openbsc/include/openbsc/osmo_bsc_rf.h index 7de9866..f1ff9ba 100644 --- a/openbsc/include/openbsc/osmo_bsc_rf.h +++ b/openbsc/include/openbsc/osmo_bsc_rf.h @@ -16,13 +16,13 @@ struct osmo_bsc_rf {
/* delay the command */ char last_request; - struct timer_list delay_cmd; + struct osmo_timer_list delay_cmd;
/* verify that RF is up as it should be */ - struct timer_list rf_check; + struct osmo_timer_list rf_check;
/* some handling for the automatic grace switch */ - struct timer_list grace_timeout; + struct osmo_timer_list grace_timeout; };
struct osmo_bsc_rf_conn { diff --git a/openbsc/include/openbsc/osmo_msc_data.h b/openbsc/include/openbsc/osmo_msc_data.h index f360da5..495c923 100644 --- a/openbsc/include/openbsc/osmo_msc_data.h +++ b/openbsc/include/openbsc/osmo_msc_data.h @@ -43,8 +43,8 @@ struct osmo_msc_data { char *bsc_token; int ping_timeout; int pong_timeout; - struct timer_list ping_timer; - struct timer_list pong_timer; + struct osmo_timer_list ping_timer; + struct osmo_timer_list pong_timer; struct bsc_msc_connection *msc_con; int core_ncc; int core_mcc; diff --git a/openbsc/include/openbsc/paging.h b/openbsc/include/openbsc/paging.h index 991c4ec..0872eb8 100644 --- a/openbsc/include/openbsc/paging.h +++ b/openbsc/include/openbsc/paging.h @@ -43,7 +43,7 @@ struct gsm_paging_request { int chan_type;
/* Timer 3113: how long do we try to page? */ - struct timer_list T3113; + struct osmo_timer_list T3113;
/* How often did we ask the BTS to page? */ int attempts; diff --git a/openbsc/include/openbsc/sgsn.h b/openbsc/include/openbsc/sgsn.h index 53d3c05..00e1ec3 100644 --- a/openbsc/include/openbsc/sgsn.h +++ b/openbsc/include/openbsc/sgsn.h @@ -25,7 +25,7 @@ struct sgsn_instance { struct bsc_fd gtp_fd1c; struct bsc_fd gtp_fd1u; /* Timer for libGTP */ - struct timer_list gtp_timer; + struct osmo_timer_list gtp_timer; /* GSN instance for libgtp */ struct gsn_t *gsn; }; diff --git a/openbsc/include/openbsc/transaction.h b/openbsc/include/openbsc/transaction.h index 5f11ef2..c008a96 100644 --- a/openbsc/include/openbsc/transaction.h +++ b/openbsc/include/openbsc/transaction.h @@ -41,14 +41,14 @@ struct gsm_trans { /* current timer and message queue */ int Tcurrent; /* current CC timer */ int T308_second; /* used to send release again */ - struct timer_list timer; + struct osmo_timer_list timer; struct gsm_mncc msg; /* stores setup/disconnect/release message */ } cc; struct { uint8_t link_id; /* RSL Link ID to be used for this trans */ int is_mt; /* is this a MO (0) or MT (1) transfer */ enum gsm411_cp_state cp_state; - struct timer_list cp_timer; + struct osmo_timer_list cp_timer;
enum gsm411_rp_state rp_state;
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 7fd8641..a49900e 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -208,7 +208,7 @@ static void mmctx_timer_cb(void *_mm); static void mmctx_timer_start(struct sgsn_mm_ctx *mm, unsigned int T, unsigned int seconds) { - if (bsc_timer_pending(&mm->timer)) + if (osmo_timer_pending(&mm->timer)) LOGP(DMM, LOGL_ERROR, "Starting MM timer %u while old " "timer %u pending\n", T, mm->T); mm->T = T; @@ -218,7 +218,7 @@ static void mmctx_timer_start(struct sgsn_mm_ctx *mm, unsigned int T, mm->timer.data = mm; mm->timer.cb = &mmctx_timer_cb;
- bsc_schedule_timer(&mm->timer, seconds, 0); + osmo_timer_schedule(&mm->timer, seconds, 0); }
static void mmctx_timer_stop(struct sgsn_mm_ctx *mm, unsigned int T) @@ -226,7 +226,7 @@ static void mmctx_timer_stop(struct sgsn_mm_ctx *mm, unsigned int T) if (mm->T != T) LOGP(DMM, LOGL_ERROR, "Stopping MM timer %u but " "%u is running\n", T, mm->T); - bsc_del_timer(&mm->timer); + osmo_timer_del(&mm->timer); }
/* Send a message through the underlying layer */ @@ -1087,7 +1087,7 @@ static void mmctx_timer_cb(void *_mm) /* FIXME */ break; } - bsc_schedule_timer(&mm->timer, GSM0408_T3350_SECS, 0); + osmo_timer_schedule(&mm->timer, GSM0408_T3350_SECS, 0); break; case 3360: /* waiting for AUTH AND CIPH RESP */ if (mm->num_T_exp >= 5) { @@ -1096,7 +1096,7 @@ static void mmctx_timer_cb(void *_mm) break; } /* FIXME: re-transmit the respective msg and re-start timer */ - bsc_schedule_timer(&mm->timer, GSM0408_T3360_SECS, 0); + osmo_timer_schedule(&mm->timer, GSM0408_T3360_SECS, 0); break; case 3370: /* waiting for IDENTITY RESPONSE */ if (mm->num_T_exp >= 5) { @@ -1107,7 +1107,7 @@ static void mmctx_timer_cb(void *_mm) } /* re-tranmit IDENTITY REQUEST and re-start timer */ gsm48_tx_gmm_id_req(mm, mm->t3370_id_type); - bsc_schedule_timer(&mm->timer, GSM0408_T3370_SECS, 0); + osmo_timer_schedule(&mm->timer, GSM0408_T3370_SECS, 0); break; default: LOGP(DMM, LOGL_ERROR, "timer expired in unknown mode %u\n", @@ -1122,7 +1122,7 @@ static void pdpctx_timer_cb(void *_mm); static void pdpctx_timer_start(struct sgsn_pdp_ctx *pdp, unsigned int T, unsigned int seconds) { - if (bsc_timer_pending(&pdp->timer)) + if (osmo_timer_pending(&pdp->timer)) LOGP(DMM, LOGL_ERROR, "Starting MM timer %u while old " "timer %u pending\n", T, pdp->T); pdp->T = T; @@ -1132,7 +1132,7 @@ static void pdpctx_timer_start(struct sgsn_pdp_ctx *pdp, unsigned int T, pdp->timer.data = pdp; pdp->timer.cb = &pdpctx_timer_cb;
- bsc_schedule_timer(&pdp->timer, seconds, 0); + osmo_timer_schedule(&pdp->timer, seconds, 0); }
@@ -1457,7 +1457,7 @@ static void pdpctx_timer_cb(void *_pdp) break; } gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL); - bsc_schedule_timer(&pdp->timer, GSM0408_T3395_SECS, 0); + osmo_timer_schedule(&pdp->timer, GSM0408_T3395_SECS, 0); break; default: LOGP(DMM, LOGL_ERROR, "timer expired in unknown mode %u\n", diff --git a/openbsc/src/gprs/gprs_sndcp.h b/openbsc/src/gprs/gprs_sndcp.h index ec35d7b..fef871a 100644 --- a/openbsc/src/gprs/gprs_sndcp.h +++ b/openbsc/src/gprs/gprs_sndcp.h @@ -20,7 +20,7 @@ struct defrag_state { /* linked list of defrag_queue_entry: one for each fragment */ struct llist_head frag_list;
- struct timer_list timer; + struct osmo_timer_list timer; };
/* See 6.7.1.2 Reassembly */ diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 37d976f..7e66035 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -538,7 +538,7 @@ static void sgsn_gtp_tmr_start(struct sgsn_instance *sgi) gtp_retranstimeout(sgi->gsn, &next);
/* re-schedule the timer */ - bsc_schedule_timer(&sgi->gtp_timer, next.tv_sec, next.tv_usec/1000); + osmo_timer_schedule(&sgi->gtp_timer, next.tv_sec, next.tv_usec/1000); }
/* timer callback for libgtp retransmissions and ping */ diff --git a/openbsc/src/ipaccess/ipaccess-find.c b/openbsc/src/ipaccess/ipaccess-find.c index 9335ec8..24f602e 100644 --- a/openbsc/src/ipaccess/ipaccess-find.c +++ b/openbsc/src/ipaccess/ipaccess-find.c @@ -152,7 +152,7 @@ static int bfd_cb(struct bsc_fd *bfd, unsigned int flags) return 0; }
-static struct timer_list timer; +static struct osmo_timer_list timer;
static void timer_cb(void *_data) { @@ -160,7 +160,7 @@ static void timer_cb(void *_data)
bfd->when |= BSC_FD_WRITE;
- bsc_schedule_timer(&timer, 5, 0); + osmo_timer_schedule(&timer, 5, 0); }
int main(int argc, char **argv) @@ -192,7 +192,7 @@ int main(int argc, char **argv) timer.cb = timer_cb; timer.data = &bfd;
- bsc_schedule_timer(&timer, 5, 0); + osmo_timer_schedule(&timer, 5, 0);
printf("Trying to find ip.access BTS by broadcast UDP...\n");
diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/openbsc/src/ipaccess/ipaccess-proxy.c index bb4841c..f40590a 100644 --- a/openbsc/src/ipaccess/ipaccess-proxy.c +++ b/openbsc/src/ipaccess/ipaccess-proxy.c @@ -57,7 +57,7 @@ struct ipa_proxy { /* list of BTS's (struct ipa_bts_conn */ struct llist_head bts_list; /* the BSC reconnect timer */ - struct timer_list reconn_timer; + struct osmo_timer_list reconn_timer; /* global GPRS NS data */ struct in_addr gprs_addr; struct in_addr listen_addr; @@ -657,7 +657,7 @@ static void reconn_tmr_cb(void *data) return;
reschedule: - bsc_schedule_timer(&ipp->reconn_timer, 5, 0); + osmo_timer_schedule(&ipp->reconn_timer, 5, 0); }
static void handle_dead_socket(struct bsc_fd *bfd) @@ -709,13 +709,13 @@ static void handle_dead_socket(struct bsc_fd *bfd) ipbc->bsc_oml_conn = NULL; bsc_conn = ipbc->oml_conn; /* start reconnect timer */ - bsc_schedule_timer(&ipp->reconn_timer, 5, 0); + osmo_timer_schedule(&ipp->reconn_timer, 5, 0); break; case RSL_TO_BSC: /* incoming RSL data from BSC, forward to BTS RSL */ ipbc->bsc_rsl_conn[trx_id] = NULL; bsc_conn = ipbc->rsl_conn[trx_id]; /* start reconnect timer */ - bsc_schedule_timer(&ipp->reconn_timer, 5, 0); + osmo_timer_schedule(&ipp->reconn_timer, 5, 0); break; default: bsc_conn = NULL; diff --git a/openbsc/src/libabis/e1_input.c b/openbsc/src/libabis/e1_input.c index 1a79261..d3a5cda 100644 --- a/openbsc/src/libabis/e1_input.c +++ b/openbsc/src/libabis/e1_input.c @@ -241,7 +241,7 @@ int abis_rsl_sendmsg(struct msgb *msg)
sign_link = msg->trx->rsl_link; e1i_ts = sign_link->ts; - if (!bsc_timer_pending(&e1i_ts->sign.tx_timer)) { + if (!osmo_timer_pending(&e1i_ts->sign.tx_timer)) { /* notify the driver we have something to write */ e1inp_driver = sign_link->ts->line->driver; e1inp_driver->want_write(e1i_ts); @@ -276,7 +276,7 @@ int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml) sign_link = msg->trx->bts->oml_link;
e1i_ts = sign_link->ts; - if (!bsc_timer_pending(&e1i_ts->sign.tx_timer)) { + if (!osmo_timer_pending(&e1i_ts->sign.tx_timer)) { /* notify the driver we have something to write */ e1inp_driver = sign_link->ts->line->driver; e1inp_driver->want_write(e1i_ts); @@ -471,7 +471,7 @@ void e1inp_sign_link_destroy(struct e1inp_sign_link *link) }
if (link->ts->type == E1INP_TS_TYPE_SIGN) - bsc_del_timer(&link->ts->sign.tx_timer); + osmo_timer_del(&link->ts->sign.tx_timer);
talloc_free(link); } diff --git a/openbsc/src/libabis/input/dahdi.c b/openbsc/src/libabis/input/dahdi.c index 93c8fa5..4fcd64f 100644 --- a/openbsc/src/libabis/input/dahdi.c +++ b/openbsc/src/libabis/input/dahdi.c @@ -222,7 +222,7 @@ static int handle_ts1_write(struct bsc_fd *bfd) /* set tx delay timer for next event */ e1i_ts->sign.tx_timer.cb = timeout_ts1_write; e1i_ts->sign.tx_timer.data = e1i_ts; - bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, 50000); + osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, 50000);
return 0; } diff --git a/openbsc/src/libabis/input/hsl.c b/openbsc/src/libabis/input/hsl.c index 44528dd..9ff8552 100644 --- a/openbsc/src/libabis/input/hsl.c +++ b/openbsc/src/libabis/input/hsl.c @@ -340,7 +340,7 @@ static int handle_ts1_write(struct bsc_fd *bfd) e1i_ts->sign.tx_timer.data = e1i_ts;
/* Reducing this might break the nanoBTS 900 init. */ - bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); + osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay);
return ret; } diff --git a/openbsc/src/libabis/input/ipaccess.c b/openbsc/src/libabis/input/ipaccess.c index d2572fb..95e84f6 100644 --- a/openbsc/src/libabis/input/ipaccess.c +++ b/openbsc/src/libabis/input/ipaccess.c @@ -633,7 +633,7 @@ static int handle_ts1_write(struct bsc_fd *bfd) e1i_ts->sign.tx_timer.data = e1i_ts;
/* Reducing this might break the nanoBTS 900 init. */ - bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); + osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay);
return ret; } diff --git a/openbsc/src/libabis/input/lapd.c b/openbsc/src/libabis/input/lapd.c index c8830d2..d0fab18 100644 --- a/openbsc/src/libabis/input/lapd.c +++ b/openbsc/src/libabis/input/lapd.c @@ -137,7 +137,7 @@ struct lapd_sap { int va; /* last acked by peer */ int vr; /* next expected to be received */
- struct timer_list sabme_timer; /* timer to re-transmit SABM message */ + struct osmo_timer_list sabme_timer; /* timer to re-transmit SABM message */ };
/* 3.5.2.2 Send state variable V(S) @@ -259,11 +259,11 @@ static void lapd_sap_set_state(struct lapd_tei *teip, uint8_t sapi, switch (sap->state) { case SAP_STATE_SABM_RETRANS: if (newstate != SAP_STATE_SABM_RETRANS) - bsc_del_timer(&sap->sabme_timer); + osmo_timer_del(&sap->sabme_timer); break; default: if (newstate == SAP_STATE_SABM_RETRANS) - bsc_schedule_timer(&sap->sabme_timer, SABM_INTERVAL); + osmo_timer_schedule(&sap->sabme_timer, SABM_INTERVAL); break; }
@@ -608,7 +608,7 @@ static void sabme_timer_cb(void *_sap) lapd_send_sabm(sap->tei->li, sap->tei->tei, sap->sapi);
if (sap->state == SAP_STATE_SABM_RETRANS) - bsc_schedule_timer(&sap->sabme_timer, SABM_INTERVAL); + osmo_timer_schedule(&sap->sabme_timer, SABM_INTERVAL); }
/* Start a (user-side) SAP for the specified TEI/SAPI on the LAPD instance */ diff --git a/openbsc/src/libabis/input/misdn.c b/openbsc/src/libabis/input/misdn.c index 2d52441..3c33792 100644 --- a/openbsc/src/libabis/input/misdn.c +++ b/openbsc/src/libabis/input/misdn.c @@ -246,7 +246,7 @@ static int handle_ts1_write(struct bsc_fd *bfd) /* set tx delay timer for next event */ e1i_ts->sign.tx_timer.cb = timeout_ts1_write; e1i_ts->sign.tx_timer.data = e1i_ts; - bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); + osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay);
return ret; } diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index eb6ed03..941a4ba 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -669,7 +669,7 @@ static int rsl_rf_chan_release(struct gsm_lchan *lchan, int error) rsl_lchan_set_state(lchan, LCHAN_S_REL_ERR); lchan->error_timer.data = lchan; lchan->error_timer.cb = error_timeout_cb; - bsc_schedule_timer(&lchan->error_timer, + osmo_timer_schedule(&lchan->error_timer, msg->trx->bts->network->T3111 + 2, 0); }
@@ -694,7 +694,7 @@ static int rsl_rx_rf_chan_rel_ack(struct gsm_lchan *lchan) LOGP(DRSL, LOGL_NOTICE, "%s CHAN REL ACK but state %s\n", gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); - bsc_del_timer(&lchan->T3111); + osmo_timer_del(&lchan->T3111); /* we have an error timer pending to release that */ if (lchan->state != LCHAN_S_REL_ERR) rsl_lchan_set_state(lchan, LCHAN_S_NONE); @@ -1354,7 +1354,7 @@ static int rsl_send_imm_assignment(struct gsm_lchan *lchan) /* Start timer T3101 to wait for GSM48_MT_RR_PAG_RESP */ lchan->T3101.cb = t3101_expired; lchan->T3101.data = lchan; - bsc_schedule_timer(&lchan->T3101, bts->network->T3101, 0); + osmo_timer_schedule(&lchan->T3101, bts->network->T3101, 0);
/* send IMMEDIATE ASSIGN CMD on RSL to BTS (to send on CCCH to MS) */ return rsl_imm_assign_cmd(bts, sizeof(*ia)+ia->mob_alloc_len, (uint8_t *) ia); @@ -1466,7 +1466,7 @@ static void rsl_handle_release(struct gsm_lchan *lchan) lchan->T3111.cb = t3111_expired; lchan->T3111.data = lchan; bts = lchan->ts->trx->bts; - bsc_schedule_timer(&lchan->T3111, bts->network->T3111, 0); + osmo_timer_schedule(&lchan->T3111, bts->network->T3111, 0); }
/* ESTABLISH INDICATION, LOCATION AREA UPDATE REQUEST @@ -1500,7 +1500,7 @@ static int abis_rsl_rx_rll(struct msgb *msg) DEBUGPC(DRLL, "ESTABLISH INDICATION\n"); /* lchan is established, stop T3101 */ msg->lchan->sapis[rllh->link_id & 0x7] = LCHAN_SAPI_MS; - bsc_del_timer(&msg->lchan->T3101); + osmo_timer_del(&msg->lchan->T3101); if (msgb_l2len(msg) > sizeof(struct abis_rsl_common_hdr) + sizeof(*rllh) && rllh->data[0] == RSL_IE_L3_INFO) { diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c index 4b48ec6..09e9de4 100644 --- a/openbsc/src/libbsc/bsc_api.c +++ b/openbsc/src/libbsc/bsc_api.c @@ -325,7 +325,7 @@ int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, in /* we will now start the timer to complete the assignment */ conn->T10.cb = assignment_t10_timeout; conn->T10.data = conn; - bsc_schedule_timer(&conn->T10, GSM0808_T10_VALUE); + osmo_timer_schedule(&conn->T10, GSM0808_T10_VALUE); return 0;
error: @@ -358,7 +358,7 @@ static void handle_ass_compl(struct gsm_subscriber_connection *conn, }
/* swap channels */ - bsc_del_timer(&conn->T10); + osmo_timer_del(&conn->T10);
lchan_release(conn->lchan, 0, 1); conn->lchan = conn->secondary_lchan; @@ -387,7 +387,7 @@ static void handle_ass_fail(struct gsm_subscriber_connection *conn, }
/* stop the timer and release it */ - bsc_del_timer(&conn->T10); + osmo_timer_del(&conn->T10); lchan_release(conn->secondary_lchan, 0, 1); conn->secondary_lchan = NULL;
@@ -435,7 +435,7 @@ static void dispatch_dtap(struct gsm_subscriber_connection *conn, handle_ass_fail(conn, msg); break; case GSM48_MT_RR_CHAN_MODE_MODIF_ACK: - bsc_del_timer(&conn->T10); + osmo_timer_del(&conn->T10); rc = gsm48_rx_rr_modif_ack(msg); if (rc < 0 && api->assign_fail) { api->assign_fail(conn, @@ -536,7 +536,7 @@ int gsm0808_clear(struct gsm_subscriber_connection *conn) conn->ho_lchan = NULL; conn->bts = NULL;
- bsc_del_timer(&conn->T10); + osmo_timer_del(&conn->T10);
return 0; } @@ -621,7 +621,7 @@ static void handle_release(struct gsm_subscriber_connection *conn, int destruct = 1;
if (conn->secondary_lchan == lchan) { - bsc_del_timer(&conn->T10); + osmo_timer_del(&conn->T10); conn->secondary_lchan = NULL;
bsc->assign_fail(conn, diff --git a/openbsc/src/libbsc/bsc_msc.c b/openbsc/src/libbsc/bsc_msc.c index 8eef6f4..f4eee9c 100644 --- a/openbsc/src/libbsc/bsc_msc.c +++ b/openbsc/src/libbsc/bsc_msc.c @@ -77,7 +77,7 @@ static int msc_connection_connect(struct bsc_fd *fd, unsigned int what) con = container_of(queue, struct bsc_msc_connection, write_queue);
/* From here on we will either be connected or reconnect */ - bsc_del_timer(&con->timeout_timer); + osmo_timer_del(&con->timeout_timer);
/* check the socket state */ rc = getsockopt(fd->fd, SOL_SOCKET, SO_ERROR, &val, &len); @@ -184,7 +184,7 @@ int bsc_msc_connect(struct bsc_msc_connection *con) fd->cb = msc_connection_connect; con->timeout_timer.cb = msc_con_timeout; con->timeout_timer.data = con; - bsc_schedule_timer(&con->timeout_timer, 20, 0); + osmo_timer_schedule(&con->timeout_timer, 20, 0); } else if (ret < 0) { perror("Connection failed"); connection_loss(con); @@ -226,7 +226,7 @@ struct bsc_msc_connection *bsc_msc_create(void *ctx, struct llist_head *dests) void bsc_msc_lost(struct bsc_msc_connection *con) { write_queue_clear(&con->write_queue); - bsc_del_timer(&con->timeout_timer); + osmo_timer_del(&con->timeout_timer);
if (con->write_queue.bfd.fd >= 0) bsc_unregister_fd(&con->write_queue.bfd); @@ -246,7 +246,7 @@ void bsc_msc_schedule_connect(struct bsc_msc_connection *con) LOGP(DMSC, LOGL_NOTICE, "Attempting to reconnect to the MSC.\n"); con->reconnect_timer.cb = reconnect_msc; con->reconnect_timer.data = con; - bsc_schedule_timer(&con->reconnect_timer, 5, 0); + osmo_timer_schedule(&con->reconnect_timer, 5, 0); }
struct msgb *bsc_msc_id_get_resp(const char *token) diff --git a/openbsc/src/libbsc/bsc_rll.c b/openbsc/src/libbsc/bsc_rll.c index b02394a..9fbe7c6 100644 --- a/openbsc/src/libbsc/bsc_rll.c +++ b/openbsc/src/libbsc/bsc_rll.c @@ -34,7 +34,7 @@
struct bsc_rll_req { struct llist_head list; - struct timer_list timer; + struct osmo_timer_list timer;
struct gsm_lchan *lchan; uint8_t link_id; @@ -92,7 +92,7 @@ int rll_establish(struct gsm_lchan *lchan, uint8_t sapi, rllr->timer.cb = &timer_cb; rllr->timer.data = rllr;
- bsc_schedule_timer(&rllr->timer, 10, 0); + osmo_timer_schedule(&rllr->timer, 10, 0);
/* send the RSL RLL ESTablish REQuest */ return rsl_establish_request(rllr->lchan, rllr->link_id); @@ -107,7 +107,7 @@ void rll_indication(struct gsm_lchan *lchan, uint8_t link_id, uint8_t type) llist_for_each_entry_safe(rllr, rllr2, &bsc_rll_reqs, list) { if (rllr->lchan == lchan && (rllr->link_id & LINKID_MASK) == (link_id & LINKID_MASK)) { - bsc_del_timer(&rllr->timer); + osmo_timer_del(&rllr->timer); complete_rllr(rllr, type); return; } @@ -127,7 +127,7 @@ static int rll_lchan_signal(unsigned int subsys, unsigned int signal,
llist_for_each_entry_safe(rllr, rllr2, &bsc_rll_reqs, list) { if (rllr->lchan == challoc->lchan) { - bsc_del_timer(&rllr->timer); + osmo_timer_del(&rllr->timer); complete_rllr(rllr, BSC_RLLR_IND_ERR_IND); } } diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index b794132..ff745f5 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -311,7 +311,7 @@ void lchan_free(struct gsm_lchan *lchan)
/* stop the timer */ - bsc_del_timer(&lchan->T3101); + osmo_timer_del(&lchan->T3101);
/* clear cached measuement reports */ lchan->meas_rep_idx = 0; @@ -356,9 +356,9 @@ void lchan_free(struct gsm_lchan *lchan) */ void lchan_reset(struct gsm_lchan *lchan) { - bsc_del_timer(&lchan->T3101); - bsc_del_timer(&lchan->T3111); - bsc_del_timer(&lchan->error_timer); + osmo_timer_del(&lchan->T3101); + osmo_timer_del(&lchan->T3111); + osmo_timer_del(&lchan->error_timer);
lchan->type = GSM_LCHAN_NONE; lchan->state = LCHAN_S_NONE; diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c index 976a7fd..bf9588b 100644 --- a/openbsc/src/libbsc/handover_logic.c +++ b/openbsc/src/libbsc/handover_logic.c @@ -47,7 +47,7 @@ struct bsc_handover { struct gsm_lchan *old_lchan; struct gsm_lchan *new_lchan;
- struct timer_list T3103; + struct osmo_timer_list T3103;
uint8_t ho_ref; }; @@ -170,7 +170,7 @@ void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan) if (free_lchan) lchan_release(ho->new_lchan, 0, 1);
- bsc_del_timer(&ho->T3103); + osmo_timer_del(&ho->T3103); llist_del(&ho->list); talloc_free(ho); } @@ -214,7 +214,7 @@ static int ho_chan_activ_ack(struct gsm_lchan *new_lchan) * 04.08 HANDOVER COMPLETE or 04.08 HANDOVER FAIL */ ho->T3103.cb = ho_T3103_cb; ho->T3103.data = ho; - bsc_schedule_timer(&ho->T3103, 10, 0); + osmo_timer_schedule(&ho->T3103, 10, 0);
/* create a RTP connection */ if (is_ipaccess_bts(new_lchan->ts->trx->bts)) @@ -264,7 +264,7 @@ static int ho_gsm48_ho_compl(struct gsm_lchan *new_lchan)
counter_inc(net->stats.handover.completed);
- bsc_del_timer(&ho->T3103); + osmo_timer_del(&ho->T3103);
/* Replace the ho lchan with the primary one */ if (ho->old_lchan != new_lchan->conn->lchan) @@ -302,7 +302,7 @@ static int ho_gsm48_ho_fail(struct gsm_lchan *old_lchan)
counter_inc(net->stats.handover.failed);
- bsc_del_timer(&ho->T3103); + osmo_timer_del(&ho->T3103); llist_del(&ho->list);
/* release the channel and forget about it */ diff --git a/openbsc/src/libbsc/paging.c b/openbsc/src/libbsc/paging.c index a336144..324104f 100644 --- a/openbsc/src/libbsc/paging.c +++ b/openbsc/src/libbsc/paging.c @@ -73,7 +73,7 @@ static unsigned int calculate_group(struct gsm_bts *bts, struct gsm_subscriber * static void paging_remove_request(struct gsm_bts_paging_state *paging_bts, struct gsm_paging_request *to_be_deleted) { - bsc_del_timer(&to_be_deleted->T3113); + osmo_timer_del(&to_be_deleted->T3113); llist_del(&to_be_deleted->entry); subscr_put(to_be_deleted->subscr); talloc_free(to_be_deleted); @@ -102,8 +102,8 @@ static void paging_schedule_if_needed(struct gsm_bts_paging_state *paging_bts) if (llist_empty(&paging_bts->pending_requests)) return;
- if (!bsc_timer_pending(&paging_bts->work_timer)) - bsc_schedule_timer(&paging_bts->work_timer, PAGING_TIMER); + if (!osmo_timer_pending(&paging_bts->work_timer)) + osmo_timer_schedule(&paging_bts->work_timer, PAGING_TIMER); }
@@ -192,7 +192,7 @@ static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_b if (paging_bts->available_slots == 0) { paging_bts->credit_timer.cb = paging_give_credit; paging_bts->credit_timer.data = paging_bts; - bsc_schedule_timer(&paging_bts->credit_timer, 5, 0); + osmo_timer_schedule(&paging_bts->credit_timer, 5, 0); return; }
@@ -215,7 +215,7 @@ static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_b llist_add_tail(&request->entry, &paging_bts->pending_requests);
skip_paging: - bsc_schedule_timer(&paging_bts->work_timer, PAGING_TIMER); + osmo_timer_schedule(&paging_bts->work_timer, PAGING_TIMER); }
static void paging_worker(void *data) @@ -298,7 +298,7 @@ static int _paging_request(struct gsm_bts *bts, struct gsm_subscriber *subscr, req->cbfn_param = data; req->T3113.cb = paging_T3113_expired; req->T3113.data = req; - bsc_schedule_timer(&req->T3113, bts->network->T3113, 0); + osmo_timer_schedule(&req->T3113, bts->network->T3113, 0); llist_add_tail(&req->entry, &bts_entry->pending_requests); paging_schedule_if_needed(bts_entry);
@@ -399,7 +399,7 @@ void paging_update_buffer_space(struct gsm_bts *bts, uint16_t free_slots) { paging_init_if_needed(bts);
- bsc_del_timer(&bts->paging.credit_timer); + osmo_timer_del(&bts->paging.credit_timer); bts->paging.available_slots = free_slots; paging_schedule_if_needed(&bts->paging); } diff --git a/openbsc/src/libgb/gprs_ns.c b/openbsc/src/libgb/gprs_ns.c index 95e5a55..1c3c1b6 100644 --- a/openbsc/src/libgb/gprs_ns.c +++ b/openbsc/src/libgb/gprs_ns.c @@ -166,8 +166,8 @@ struct gprs_nsvc *nsvc_create(struct gprs_ns_inst *nsi, uint16_t nsvci)
void nsvc_delete(struct gprs_nsvc *nsvc) { - if (bsc_timer_pending(&nsvc->timer)) - bsc_del_timer(&nsvc->timer); + if (osmo_timer_pending(&nsvc->timer)) + osmo_timer_del(&nsvc->timer); llist_del(&nsvc->list); talloc_free(nsvc); } @@ -405,11 +405,11 @@ static void nsvc_start_timer(struct gprs_nsvc *nsvc, enum nsvc_timer_mode mode) nsvc->nsei, get_value_string(timer_mode_strs, mode), seconds); - if (bsc_timer_pending(&nsvc->timer)) - bsc_del_timer(&nsvc->timer); + if (osmo_timer_pending(&nsvc->timer)) + osmo_timer_del(&nsvc->timer);
nsvc->timer_mode = mode; - bsc_schedule_timer(&nsvc->timer, seconds, 0); + osmo_timer_schedule(&nsvc->timer, seconds, 0); }
static void gprs_ns_timer_cb(void *data) @@ -786,7 +786,7 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg, rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]); if (nsvc->persistent || nsvc->remote_end_is_sgsn) { /* stop RESET timer */ - bsc_del_timer(&nsvc->timer); + osmo_timer_del(&nsvc->timer); } /* Initiate TEST proc.: Send ALIVE and start timer */ rc = gprs_ns_tx_simple(nsvc, NS_PDUT_ALIVE); diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 7d6580a..9b7549f 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -243,7 +243,7 @@ static void release_loc_updating_req(struct gsm_subscriber_connection *conn) /* No need to keep the connection up */ release_anchor(conn);
- bsc_del_timer(&conn->loc_operation->updating_timer); + osmo_timer_del(&conn->loc_operation->updating_timer); talloc_free(conn->loc_operation); conn->loc_operation = NULL; msc_release_connection(conn); @@ -483,7 +483,7 @@ static void schedule_reject(struct gsm_subscriber_connection *conn) { conn->loc_operation->updating_timer.cb = loc_upd_rej_cb; conn->loc_operation->updating_timer.data = conn; - bsc_schedule_timer(&conn->loc_operation->updating_timer, 5, 0); + osmo_timer_schedule(&conn->loc_operation->updating_timer, 5, 0); }
static const char *lupd_name(uint8_t type) @@ -1331,9 +1331,9 @@ static int gsm48_tx_simple(struct gsm_subscriber_connection *conn,
static void gsm48_stop_cc_timer(struct gsm_trans *trans) { - if (bsc_timer_pending(&trans->cc.timer)) { + if (osmo_timer_pending(&trans->cc.timer)) { DEBUGP(DCC, "stopping pending timer T%x\n", trans->cc.Tcurrent); - bsc_del_timer(&trans->cc.timer); + osmo_timer_del(&trans->cc.timer); trans->cc.Tcurrent = 0; } } @@ -1816,7 +1816,7 @@ static void gsm48_start_cc_timer(struct gsm_trans *trans, int current, DEBUGP(DCC, "starting timer T%x with %d seconds\n", current, sec); trans->cc.timer.cb = gsm48_cc_timeout; trans->cc.timer.data = trans; - bsc_schedule_timer(&trans->cc.timer, sec, micro); + osmo_timer_schedule(&trans->cc.timer, sec, micro); trans->cc.Tcurrent = current; }
@@ -3269,7 +3269,7 @@ static void release_anchor(struct gsm_subscriber_connection *conn) if (!conn->anch_operation) return;
- bsc_del_timer(&conn->anch_operation->timeout); + osmo_timer_del(&conn->anch_operation->timeout); talloc_free(conn->anch_operation); conn->anch_operation = NULL; } @@ -3290,7 +3290,7 @@ int gsm0408_new_conn(struct gsm_subscriber_connection *conn)
conn->anch_operation->timeout.data = conn; conn->anch_operation->timeout.cb = anchor_timeout; - bsc_schedule_timer(&conn->anch_operation->timeout, 5, 0); + osmo_timer_schedule(&conn->anch_operation->timeout, 5, 0); return 0; }
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index c7ac8f4..1db307a 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -210,7 +210,7 @@ static int gsm411_cp_sendmsg(struct msgb *msg, struct gsm_trans *trans, trans->sms.cp_timer.data = trans; trans->sms.cp_timer.cb = cp_timer_expired; /* 5.3.2.1: Set Timer TC1A */ - bsc_schedule_timer(&trans->sms.cp_timer, GSM411_TMR_TC1A); + osmo_timer_schedule(&trans->sms.cp_timer, GSM411_TMR_TC1A); DEBUGP(DSMS, "TX: CP-DATA "); break; case GSM411_MT_CP_ACK: @@ -1008,7 +1008,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn, DEBUGP(DSMS, "Implicit CP-ACK for trans_id=%x\n", i);
/* Finish it for good */ - bsc_del_timer(&ptrans->sms.cp_timer); + osmo_timer_del(&ptrans->sms.cp_timer); ptrans->sms.cp_state = GSM411_CPS_IDLE; trans_free(ptrans); } @@ -1039,7 +1039,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn, /* 5.2.3.2.4: MT state exists when SMC has received CP-ACK */ trans->sms.cp_state = GSM411_CPS_MM_ESTABLISHED; /* Stop TC1* after CP-ACK has been received */ - bsc_del_timer(&trans->sms.cp_timer); + osmo_timer_del(&trans->sms.cp_timer);
if (!trans->sms.is_mt) { /* FIXME: we have sent one CP-DATA, which was now @@ -1052,7 +1052,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn, case GSM411_MT_CP_ERROR: DEBUGPC(DSMS, "RX SMS CP-ERROR, cause %d (%s)\n", gh->data[0], get_value_string(cp_cause_strs, gh->data[0])); - bsc_del_timer(&trans->sms.cp_timer); + osmo_timer_del(&trans->sms.cp_timer); trans->sms.cp_state = GSM411_CPS_IDLE; trans_free(trans); break; @@ -1208,7 +1208,7 @@ void _gsm411_sms_trans_free(struct gsm_trans *trans) trans->sms.sms = NULL; }
- bsc_del_timer(&trans->sms.cp_timer); + osmo_timer_del(&trans->sms.cp_timer); }
void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn) diff --git a/openbsc/src/libmsc/sms_queue.c b/openbsc/src/libmsc/sms_queue.c index f0d3d37..18545bf 100644 --- a/openbsc/src/libmsc/sms_queue.c +++ b/openbsc/src/libmsc/sms_queue.c @@ -54,8 +54,8 @@ struct gsm_sms_pending { };
struct gsm_sms_queue { - struct timer_list resend_pending; - struct timer_list push_queue; + struct osmo_timer_list resend_pending; + struct osmo_timer_list push_queue; struct gsm_network *network; int max_fail; int max_pending; @@ -129,10 +129,10 @@ static void sms_pending_resend(struct gsm_sms_pending *pending) pending->resend = 1;
smsq = pending->subscr->net->sms_queue; - if (bsc_timer_pending(&smsq->resend_pending)) + if (osmo_timer_pending(&smsq->resend_pending)) return;
- bsc_schedule_timer(&smsq->resend_pending, 1, 0); + osmo_timer_schedule(&smsq->resend_pending, 1, 0); }
static void sms_pending_failed(struct gsm_sms_pending *pending, int paging_error) @@ -288,10 +288,10 @@ static void sms_submit_pending(void *_data) */ int sms_queue_trigger(struct gsm_sms_queue *smsq) { - if (bsc_timer_pending(&smsq->push_queue)) + if (osmo_timer_pending(&smsq->push_queue)) return 0;
- bsc_schedule_timer(&smsq->push_queue, 1, 0); + osmo_timer_schedule(&smsq->push_queue, 1, 0); return 0; }
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index 66d18c8..e1a95a8 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -239,7 +239,7 @@ static int ipaccess_a_fd_cb(struct bsc_fd *bfd) else if (msg->l2h[0] == IPAC_MSGT_ID_GET) { send_id_get_response(data, bfd->fd); } else if (msg->l2h[0] == IPAC_MSGT_PONG) { - bsc_del_timer(&data->pong_timer); + osmo_timer_del(&data->pong_timer); } } else if (hh->proto == IPAC_PROTO_SCCP) { sccp_system_incoming(msg); @@ -278,10 +278,10 @@ static void msc_ping_timeout_cb(void *_data) send_ping(data);
/* send another ping in 20 seconds */ - bsc_schedule_timer(&data->ping_timer, data->ping_timeout, 0); + osmo_timer_schedule(&data->ping_timer, data->ping_timeout, 0);
/* also start a pong timer */ - bsc_schedule_timer(&data->pong_timer, data->pong_timeout, 0); + osmo_timer_schedule(&data->pong_timer, data->pong_timeout, 0); }
static void msc_pong_timeout_cb(void *_data) @@ -321,8 +321,8 @@ static void msc_connection_was_lost(struct bsc_msc_connection *msc) LOGP(DMSC, LOGL_ERROR, "Lost MSC connection. Freing stuff.\n");
data = (struct osmo_msc_data *) msc->write_queue.bfd.data; - bsc_del_timer(&data->ping_timer); - bsc_del_timer(&data->pong_timer); + osmo_timer_del(&data->ping_timer); + osmo_timer_del(&data->pong_timer);
sig.data = data; dispatch_signal(SS_MSC, S_MSC_LOST, &sig); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_rf.c b/openbsc/src/osmo-bsc/osmo_bsc_rf.c index 436474c..8df0306 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_rf.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_rf.c @@ -160,7 +160,7 @@ static int enter_grace(struct osmo_bsc_rf *rf) { rf->grace_timeout.cb = grace_timeout; rf->grace_timeout.data = rf; - bsc_schedule_timer(&rf->grace_timeout, rf->gsm_network->msc_data->mid_call_timeout, 0); + osmo_timer_schedule(&rf->grace_timeout, rf->gsm_network->msc_data->mid_call_timeout, 0); LOGP(DINP, LOGL_NOTICE, "Going to switch RF off in %d seconds.\n", rf->gsm_network->msc_data->mid_call_timeout);
@@ -175,20 +175,20 @@ static void rf_delay_cmd_cb(void *data) switch (rf->last_request) { case RF_CMD_D_OFF: rf->last_state_command = "RF Direct Off"; - bsc_del_timer(&rf->rf_check); - bsc_del_timer(&rf->grace_timeout); + osmo_timer_del(&rf->rf_check); + osmo_timer_del(&rf->grace_timeout); switch_rf_off(rf); break; case RF_CMD_ON: rf->last_state_command = "RF Direct On"; - bsc_del_timer(&rf->grace_timeout); + osmo_timer_del(&rf->grace_timeout); lock_each_trx(rf->gsm_network, 0); send_signal(rf, S_RF_ON); - bsc_schedule_timer(&rf->rf_check, 3, 0); + osmo_timer_schedule(&rf->rf_check, 3, 0); break; case RF_CMD_OFF: rf->last_state_command = "RF Scheduled Off"; - bsc_del_timer(&rf->rf_check); + osmo_timer_del(&rf->rf_check); enter_grace(rf); break; } @@ -218,8 +218,8 @@ static int rf_read_cmd(struct bsc_fd *fd) case RF_CMD_ON: case RF_CMD_OFF: conn->rf->last_request = buf[0]; - if (!bsc_timer_pending(&conn->rf->delay_cmd)) - bsc_schedule_timer(&conn->rf->delay_cmd, 1, 0); + if (!osmo_timer_pending(&conn->rf->delay_cmd)) + osmo_timer_schedule(&conn->rf->delay_cmd, 1, 0); break; default: conn->rf->last_state_command = "Unknown command"; diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c index 718f305..099552b 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c @@ -95,8 +95,8 @@ static void msc_outgoing_sccp_state(struct sccp_connection *conn, int old_state) LOGP(DMSC, LOGL_DEBUG, "Connection established: %p\n", conn); con_data = (struct osmo_bsc_sccp_con *) conn->data_ctx;
- bsc_del_timer(&con_data->sccp_cc_timeout); - bsc_schedule_timer(&con_data->sccp_it_timeout, SCCP_IT_TIMER, 0); + osmo_timer_del(&con_data->sccp_cc_timeout); + osmo_timer_schedule(&con_data->sccp_it_timeout, SCCP_IT_TIMER, 0);
send_queued(con_data); } @@ -122,7 +122,7 @@ static void sccp_it_timeout(void *_data) (struct osmo_bsc_sccp_con *) _data;
sccp_connection_send_it(data->sccp); - bsc_schedule_timer(&data->sccp_it_timeout, SCCP_IT_TIMER, 0); + osmo_timer_schedule(&data->sccp_it_timeout, SCCP_IT_TIMER, 0); }
static void sccp_cc_timeout(void *_data) @@ -231,7 +231,7 @@ int bsc_create_new_connection(struct gsm_subscriber_connection *conn)
int bsc_open_connection(struct osmo_bsc_sccp_con *conn, struct msgb *msg) { - bsc_schedule_timer(&conn->sccp_cc_timeout, 10, 0); + osmo_timer_schedule(&conn->sccp_cc_timeout, 10, 0); sccp_connection_connect(conn->sccp, &sccp_ssn_bssap, msg); msgb_free(msg); return 0; @@ -246,8 +246,8 @@ int bsc_delete_connection(struct osmo_bsc_sccp_con *sccp) LOGP(DMSC, LOGL_ERROR, "Should have been cleared.\n");
llist_del(&sccp->entry); - bsc_del_timer(&sccp->sccp_it_timeout); - bsc_del_timer(&sccp->sccp_cc_timeout); + osmo_timer_del(&sccp->sccp_it_timeout); + osmo_timer_del(&sccp->sccp_cc_timeout); talloc_free(sccp); return 0; } diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 3112ff3..ffcd388 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -66,7 +66,7 @@ static const char *config_file = "bsc-nat.cfg"; static struct in_addr local_addr; static struct bsc_fd bsc_listen; static const char *msc_ip = NULL; -static struct timer_list sccp_close; +static struct osmo_timer_list sccp_close; static int daemonize = 0;
const char *openbsc_copyright = @@ -153,10 +153,10 @@ static void bsc_ping_timeout(void *_bsc) send_ping(bsc);
/* send another ping in 20 seconds */ - bsc_schedule_timer(&bsc->ping_timeout, bsc->nat->ping_timeout, 0); + osmo_timer_schedule(&bsc->ping_timeout, bsc->nat->ping_timeout, 0);
/* also start a pong timer */ - bsc_schedule_timer(&bsc->pong_timeout, bsc->nat->pong_timeout, 0); + osmo_timer_schedule(&bsc->pong_timeout, bsc->nat->pong_timeout, 0); }
static void start_ping_pong(struct bsc_connection *bsc) @@ -848,9 +848,9 @@ void bsc_close_connection(struct bsc_connection *connection) struct rate_ctr *ctr = NULL;
/* stop the timeout timer */ - bsc_del_timer(&connection->id_timeout); - bsc_del_timer(&connection->ping_timeout); - bsc_del_timer(&connection->pong_timeout); + osmo_timer_del(&connection->id_timeout); + osmo_timer_del(&connection->ping_timeout); + osmo_timer_del(&connection->pong_timeout);
if (connection->cfg) ctr = &connection->cfg->stats.ctrg->ctr[BCFG_CTR_DROPPED_SCCP]; @@ -930,7 +930,7 @@ static void ipaccess_auth_bsc(struct tlv_parsed *tvp, struct bsc_connection *bsc rate_ctr_inc(&conf->stats.ctrg->ctr[BCFG_CTR_NET_RECONN]); bsc->authenticated = 1; bsc->cfg = conf; - bsc_del_timer(&bsc->id_timeout); + osmo_timer_del(&bsc->id_timeout); LOGP(DNAT, LOGL_NOTICE, "Authenticated bsc nr: %d on fd %d\n", conf->nr, bsc->write_queue.bfd.fd); start_ping_pong(bsc); @@ -1177,7 +1177,7 @@ static int ipaccess_bsc_read_cb(struct bsc_fd *bfd) /* stop the pong timeout */ if (hh->proto == IPAC_PROTO_IPACCESS) { if (msg->l2h[0] == IPAC_MSGT_PONG) { - bsc_del_timer(&bsc->pong_timeout); + osmo_timer_del(&bsc->pong_timeout); msgb_free(msg); return 0; } else if (msg->l2h[0] == IPAC_MSGT_PING) { @@ -1275,7 +1275,7 @@ static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what) */ bsc->id_timeout.data = bsc; bsc->id_timeout.cb = ipaccess_close_bsc; - bsc_schedule_timer(&bsc->id_timeout, nat->auth_timeout, 0); + osmo_timer_schedule(&bsc->id_timeout, nat->auth_timeout, 0); return 0; }
@@ -1391,7 +1391,7 @@ static void sccp_close_unconfirmed(void *_data) bsc_maybe_close(bsc);
out: - bsc_schedule_timer(&sccp_close, SCCP_CLOSE_TIME, 0); + osmo_timer_schedule(&sccp_close, SCCP_CLOSE_TIME, 0); }
extern void *tall_msgb_ctx; @@ -1511,7 +1511,7 @@ int main(int argc, char **argv) sccp_set_log_area(DSCCP); sccp_close.cb = sccp_close_unconfirmed; sccp_close.data = NULL; - bsc_schedule_timer(&sccp_close, SCCP_CLOSE_TIME, 0); + osmo_timer_schedule(&sccp_close, SCCP_CLOSE_TIME, 0);
while (1) { bsc_select_main(0); diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c index 0392e9b..5d599c7 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c +++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c @@ -59,7 +59,7 @@ static void bsc_nat_ussd_destroy(struct bsc_nat_ussd_con *con)
close(con->queue.bfd.fd); bsc_unregister_fd(&con->queue.bfd); - bsc_del_timer(&con->auth_timeout); + osmo_timer_del(&con->auth_timeout); write_queue_clear(&con->queue); talloc_free(con); } @@ -168,7 +168,7 @@ static void ussd_auth_con(struct tlv_parsed *tvp, struct bsc_nat_ussd_con *conn) bsc_nat_ussd_destroy(conn->nat->ussd_con);
LOGP(DNAT, LOGL_ERROR, "USSD token specified. USSD provider is connected.\n"); - bsc_del_timer(&conn->auth_timeout); + osmo_timer_del(&conn->auth_timeout); conn->authorized = 1; conn->nat->ussd_con = conn; } @@ -179,7 +179,7 @@ static void ussd_start_auth(struct bsc_nat_ussd_con *conn)
conn->auth_timeout.data = conn; conn->auth_timeout.cb = ussd_auth_cb; - bsc_schedule_timer(&conn->auth_timeout, conn->nat->auth_timeout, 0); + osmo_timer_schedule(&conn->auth_timeout, conn->nat->auth_timeout, 0);
msg = msgb_alloc_headroom(4096, 128, "auth message"); if (!msg) { diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c index 739253b..8fec368 100644 --- a/openbsc/src/osmo-nitb/bsc_hack.c +++ b/openbsc/src/osmo-nitb/bsc_hack.c @@ -53,7 +53,7 @@ static int use_mncc_sock = 0;
/* timer to store statistics */ #define DB_SYNC_INTERVAL 60, 0 -static struct timer_list db_sync_timer; +static struct osmo_timer_list db_sync_timer;
extern int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *), const char *cfg_file); @@ -204,7 +204,7 @@ static void db_sync_timer_cb(void *data) { /* store counters to database and re-schedule */ counters_for_each(_db_store_counter, NULL); - bsc_schedule_timer(&db_sync_timer, DB_SYNC_INTERVAL); + osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL); }
extern int bts_model_unknown_init(void); @@ -285,7 +285,7 @@ int main(int argc, char **argv) /* setup the timer */ db_sync_timer.cb = db_sync_timer_cb; db_sync_timer.data = NULL; - bsc_schedule_timer(&db_sync_timer, DB_SYNC_INTERVAL); + osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL);
signal(SIGINT, &signal_handler); signal(SIGABRT, &signal_handler); diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c index 9a61f4c..8e987de 100644 --- a/openbsc/src/utils/bs11_config.c +++ b/openbsc/src/utils/bs11_config.c @@ -50,7 +50,7 @@ enum bs11cfg_state { }; static enum bs11cfg_state bs11cfg_state = STATE_NONE; static char *command, *value; -struct timer_list status_timer; +struct osmo_timer_list status_timer;
static const uint8_t obj_li_attr[] = { NM_ATT_BS11_BIT_ERR_THESH, 0x09, 0x00, @@ -731,7 +731,7 @@ int handle_serial_msg(struct msgb *rx_msg) abis_nm_bs11_factory_logon(g_bts, 1); break; case STATE_LOGON_ACK: - bsc_schedule_timer(&status_timer, 5, 0); + osmo_timer_schedule(&status_timer, 5, 0); break; default: break;
From: Pablo Neira Ayuso pablo@gnumonks.org
Summary of changes:
s/struct bsc_fd/struct osmo_fd/g s/bsc_register_fd/osmo_fd_register/g s/bsc_unregister_fd/osmo_fd_unregister/g s/bsc_select_main/osmo_select_main/g --- openbsc/doc/e1-data-model.txt | 2 +- openbsc/include/openbsc/bsc_nat.h | 4 +- openbsc/include/openbsc/e1_input.h | 6 +- openbsc/include/openbsc/gprs_ns.h | 4 +- openbsc/include/openbsc/ipaccess.h | 4 +- openbsc/include/openbsc/mgcp_internal.h | 4 +- openbsc/include/openbsc/osmo_bsc_rf.h | 2 +- openbsc/include/openbsc/rtp_proxy.h | 2 +- openbsc/include/openbsc/sgsn.h | 6 +- openbsc/include/openbsc/socket.h | 4 +- openbsc/src/gprs/gb_proxy_main.c | 2 +- openbsc/src/gprs/sgsn_libgtp.c | 8 ++-- openbsc/src/gprs/sgsn_main.c | 2 +- openbsc/src/ipaccess/ipaccess-config.c | 2 +- openbsc/src/ipaccess/ipaccess-find.c | 10 ++-- openbsc/src/ipaccess/ipaccess-proxy.c | 64 ++++++++++++++-------------- openbsc/src/libabis/input/dahdi.c | 16 ++++---- openbsc/src/libabis/input/hsl.c | 22 +++++----- openbsc/src/libabis/input/ipaccess.c | 56 +++++++++++++------------- openbsc/src/libabis/input/misdn.c | 16 ++++---- openbsc/src/libbsc/bsc_msc.c | 14 +++--- openbsc/src/libcommon/socket.c | 6 +- openbsc/src/libgb/gprs_ns.c | 8 ++-- openbsc/src/libgb/gprs_ns_frgre.c | 10 ++-- openbsc/src/libmgcp/mgcp_network.c | 24 +++++----- openbsc/src/libmsc/mncc_sock.c | 28 ++++++------ openbsc/src/libtrau/rtp_proxy.c | 14 +++--- openbsc/src/osmo-bsc/osmo_bsc_main.c | 2 +- openbsc/src/osmo-bsc/osmo_bsc_msc.c | 10 ++-- openbsc/src/osmo-bsc/osmo_bsc_rf.c | 14 +++--- openbsc/src/osmo-bsc_mgcp/mgcp_main.c | 6 +- openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c | 6 +- openbsc/src/osmo-bsc_nat/bsc_nat.c | 16 ++++---- openbsc/src/osmo-bsc_nat/bsc_nat_utils.c | 2 +- openbsc/src/osmo-bsc_nat/bsc_ussd.c | 8 ++-- openbsc/src/osmo-nitb/bsc_hack.c | 2 +- openbsc/src/utils/bs11_config.c | 2 +- openbsc/src/utils/rs232.c | 12 +++--- openbsc/tests/channel/channel_test.c | 2 +- 39 files changed, 211 insertions(+), 211 deletions(-)
diff --git a/openbsc/doc/e1-data-model.txt b/openbsc/doc/e1-data-model.txt index 9286d5f..509004f 100644 --- a/openbsc/doc/e1-data-model.txt +++ b/openbsc/doc/e1-data-model.txt @@ -140,7 +140,7 @@ struct e1inp_ts { union { struct { /* mISDN driver has one fd for each ts */ - struct bsc_fd; + struct osmo_fd; } misdn; } driver; }; diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index 7d8c37e..73911bc 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -275,7 +275,7 @@ struct bsc_nat { regex_t ussd_query_re; char *ussd_token; char *ussd_local; - struct bsc_fd ussd_listen; + struct osmo_fd ussd_listen; struct bsc_nat_ussd_con *ussd_con;
/* for maintainenance */ @@ -363,7 +363,7 @@ uint32_t bsc_mgcp_extract_ci(const char *resp); int bsc_write(struct bsc_connection *bsc, struct msgb *msg, int id); int bsc_do_write(struct write_queue *queue, struct msgb *msg, int id); int bsc_write_msg(struct write_queue *queue, struct msgb *msg); -int bsc_write_cb(struct bsc_fd *bfd, struct msgb *msg); +int bsc_write_cb(struct osmo_fd *bfd, struct msgb *msg);
/* IMSI allow/deny handling */ int bsc_parse_reg(void *ctx, regex_t *reg, char **imsi, int argc, const char **argv) __attribute__ ((warn_unused_result)); diff --git a/openbsc/include/openbsc/e1_input.h b/openbsc/include/openbsc/e1_input.h index cd8abca..0eae5d9 100644 --- a/openbsc/include/openbsc/e1_input.h +++ b/openbsc/include/openbsc/e1_input.h @@ -81,15 +81,15 @@ struct e1inp_ts { union { struct { /* mISDN driver has one fd for each ts */ - struct bsc_fd fd; + struct osmo_fd fd; } misdn; struct { /* ip.access driver has one fd for each ts */ - struct bsc_fd fd; + struct osmo_fd fd; } ipaccess; struct { /* DAHDI driver has one fd for each ts */ - struct bsc_fd fd; + struct osmo_fd fd; struct lapd_instance *lapd; } dahdi; } driver; diff --git a/openbsc/include/openbsc/gprs_ns.h b/openbsc/include/openbsc/gprs_ns.h index f497e23..8f28d46 100644 --- a/openbsc/include/openbsc/gprs_ns.h +++ b/openbsc/include/openbsc/gprs_ns.h @@ -133,13 +133,13 @@ struct gprs_ns_inst {
/* NS-over-IP specific bits */ struct { - struct bsc_fd fd; + struct osmo_fd fd; uint32_t local_ip; uint16_t local_port; } nsip; /* NS-over-FR-over-GRE-over-IP specific bits */ struct { - struct bsc_fd fd; + struct osmo_fd fd; uint32_t local_ip; int enabled:1; } frgre; diff --git a/openbsc/include/openbsc/ipaccess.h b/openbsc/include/openbsc/ipaccess.h index 388ad64..8d30327 100644 --- a/openbsc/include/openbsc/ipaccess.h +++ b/openbsc/include/openbsc/ipaccess.h @@ -85,8 +85,8 @@ int ipaccess_connect(struct e1inp_line *line, struct sockaddr_in *sa); /* * methods for parsing and sending a message */ -int ipaccess_rcvmsg_base(struct msgb *msg, struct bsc_fd *bfd); -struct msgb *ipaccess_read_msg(struct bsc_fd *bfd, int *error); +int ipaccess_rcvmsg_base(struct msgb *msg, struct osmo_fd *bfd); +struct msgb *ipaccess_read_msg(struct osmo_fd *bfd, int *error); void ipaccess_prepend_header(struct msgb *msg, int proto); void ipaccess_prepend_header_ext(struct msgb *msg, int proto); int ipaccess_send_pong(int fd); diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h index 0214318..a9d5149 100644 --- a/openbsc/include/openbsc/mgcp_internal.h +++ b/openbsc/include/openbsc/mgcp_internal.h @@ -66,8 +66,8 @@ struct mgcp_rtp_end { /* * Each end has a socket... */ - struct bsc_fd rtp; - struct bsc_fd rtcp; + struct osmo_fd rtp; + struct osmo_fd rtcp;
int local_port; int local_alloc; diff --git a/openbsc/include/openbsc/osmo_bsc_rf.h b/openbsc/include/openbsc/osmo_bsc_rf.h index f1ff9ba..dbbb3db 100644 --- a/openbsc/include/openbsc/osmo_bsc_rf.h +++ b/openbsc/include/openbsc/osmo_bsc_rf.h @@ -9,7 +9,7 @@ struct gsm_network; struct osmo_bsc_rf { /* the value of signal.h */ int policy; - struct bsc_fd listen; + struct osmo_fd listen; struct gsm_network *gsm_network;
const char *last_state_command; diff --git a/openbsc/include/openbsc/rtp_proxy.h b/openbsc/include/openbsc/rtp_proxy.h index 8ad3636..3b208c3 100644 --- a/openbsc/include/openbsc/rtp_proxy.h +++ b/openbsc/include/openbsc/rtp_proxy.h @@ -48,7 +48,7 @@ struct rtp_sub_socket { struct sockaddr_in sin_local; struct sockaddr_in sin_remote;
- struct bsc_fd bfd; + struct osmo_fd bfd; /* linked list of to-be-transmitted msgb's */ struct llist_head tx_queue; }; diff --git a/openbsc/include/openbsc/sgsn.h b/openbsc/include/openbsc/sgsn.h index 00e1ec3..7456614 100644 --- a/openbsc/include/openbsc/sgsn.h +++ b/openbsc/include/openbsc/sgsn.h @@ -21,9 +21,9 @@ struct sgsn_instance { char *config_file; struct sgsn_config cfg; /* File descriptor wrappers for LibGTP */ - struct bsc_fd gtp_fd0; - struct bsc_fd gtp_fd1c; - struct bsc_fd gtp_fd1u; + struct osmo_fd gtp_fd0; + struct osmo_fd gtp_fd1c; + struct osmo_fd gtp_fd1u; /* Timer for libGTP */ struct osmo_timer_list gtp_timer; /* GSN instance for libgtp */ diff --git a/openbsc/include/openbsc/socket.h b/openbsc/include/openbsc/socket.h index 87ef37f..0fd85f1 100644 --- a/openbsc/include/openbsc/socket.h +++ b/openbsc/include/openbsc/socket.h @@ -7,8 +7,8 @@ #define IPPROTO_GRE 47 #endif
-int make_sock(struct bsc_fd *bfd, int proto, +int make_sock(struct osmo_fd *bfd, int proto, uint32_t ip, uint16_t port, int priv_nr, - int (*cb)(struct bsc_fd *fd, unsigned int what), void *data); + int (*cb)(struct osmo_fd *fd, unsigned int what), void *data);
#endif /* _BSC_SOCKET_H */ diff --git a/openbsc/src/gprs/gb_proxy_main.c b/openbsc/src/gprs/gb_proxy_main.c index 4f6944f..b0fb664 100644 --- a/openbsc/src/gprs/gb_proxy_main.c +++ b/openbsc/src/gprs/gb_proxy_main.c @@ -279,7 +279,7 @@ int main(int argc, char **argv) gbprox_reset_persistent_nsvcs(bssgp_nsi);
while (1) { - rc = bsc_select_main(0); + rc = osmo_select_main(0); if (rc < 0) exit(3); } diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 7e66035..f193aa3 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -505,7 +505,7 @@ int sgsn_rx_sndcp_ud_ind(struct gprs_ra_id *ra_id, int32_t tlli, uint8_t nsapi, }
/* libgtp select loop integration */ -static int sgsn_gtp_fd_cb(struct bsc_fd *fd, unsigned int what) +static int sgsn_gtp_fd_cb(struct osmo_fd *fd, unsigned int what) { struct sgsn_instance *sgi = fd->data; int rc; @@ -570,7 +570,7 @@ int sgsn_gtp_init(struct sgsn_instance *sgi) sgi->gtp_fd0.data = sgi; sgi->gtp_fd0.when = BSC_FD_READ; sgi->gtp_fd0.cb = sgsn_gtp_fd_cb; - rc = bsc_register_fd(&sgi->gtp_fd0); + rc = osmo_fd_register(&sgi->gtp_fd0); if (rc < 0) return rc;
@@ -579,7 +579,7 @@ int sgsn_gtp_init(struct sgsn_instance *sgi) sgi->gtp_fd1c.data = sgi; sgi->gtp_fd1c.when = BSC_FD_READ; sgi->gtp_fd1c.cb = sgsn_gtp_fd_cb; - bsc_register_fd(&sgi->gtp_fd1c); + osmo_fd_register(&sgi->gtp_fd1c); if (rc < 0) return rc;
@@ -588,7 +588,7 @@ int sgsn_gtp_init(struct sgsn_instance *sgi) sgi->gtp_fd1u.data = sgi; sgi->gtp_fd1u.when = BSC_FD_READ; sgi->gtp_fd1u.cb = sgsn_gtp_fd_cb; - bsc_register_fd(&sgi->gtp_fd1u); + osmo_fd_register(&sgi->gtp_fd1u); if (rc < 0) return rc;
diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c index f6a645f..6876939 100644 --- a/openbsc/src/gprs/sgsn_main.c +++ b/openbsc/src/gprs/sgsn_main.c @@ -279,7 +279,7 @@ int main(int argc, char **argv) }
while (1) { - rc = bsc_select_main(0); + rc = osmo_select_main(0); if (rc < 0) exit(3); } diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index aa38d10..5cd901c 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -927,7 +927,7 @@ int main(int argc, char **argv) bts->oml_link->ts->sign.delay = 10; bts->c0->rsl_link->ts->sign.delay = 10; while (1) { - rc = bsc_select_main(0); + rc = osmo_select_main(0); if (rc < 0) exit(3); } diff --git a/openbsc/src/ipaccess/ipaccess-find.c b/openbsc/src/ipaccess/ipaccess-find.c index 24f602e..b0db045 100644 --- a/openbsc/src/ipaccess/ipaccess-find.c +++ b/openbsc/src/ipaccess/ipaccess-find.c @@ -141,7 +141,7 @@ static int read_response(int fd) return parse_response(buf+6, len-6); }
-static int bfd_cb(struct bsc_fd *bfd, unsigned int flags) +static int bfd_cb(struct osmo_fd *bfd, unsigned int flags) { if (flags & BSC_FD_READ) return read_response(bfd->fd); @@ -156,7 +156,7 @@ static struct osmo_timer_list timer;
static void timer_cb(void *_data) { - struct bsc_fd *bfd = _data; + struct osmo_fd *bfd = _data;
bfd->when |= BSC_FD_WRITE;
@@ -165,7 +165,7 @@ static void timer_cb(void *_data)
int main(int argc, char **argv) { - struct bsc_fd bfd; + struct osmo_fd bfd; char *ifname; int rc;
@@ -187,7 +187,7 @@ int main(int argc, char **argv) exit(1); }
- bsc_register_fd(&bfd); + osmo_fd_register(&bfd);
timer.cb = timer_cb; timer.data = &bfd; @@ -197,7 +197,7 @@ int main(int argc, char **argv) printf("Trying to find ip.access BTS by broadcast UDP...\n");
while (1) { - rc = bsc_select_main(0); + rc = osmo_select_main(0); if (rc < 0) exit(3); } diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/openbsc/src/ipaccess/ipaccess-proxy.c index f40590a..2717ba1 100644 --- a/openbsc/src/ipaccess/ipaccess-proxy.c +++ b/openbsc/src/ipaccess/ipaccess-proxy.c @@ -51,9 +51,9 @@ static struct log_target *stderr_target; /* one instance of an ip.access protocol proxy */ struct ipa_proxy { /* socket where we listen for incoming OML from BTS */ - struct bsc_fd oml_listen_fd; + struct osmo_fd oml_listen_fd; /* socket where we listen for incoming RSL from BTS */ - struct bsc_fd rsl_listen_fd; + struct osmo_fd rsl_listen_fd; /* list of BTS's (struct ipa_bts_conn */ struct llist_head bts_list; /* the BSC reconnect timer */ @@ -67,7 +67,7 @@ struct ipa_proxy { static struct ipa_proxy *ipp;
struct ipa_proxy_conn { - struct bsc_fd fd; + struct osmo_fd fd; struct llist_head tx_queue; struct ipa_bts_conn *bts_conn; }; @@ -94,12 +94,12 @@ struct ipa_bts_conn { struct ipa_proxy_conn *bsc_rsl_conn[MAX_TRX];
/* UDP sockets for BTS and BSC injection */ - struct bsc_fd udp_bts_fd; - struct bsc_fd udp_bsc_fd; + struct osmo_fd udp_bts_fd; + struct osmo_fd udp_bsc_fd;
/* NS data */ struct in_addr bts_addr; - struct bsc_fd gprs_ns_fd; + struct osmo_fd gprs_ns_fd; int gprs_local_port; uint16_t gprs_orig_port; uint32_t gprs_orig_ip; @@ -125,7 +125,7 @@ static char *listen_ipaddr; static char *bsc_ipaddr; static char *gprs_ns_ipaddr;
-static int gprs_ns_cb(struct bsc_fd *bfd, unsigned int what); +static int gprs_ns_cb(struct osmo_fd *bfd, unsigned int what);
#define PROXY_ALLOC_SIZE 1200
@@ -197,7 +197,7 @@ static void _logp_ipbc_uid(unsigned int ss, unsigned int lvl, char *file, int li logp2(ss, lvl, file, line, 0, "unknown "); }
-static int handle_udp_read(struct bsc_fd *bfd) +static int handle_udp_read(struct osmo_fd *bfd) { struct ipa_bts_conn *ipbc = bfd->data; struct ipa_proxy_conn *other_conn = NULL; @@ -217,7 +217,7 @@ static int handle_udp_read(struct bsc_fd *bfd) } if (ret == 0) { DEBUGP(DINP, "UDP peer disappeared, dead socket\n"); - bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd); close(bfd->fd); bfd->fd = -1; msgb_free(msg); @@ -288,7 +288,7 @@ static int handle_udp_read(struct bsc_fd *bfd) return 0; }
-static int handle_udp_write(struct bsc_fd *bfd) +static int handle_udp_write(struct osmo_fd *bfd) { /* not implemented yet */ bfd->when &= ~BSC_FD_WRITE; @@ -297,7 +297,7 @@ static int handle_udp_write(struct bsc_fd *bfd) }
/* callback from select.c in case one of the fd's can be read/written */ -static int udp_fd_cb(struct bsc_fd *bfd, unsigned int what) +static int udp_fd_cb(struct osmo_fd *bfd, unsigned int what) { int rc = 0;
@@ -310,7 +310,7 @@ static int udp_fd_cb(struct bsc_fd *bfd, unsigned int what) }
-static int ipbc_alloc_connect(struct ipa_proxy_conn *ipc, struct bsc_fd *bfd, +static int ipbc_alloc_connect(struct ipa_proxy_conn *ipc, struct osmo_fd *bfd, uint16_t site_id, uint16_t bts_id, uint16_t trx_id, struct tlv_parsed *tlvp, struct msgb *msg) @@ -414,9 +414,9 @@ static int ipbc_alloc_connect(struct ipa_proxy_conn *ipc, struct bsc_fd *bfd, return 0;
err_udp_bsc: - bsc_unregister_fd(&ipbc->udp_bts_fd); + osmo_fd_unregister(&ipbc->udp_bts_fd); err_udp_bts: - bsc_unregister_fd(&ipbc->bsc_oml_conn->fd); + osmo_fd_unregister(&ipbc->bsc_oml_conn->fd); close(ipbc->bsc_oml_conn->fd.fd); talloc_free(ipbc->bsc_oml_conn); ipbc->bsc_oml_conn = NULL; @@ -424,7 +424,7 @@ err_bsc_conn: talloc_free(ipbc->id_resp); talloc_free(ipbc); #if 0 - bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd); close(bfd->fd); talloc_free(bfd); #endif @@ -433,7 +433,7 @@ err_out: }
static int ipaccess_rcvmsg(struct ipa_proxy_conn *ipc, struct msgb *msg, - struct bsc_fd *bfd) + struct osmo_fd *bfd) { struct tlv_parsed tlvp; uint8_t msg_type = *(msg->l2h); @@ -536,7 +536,7 @@ static int ipaccess_rcvmsg(struct ipa_proxy_conn *ipc, struct msgb *msg, return 0; }
-struct msgb *ipaccess_proxy_read_msg(struct bsc_fd *bfd, int *error) +struct msgb *ipaccess_proxy_read_msg(struct osmo_fd *bfd, int *error) { struct msgb *msg = msgb_alloc(PROXY_ALLOC_SIZE, "Abis/IP"); struct ipaccess_head *hh; @@ -660,7 +660,7 @@ reschedule: osmo_timer_schedule(&ipp->reconn_timer, 5, 0); }
-static void handle_dead_socket(struct bsc_fd *bfd) +static void handle_dead_socket(struct osmo_fd *bfd) { struct ipa_proxy_conn *ipc = bfd->data; /* local conn */ struct ipa_proxy_conn *bsc_conn; /* remote conn */ @@ -668,7 +668,7 @@ static void handle_dead_socket(struct bsc_fd *bfd) unsigned int trx_id = bfd->priv_nr >> 8; struct msgb *msg, *msg2;
- bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd); close(bfd->fd); bfd->fd = -1;
@@ -686,7 +686,7 @@ static void handle_dead_socket(struct bsc_fd *bfd) ipbc->oml_conn = NULL; bsc_conn = ipbc->bsc_oml_conn; /* close the connection to the BSC */ - bsc_unregister_fd(&bsc_conn->fd); + osmo_fd_unregister(&bsc_conn->fd); close(bsc_conn->fd.fd); llist_for_each_entry_safe(msg, msg2, &bsc_conn->tx_queue, list) msgb_free(msg); @@ -698,7 +698,7 @@ static void handle_dead_socket(struct bsc_fd *bfd) ipbc->rsl_conn[trx_id] = NULL; bsc_conn = ipbc->bsc_rsl_conn[trx_id]; /* close the connection to the BSC */ - bsc_unregister_fd(&bsc_conn->fd); + osmo_fd_unregister(&bsc_conn->fd); close(bsc_conn->fd.fd); llist_for_each_entry_safe(msg, msg2, &bsc_conn->tx_queue, list) msgb_free(msg); @@ -761,7 +761,7 @@ static void patch_gprs_msg(struct ipa_bts_conn *ipbc, int priv_nr, struct msgb * } }
-static int handle_tcp_read(struct bsc_fd *bfd) +static int handle_tcp_read(struct osmo_fd *bfd) { struct ipa_proxy_conn *ipc = bfd->data; struct ipa_bts_conn *ipbc = ipc->bts_conn; @@ -795,7 +795,7 @@ static int handle_tcp_read(struct bsc_fd *bfd) if (hh->proto == IPAC_PROTO_IPACCESS) { ret = ipaccess_rcvmsg(ipc, msg, bfd); if (ret < 0) { - bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd); close(bfd->fd); bfd->fd = -1; talloc_free(bfd); @@ -835,7 +835,7 @@ static int handle_tcp_read(struct bsc_fd *bfd) }
/* a TCP socket is ready to be written to */ -static int handle_tcp_write(struct bsc_fd *bfd) +static int handle_tcp_write(struct osmo_fd *bfd) { struct ipa_proxy_conn *ipc = bfd->data; struct ipa_bts_conn *ipbc = ipc->bts_conn; @@ -876,7 +876,7 @@ static int handle_tcp_write(struct bsc_fd *bfd) }
/* callback from select.c in case one of the fd's can be read/written */ -static int ipaccess_fd_cb(struct bsc_fd *bfd, unsigned int what) +static int ipaccess_fd_cb(struct osmo_fd *bfd, unsigned int what) { int rc = 0;
@@ -892,11 +892,11 @@ static int ipaccess_fd_cb(struct bsc_fd *bfd, unsigned int what) }
/* callback of the listening filedescriptor */ -static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what) +static int listen_fd_cb(struct osmo_fd *listen_bfd, unsigned int what) { int ret; struct ipa_proxy_conn *ipc; - struct bsc_fd *bfd; + struct osmo_fd *bfd; struct sockaddr_in sa; socklen_t sa_len = sizeof(sa);
@@ -924,7 +924,7 @@ static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what) bfd->priv_nr = listen_bfd->priv_nr; bfd->cb = ipaccess_fd_cb; bfd->when = BSC_FD_READ; - ret = bsc_register_fd(bfd); + ret = osmo_fd_register(bfd); if (ret < 0) { LOGP(DINP, LOGL_ERROR, "could not register FD\n"); close(bfd->fd); @@ -955,7 +955,7 @@ static void send_ns(int fd, const char *buf, int size, struct in_addr ip, int po } }
-static int gprs_ns_cb(struct bsc_fd *bfd, unsigned int what) +static int gprs_ns_cb(struct osmo_fd *bfd, unsigned int what) { struct ipa_bts_conn *bts; char buf[4096]; @@ -990,7 +990,7 @@ static int gprs_ns_cb(struct bsc_fd *bfd, unsigned int what) static struct ipa_proxy_conn *connect_bsc(struct sockaddr_in *sa, int priv_nr, void *data) { struct ipa_proxy_conn *ipc; - struct bsc_fd *bfd; + struct osmo_fd *bfd; int ret, on = 1;
ipc = alloc_conn(); @@ -1018,7 +1018,7 @@ static struct ipa_proxy_conn *connect_bsc(struct sockaddr_in *sa, int priv_nr, v }
/* pre-fill tx_queue with identity request */ - ret = bsc_register_fd(bfd); + ret = osmo_fd_register(bfd); if (ret < 0) { close(bfd->fd); talloc_free(ipc); @@ -1200,6 +1200,6 @@ int main(int argc, char **argv) signal(SIGABRT, &signal_handler);
while (1) { - bsc_select_main(0); + osmo_select_main(0); } } diff --git a/openbsc/src/libabis/input/dahdi.c b/openbsc/src/libabis/input/dahdi.c index 4fcd64f..e02e141 100644 --- a/openbsc/src/libabis/input/dahdi.c +++ b/openbsc/src/libabis/input/dahdi.c @@ -92,7 +92,7 @@ static void handle_dahdi_exception(struct e1inp_ts *ts) } }
-static int handle_ts1_read(struct bsc_fd *bfd) +static int handle_ts1_read(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -184,7 +184,7 @@ static void timeout_ts1_write(void *data)
static void dahdi_write_msg(uint8_t *data, int len, void *cbdata) { - struct bsc_fd *bfd = cbdata; + struct osmo_fd *bfd = cbdata; struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1]; @@ -197,7 +197,7 @@ static void dahdi_write_msg(uint8_t *data, int len, void *cbdata) LOGP(DMI, LOGL_NOTICE, "%s write failed %d\n", __func__, ret); }
-static int handle_ts1_write(struct bsc_fd *bfd) +static int handle_ts1_write(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -259,7 +259,7 @@ static uint8_t * flip_buf_bits ( uint8_t * buf , int len)
#define D_BCHAN_TX_GRAN 160 /* write to a B channel TS */ -static int handle_tsX_write(struct bsc_fd *bfd) +static int handle_tsX_write(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -293,7 +293,7 @@ static int handle_tsX_write(struct bsc_fd *bfd)
#define D_TSX_ALLOC_SIZE (D_BCHAN_TX_GRAN) /* FIXME: read from a B channel TS */ -static int handle_tsX_read(struct bsc_fd *bfd) +static int handle_tsX_read(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -329,7 +329,7 @@ static int handle_tsX_read(struct bsc_fd *bfd) }
/* callback from select.c in case one of the fd's can be read/written */ -static int dahdi_fd_cb(struct bsc_fd *bfd, unsigned int what) +static int dahdi_fd_cb(struct osmo_fd *bfd, unsigned int what) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -420,7 +420,7 @@ static int dahdi_e1_setup(struct e1inp_line *line) unsigned int idx = ts-1; char openstr[128]; struct e1inp_ts *e1i_ts = &line->ts[idx]; - struct bsc_fd *bfd = &e1i_ts->driver.dahdi.fd; + struct osmo_fd *bfd = &e1i_ts->driver.dahdi.fd;
bfd->data = line; bfd->priv_nr = ts; @@ -463,7 +463,7 @@ static int dahdi_e1_setup(struct e1inp_line *line) return bfd->fd; }
- ret = bsc_register_fd(bfd); + ret = osmo_fd_register(bfd); if (ret < 0) { fprintf(stderr, "could not register FD: %s\n", strerror(ret)); diff --git a/openbsc/src/libabis/input/hsl.c b/openbsc/src/libabis/input/hsl.c index 9ff8552..af95afa 100644 --- a/openbsc/src/libabis/input/hsl.c +++ b/openbsc/src/libabis/input/hsl.c @@ -64,7 +64,7 @@
/* data structure for one E1 interface with A-bis */ struct hsl_e1_handle { - struct bsc_fd listen_fd; + struct osmo_fd listen_fd; struct gsm_network *gsmnet; };
@@ -81,7 +81,7 @@ int hsl_drop_oml(struct gsm_bts *bts) struct gsm_bts_trx *trx; struct e1inp_ts *ts; struct e1inp_line *line; - struct bsc_fd *bfd; + struct osmo_fd *bfd;
if (!bts || !bts->oml_link) return -1; @@ -92,7 +92,7 @@ int hsl_drop_oml(struct gsm_bts *bts) e1inp_event(ts, S_INP_TEI_DN, bts->oml_link->tei, bts->oml_link->sapi);
bfd = &ts->driver.ipaccess.fd; - bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd); close(bfd->fd); bfd->fd = -1;
@@ -109,7 +109,7 @@ int hsl_drop_oml(struct gsm_bts *bts) return -1; }
-static int hsl_drop_ts_fd(struct e1inp_ts *ts, struct bsc_fd *bfd) +static int hsl_drop_ts_fd(struct e1inp_ts *ts, struct osmo_fd *bfd) { struct e1inp_sign_link *link, *link2; int bts_nr = -1; @@ -119,7 +119,7 @@ static int hsl_drop_ts_fd(struct e1inp_ts *ts, struct bsc_fd *bfd) e1inp_sign_link_destroy(link); }
- bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd); close(bfd->fd); bfd->fd = -1;
@@ -195,7 +195,7 @@ static int process_hsl_rsl(struct msgb *msg, struct e1inp_line *line) return 0; }
-static int handle_ts1_read(struct bsc_fd *bfd) +static int handle_ts1_read(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -290,7 +290,7 @@ static void timeout_ts1_write(void *data) ts_want_write(e1i_ts); }
-static int handle_ts1_write(struct bsc_fd *bfd) +static int handle_ts1_write(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -346,7 +346,7 @@ static int handle_ts1_write(struct bsc_fd *bfd) }
/* callback from select.c in case one of the fd's can be read/written */ -static int hsl_fd_cb(struct bsc_fd *bfd, unsigned int what) +static int hsl_fd_cb(struct osmo_fd *bfd, unsigned int what) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -377,14 +377,14 @@ struct e1inp_driver hsl_driver = { };
/* callback of the OML listening filedescriptor */ -static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what) +static int listen_fd_cb(struct osmo_fd *listen_bfd, unsigned int what) { int ret; int idx = 0; int i; struct e1inp_line *line; struct e1inp_ts *e1i_ts; - struct bsc_fd *bfd; + struct osmo_fd *bfd; struct sockaddr_in sa; socklen_t sa_len = sizeof(sa);
@@ -421,7 +421,7 @@ static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what) bfd->priv_nr = PRIV_OML; bfd->cb = hsl_fd_cb; bfd->when = BSC_FD_READ; - ret = bsc_register_fd(bfd); + ret = osmo_fd_register(bfd); if (ret < 0) { LOGP(DINP, LOGL_ERROR, "could not register FD\n"); close(bfd->fd); diff --git a/openbsc/src/libabis/input/ipaccess.c b/openbsc/src/libabis/input/ipaccess.c index 95e84f6..13294dc 100644 --- a/openbsc/src/libabis/input/ipaccess.c +++ b/openbsc/src/libabis/input/ipaccess.c @@ -51,8 +51,8 @@
/* data structure for one E1 interface with A-bis */ struct ia_e1_handle { - struct bsc_fd listen_fd; - struct bsc_fd rsl_listen_fd; + struct osmo_fd listen_fd; + struct osmo_fd rsl_listen_fd; struct gsm_network *gsmnet; };
@@ -222,7 +222,7 @@ int ipaccess_send_id_req(int fd)
/* base handling of the ip.access protocol */ int ipaccess_rcvmsg_base(struct msgb *msg, - struct bsc_fd *bfd) + struct osmo_fd *bfd) { uint8_t msg_type = *(msg->l2h); int ret = 0; @@ -243,7 +243,7 @@ int ipaccess_rcvmsg_base(struct msgb *msg, }
static int ipaccess_rcvmsg(struct e1inp_line *line, struct msgb *msg, - struct bsc_fd *bfd) + struct osmo_fd *bfd) { struct tlv_parsed tlvp; uint8_t msg_type = *(msg->l2h); @@ -294,14 +294,14 @@ static int ipaccess_rcvmsg(struct e1inp_line *line, struct msgb *msg, bts->oml_tei, 0); } else if (bfd->priv_nr == PRIV_RSL) { struct e1inp_ts *e1i_ts; - struct bsc_fd *newbfd; + struct osmo_fd *newbfd; struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, trx_id);
/* drop any old rsl connection */ ipaccess_drop_rsl(trx);
if (!bts->oml_link) { - bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd); close(bfd->fd); bfd->fd = -1; talloc_free(bfd); @@ -321,10 +321,10 @@ static int ipaccess_rcvmsg(struct e1inp_line *line, struct msgb *msg, /* get rid of our old temporary bfd */ memcpy(newbfd, bfd, sizeof(*newbfd)); newbfd->priv_nr = PRIV_RSL + trx_id; - bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd); bfd->fd = -1; talloc_free(bfd); - bsc_register_fd(newbfd); + osmo_fd_register(newbfd); } break; } @@ -338,7 +338,7 @@ static int ipaccess_rcvmsg(struct e1inp_line *line, struct msgb *msg, * read one ipa message from the socket * return NULL in case of error */ -struct msgb *ipaccess_read_msg(struct bsc_fd *bfd, int *error) +struct msgb *ipaccess_read_msg(struct osmo_fd *bfd, int *error) { struct msgb *msg = msgb_alloc(TS1_ALLOC_SIZE, "Abis/IP"); struct ipaccess_head *hh; @@ -394,7 +394,7 @@ int ipaccess_drop_oml(struct gsm_bts *bts) struct gsm_bts_trx *trx; struct e1inp_ts *ts; struct e1inp_line *line; - struct bsc_fd *bfd; + struct osmo_fd *bfd;
if (!bts || !bts->oml_link) return -1; @@ -405,7 +405,7 @@ int ipaccess_drop_oml(struct gsm_bts *bts) e1inp_event(ts, S_INP_TEI_DN, bts->oml_link->tei, bts->oml_link->sapi);
bfd = &ts->driver.ipaccess.fd; - bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd); close(bfd->fd); bfd->fd = -1;
@@ -424,7 +424,7 @@ int ipaccess_drop_oml(struct gsm_bts *bts) return -1; }
-static int ipaccess_drop(struct e1inp_ts *ts, struct bsc_fd *bfd) +static int ipaccess_drop(struct e1inp_ts *ts, struct osmo_fd *bfd) { struct e1inp_sign_link *link; int bts_nr; @@ -436,7 +436,7 @@ static int ipaccess_drop(struct e1inp_ts *ts, struct bsc_fd *bfd) * handling yet. So we can safely delete this bfd and * wait for a reconnect. */ - bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd); close(bfd->fd); bfd->fd = -1; talloc_free(bfd); @@ -455,7 +455,7 @@ static int ipaccess_drop(struct e1inp_ts *ts, struct bsc_fd *bfd)
/* error case */ LOGP(DINP, LOGL_ERROR, "Failed to find a signalling link for ts: %p\n", ts); - bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd); close(bfd->fd); bfd->fd = -1; return -1; @@ -463,7 +463,7 @@ static int ipaccess_drop(struct e1inp_ts *ts, struct bsc_fd *bfd)
int ipaccess_drop_rsl(struct gsm_bts_trx *trx) { - struct bsc_fd *bfd; + struct osmo_fd *bfd; struct e1inp_ts *ts;
if (!trx || !trx->rsl_link) @@ -475,7 +475,7 @@ int ipaccess_drop_rsl(struct gsm_bts_trx *trx)
/* close the socket */ bfd = &ts->driver.ipaccess.fd; - bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd); close(bfd->fd); bfd->fd = -1;
@@ -486,7 +486,7 @@ int ipaccess_drop_rsl(struct gsm_bts_trx *trx) return -1; }
-static int handle_ts1_read(struct bsc_fd *bfd) +static int handle_ts1_read(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -588,7 +588,7 @@ static void timeout_ts1_write(void *data) ts_want_write(e1i_ts); }
-static int handle_ts1_write(struct bsc_fd *bfd) +static int handle_ts1_write(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -639,7 +639,7 @@ static int handle_ts1_write(struct bsc_fd *bfd) }
/* callback from select.c in case one of the fd's can be read/written */ -static int ipaccess_fd_cb(struct bsc_fd *bfd, unsigned int what) +static int ipaccess_fd_cb(struct osmo_fd *bfd, unsigned int what) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -670,14 +670,14 @@ struct e1inp_driver ipaccess_driver = { };
/* callback of the OML listening filedescriptor */ -static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what) +static int listen_fd_cb(struct osmo_fd *listen_bfd, unsigned int what) { int ret; int idx = 0; int i; struct e1inp_line *line; struct e1inp_ts *e1i_ts; - struct bsc_fd *bfd; + struct osmo_fd *bfd; struct sockaddr_in sa; socklen_t sa_len = sizeof(sa);
@@ -714,7 +714,7 @@ static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what) bfd->priv_nr = PRIV_OML; bfd->cb = ipaccess_fd_cb; bfd->when = BSC_FD_READ; - ret = bsc_register_fd(bfd); + ret = osmo_fd_register(bfd); if (ret < 0) { LOGP(DINP, LOGL_ERROR, "could not register FD\n"); close(bfd->fd); @@ -729,17 +729,17 @@ static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what) //return e1inp_line_register(line); }
-static int rsl_listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what) +static int rsl_listen_fd_cb(struct osmo_fd *listen_bfd, unsigned int what) { struct sockaddr_in sa; socklen_t sa_len = sizeof(sa); - struct bsc_fd *bfd; + struct osmo_fd *bfd; int ret;
if (!(what & BSC_FD_READ)) return 0;
- bfd = talloc_zero(tall_bsc_ctx, struct bsc_fd); + bfd = talloc_zero(tall_bsc_ctx, struct osmo_fd); if (!bfd) return -ENOMEM;
@@ -756,7 +756,7 @@ static int rsl_listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what) bfd->priv_nr = PRIV_RSL; bfd->cb = ipaccess_fd_cb; bfd->when = BSC_FD_READ; - ret = bsc_register_fd(bfd); + ret = osmo_fd_register(bfd); if (ret < 0) { LOGP(DINP, LOGL_ERROR, "could not register FD\n"); close(bfd->fd); @@ -773,7 +773,7 @@ static int rsl_listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what) int ipaccess_connect(struct e1inp_line *line, struct sockaddr_in *sa) { struct e1inp_ts *e1i_ts = &line->ts[0]; - struct bsc_fd *bfd = &e1i_ts->driver.ipaccess.fd; + struct osmo_fd *bfd = &e1i_ts->driver.ipaccess.fd; int ret, on = 1;
bfd->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); @@ -796,7 +796,7 @@ int ipaccess_connect(struct e1inp_line *line, struct sockaddr_in *sa) return ret; }
- ret = bsc_register_fd(bfd); + ret = osmo_fd_register(bfd); if (ret < 0) { close(bfd->fd); return ret; diff --git a/openbsc/src/libabis/input/misdn.c b/openbsc/src/libabis/input/misdn.c index 3c33792..d239ee7 100644 --- a/openbsc/src/libabis/input/misdn.c +++ b/openbsc/src/libabis/input/misdn.c @@ -85,7 +85,7 @@ const char *get_prim_name(unsigned int prim) return "UNKNOWN"; }
-static int handle_ts1_read(struct bsc_fd *bfd) +static int handle_ts1_read(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -200,7 +200,7 @@ static void timeout_ts1_write(void *data) ts_want_write(e1i_ts); }
-static int handle_ts1_write(struct bsc_fd *bfd) +static int handle_ts1_write(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -253,7 +253,7 @@ static int handle_ts1_write(struct bsc_fd *bfd)
#define BCHAN_TX_GRAN 160 /* write to a B channel TS */ -static int handle_tsX_write(struct bsc_fd *bfd) +static int handle_tsX_write(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -281,7 +281,7 @@ static int handle_tsX_write(struct bsc_fd *bfd)
#define TSX_ALLOC_SIZE 4096 /* FIXME: read from a B channel TS */ -static int handle_tsX_read(struct bsc_fd *bfd) +static int handle_tsX_read(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -329,7 +329,7 @@ static int handle_tsX_read(struct bsc_fd *bfd) }
/* callback from select.c in case one of the fd's can be read/written */ -static int misdn_fd_cb(struct bsc_fd *bfd, unsigned int what) +static int misdn_fd_cb(struct osmo_fd *bfd, unsigned int what) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -365,7 +365,7 @@ static int activate_bchan(struct e1inp_line *line, int ts, int act) int ret; unsigned int idx = ts-1; struct e1inp_ts *e1i_ts = &line->ts[idx]; - struct bsc_fd *bfd = &e1i_ts->driver.misdn.fd; + struct osmo_fd *bfd = &e1i_ts->driver.misdn.fd;
fprintf(stdout, "activate bchan\n"); if (act) @@ -400,7 +400,7 @@ static int mi_e1_setup(struct e1inp_line *line, int release_l2) for (ts = 1; ts < NUM_E1_TS; ts++) { unsigned int idx = ts-1; struct e1inp_ts *e1i_ts = &line->ts[idx]; - struct bsc_fd *bfd = &e1i_ts->driver.misdn.fd; + struct osmo_fd *bfd = &e1i_ts->driver.misdn.fd; struct sockaddr_mISDN addr;
bfd->data = line; @@ -470,7 +470,7 @@ static int mi_e1_setup(struct e1inp_line *line, int release_l2) if (e1i_ts->type == E1INP_TS_TYPE_TRAU) activate_bchan(line, ts, 1);
- ret = bsc_register_fd(bfd); + ret = osmo_fd_register(bfd); if (ret < 0) { fprintf(stderr, "could not register FD: %s\n", strerror(ret)); diff --git a/openbsc/src/libbsc/bsc_msc.c b/openbsc/src/libbsc/bsc_msc.c index f4eee9c..a46f4b9 100644 --- a/openbsc/src/libbsc/bsc_msc.c +++ b/openbsc/src/libbsc/bsc_msc.c @@ -36,7 +36,7 @@
static void connection_loss(struct bsc_msc_connection *con) { - struct bsc_fd *fd; + struct osmo_fd *fd;
fd = &con->write_queue.bfd;
@@ -59,7 +59,7 @@ static void msc_con_timeout(void *_con) }
/* called in the case of a non blocking connect */ -static int msc_connection_connect(struct bsc_fd *fd, unsigned int what) +static int msc_connection_connect(struct osmo_fd *fd, unsigned int what) { int rc; int val; @@ -102,11 +102,11 @@ static int msc_connection_connect(struct bsc_fd *fd, unsigned int what) return 0;
error: - bsc_unregister_fd(fd); + osmo_fd_unregister(fd); connection_loss(con); return -1; } -static void setnonblocking(struct bsc_fd *fd) +static void setnonblocking(struct osmo_fd *fd) { int flags;
@@ -131,7 +131,7 @@ static void setnonblocking(struct bsc_fd *fd) int bsc_msc_connect(struct bsc_msc_connection *con) { struct bsc_msc_dest *dest; - struct bsc_fd *fd; + struct osmo_fd *fd; struct sockaddr_in sin; int on = 1, ret;
@@ -197,7 +197,7 @@ int bsc_msc_connect(struct bsc_msc_connection *con) con->connected(con); }
- ret = bsc_register_fd(fd); + ret = osmo_fd_register(fd); if (ret < 0) { perror("Registering the fd failed"); close(fd->fd); @@ -229,7 +229,7 @@ void bsc_msc_lost(struct bsc_msc_connection *con) osmo_timer_del(&con->timeout_timer);
if (con->write_queue.bfd.fd >= 0) - bsc_unregister_fd(&con->write_queue.bfd); + osmo_fd_unregister(&con->write_queue.bfd); connection_loss(con); }
diff --git a/openbsc/src/libcommon/socket.c b/openbsc/src/libcommon/socket.c index dd25dd7..ff846aa 100644 --- a/openbsc/src/libcommon/socket.c +++ b/openbsc/src/libcommon/socket.c @@ -39,9 +39,9 @@ #include <openbsc/gsm_data.h> #include <osmocom/core/talloc.h>
-int make_sock(struct bsc_fd *bfd, int proto, +int make_sock(struct osmo_fd *bfd, int proto, uint32_t ip, uint16_t port, int priv_nr, - int (*cb)(struct bsc_fd *fd, unsigned int what), void *data) + int (*cb)(struct osmo_fd *fd, unsigned int what), void *data) { struct sockaddr_in addr; int ret, on = 1; @@ -99,7 +99,7 @@ int make_sock(struct bsc_fd *bfd, int proto, } }
- ret = bsc_register_fd(bfd); + ret = osmo_fd_register(bfd); if (ret < 0) { perror("register_listen_fd"); close(bfd->fd); diff --git a/openbsc/src/libgb/gprs_ns.c b/openbsc/src/libgb/gprs_ns.c index 1c3c1b6..2e549f3 100644 --- a/openbsc/src/libgb/gprs_ns.c +++ b/openbsc/src/libgb/gprs_ns.c @@ -858,7 +858,7 @@ void gprs_ns_destroy(struct gprs_ns_inst *nsi) * We don't support Size Procedure, Configuration Procedure, ChangeWeight Procedure */
/* Read a single NS-over-IP message */ -static struct msgb *read_nsip_msg(struct bsc_fd *bfd, int *error, +static struct msgb *read_nsip_msg(struct osmo_fd *bfd, int *error, struct sockaddr_in *saddr) { struct msgb *msg = gprs_ns_msgb_alloc(); @@ -890,7 +890,7 @@ static struct msgb *read_nsip_msg(struct bsc_fd *bfd, int *error, return msg; }
-static int handle_nsip_read(struct bsc_fd *bfd) +static int handle_nsip_read(struct osmo_fd *bfd) { int error; struct sockaddr_in saddr; @@ -907,7 +907,7 @@ static int handle_nsip_read(struct bsc_fd *bfd) return error; }
-static int handle_nsip_write(struct bsc_fd *bfd) +static int handle_nsip_write(struct osmo_fd *bfd) { /* FIXME: actually send the data here instead of nsip_sendmsg() */ return -EIO; @@ -928,7 +928,7 @@ static int nsip_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg) }
/* UDP Port 23000 carries the LLC-in-BSSGP-in-NS protocol stack */ -static int nsip_fd_cb(struct bsc_fd *bfd, unsigned int what) +static int nsip_fd_cb(struct osmo_fd *bfd, unsigned int what) { int rc = 0;
diff --git a/openbsc/src/libgb/gprs_ns_frgre.c b/openbsc/src/libgb/gprs_ns_frgre.c index 85019e1..3662572 100644 --- a/openbsc/src/libgb/gprs_ns_frgre.c +++ b/openbsc/src/libgb/gprs_ns_frgre.c @@ -49,7 +49,7 @@ struct gre_hdr { } __attribute__ ((packed));
/* IPv4 messages inside the GRE tunnel might be GRE keepalives */ -static int handle_rx_gre_ipv4(struct bsc_fd *bfd, struct msgb *msg, +static int handle_rx_gre_ipv4(struct osmo_fd *bfd, struct msgb *msg, struct iphdr *iph, struct gre_hdr *greh) { struct gprs_ns_inst *nsi = bfd->data; @@ -101,7 +101,7 @@ static int handle_rx_gre_ipv4(struct bsc_fd *bfd, struct msgb *msg, (struct sockaddr *)&daddr, sizeof(daddr)); }
-static struct msgb *read_nsfrgre_msg(struct bsc_fd *bfd, int *error, +static struct msgb *read_nsfrgre_msg(struct osmo_fd *bfd, int *error, struct sockaddr_in *saddr) { struct msgb *msg = msgb_alloc(NS_ALLOC_SIZE, "Gb/NS/FR/GRE Rx"); @@ -203,7 +203,7 @@ out_err: int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg, struct sockaddr_in *saddr, enum gprs_ns_ll ll);
-static int handle_nsfrgre_read(struct bsc_fd *bfd) +static int handle_nsfrgre_read(struct osmo_fd *bfd) { int rc; struct sockaddr_in saddr; @@ -230,7 +230,7 @@ out: return rc; }
-static int handle_nsfrgre_write(struct bsc_fd *bfd) +static int handle_nsfrgre_write(struct osmo_fd *bfd) { /* FIXME: actually send the data here instead of nsip_sendmsg() */ return -EIO; @@ -268,7 +268,7 @@ int gprs_ns_frgre_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg) return rc; }
-static int nsfrgre_fd_cb(struct bsc_fd *bfd, unsigned int what) +static int nsfrgre_fd_cb(struct osmo_fd *bfd, unsigned int what) { int rc = 0;
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c index 18d43a0..10f117b 100644 --- a/openbsc/src/libmgcp/mgcp_network.c +++ b/openbsc/src/libmgcp/mgcp_network.c @@ -255,7 +255,7 @@ static int recevice_from(struct mgcp_endpoint *endp, int fd, struct sockaddr_in return rc; }
-static int rtp_data_net(struct bsc_fd *fd, unsigned int what) +static int rtp_data_net(struct osmo_fd *fd, unsigned int what) { char buf[4096]; struct sockaddr_in addr; @@ -327,7 +327,7 @@ static void discover_bts(struct mgcp_endpoint *endp, int proto, struct sockaddr_ } }
-static int rtp_data_bts(struct bsc_fd *fd, unsigned int what) +static int rtp_data_bts(struct osmo_fd *fd, unsigned int what) { char buf[4096]; struct sockaddr_in addr; @@ -381,7 +381,7 @@ static int rtp_data_bts(struct bsc_fd *fd, unsigned int what) }
static int rtp_data_transcoder(struct mgcp_rtp_end *end, struct mgcp_endpoint *_endp, - int dest, struct bsc_fd *fd) + int dest, struct osmo_fd *fd) { char buf[4096]; struct sockaddr_in addr; @@ -421,7 +421,7 @@ static int rtp_data_transcoder(struct mgcp_rtp_end *end, struct mgcp_endpoint *_ return send_to(_endp, dest, proto == PROTO_RTP, &addr, &buf[0], rc); }
-static int rtp_data_trans_net(struct bsc_fd *fd, unsigned int what) +static int rtp_data_trans_net(struct osmo_fd *fd, unsigned int what) { struct mgcp_endpoint *endp; endp = (struct mgcp_endpoint *) fd->data; @@ -429,7 +429,7 @@ static int rtp_data_trans_net(struct bsc_fd *fd, unsigned int what) return rtp_data_transcoder(&endp->trans_net, endp, DEST_NETWORK, fd); }
-static int rtp_data_trans_bts(struct bsc_fd *fd, unsigned int what) +static int rtp_data_trans_bts(struct osmo_fd *fd, unsigned int what) { struct mgcp_endpoint *endp; endp = (struct mgcp_endpoint *) fd->data; @@ -437,7 +437,7 @@ static int rtp_data_trans_bts(struct bsc_fd *fd, unsigned int what) return rtp_data_transcoder(&endp->trans_bts, endp, DEST_BTS, fd); }
-static int create_bind(const char *source_addr, struct bsc_fd *fd, int port) +static int create_bind(const char *source_addr, struct osmo_fd *fd, int port) { struct sockaddr_in addr; int on = 1; @@ -489,14 +489,14 @@ static int bind_rtp(struct mgcp_config *cfg, struct mgcp_rtp_end *rtp_end, int e set_ip_tos(rtp_end->rtcp.fd, cfg->endp_dscp);
rtp_end->rtp.when = BSC_FD_READ; - if (bsc_register_fd(&rtp_end->rtp) != 0) { + if (osmo_fd_register(&rtp_end->rtp) != 0) { LOGP(DMGCP, LOGL_ERROR, "Failed to register RTP port %d on 0x%x\n", rtp_end->local_port, endpno); goto cleanup2; }
rtp_end->rtcp.when = BSC_FD_READ; - if (bsc_register_fd(&rtp_end->rtcp) != 0) { + if (osmo_fd_register(&rtp_end->rtcp) != 0) { LOGP(DMGCP, LOGL_ERROR, "Failed to register RTCP port %d on 0x%x\n", rtp_end->local_port + 1, endpno); goto cleanup3; @@ -505,7 +505,7 @@ static int bind_rtp(struct mgcp_config *cfg, struct mgcp_rtp_end *rtp_end, int e return 0;
cleanup3: - bsc_unregister_fd(&rtp_end->rtp); + osmo_fd_unregister(&rtp_end->rtp); cleanup2: close(rtp_end->rtcp.fd); rtp_end->rtcp.fd = -1; @@ -517,7 +517,7 @@ cleanup0: }
static int int_bind(const char *port, - struct mgcp_rtp_end *end, int (*cb)(struct bsc_fd *, unsigned), + struct mgcp_rtp_end *end, int (*cb)(struct osmo_fd *, unsigned), struct mgcp_endpoint *_endp, int rtp_port) { if (end->rtp.fd != -1 || end->rtcp.fd != -1) { @@ -564,13 +564,13 @@ int mgcp_free_rtp_port(struct mgcp_rtp_end *end) if (end->rtp.fd != -1) { close(end->rtp.fd); end->rtp.fd = -1; - bsc_unregister_fd(&end->rtp); + osmo_fd_unregister(&end->rtp); }
if (end->rtcp.fd != -1) { close(end->rtcp.fd); end->rtcp.fd = -1; - bsc_unregister_fd(&end->rtcp); + osmo_fd_unregister(&end->rtcp); }
return 0; diff --git a/openbsc/src/libmsc/mncc_sock.c b/openbsc/src/libmsc/mncc_sock.c index f3841b0..5ef9922 100644 --- a/openbsc/src/libmsc/mncc_sock.c +++ b/openbsc/src/libmsc/mncc_sock.c @@ -39,8 +39,8 @@
struct mncc_sock_state { struct gsm_network *net; - struct bsc_fd listen_bfd; /* fd for listen socket */ - struct bsc_fd conn_bfd; /* fd for connection to lcr */ + struct osmo_fd listen_bfd; /* fd for listen socket */ + struct osmo_fd conn_bfd; /* fd for connection to lcr */ };
/* FIXME: avoid this */ @@ -85,17 +85,17 @@ void mncc_sock_write_pending(void) }
/* FIXME: move this to libosmocore */ -int osmo_unixsock_listen(struct bsc_fd *bfd, int type, const char *path); +int osmo_unixsock_listen(struct osmo_fd *bfd, int type, const char *path);
static void mncc_sock_close(struct mncc_sock_state *state) { - struct bsc_fd *bfd = &state->conn_bfd; + struct osmo_fd *bfd = &state->conn_bfd;
LOGP(DMNCC, LOGL_NOTICE, "MNCC Socket has LOST connection\n");
close(bfd->fd); bfd->fd = -1; - bsc_unregister_fd(bfd); + osmo_fd_unregister(bfd);
/* re-enable the generation of ACCEPT for new connections */ state->listen_bfd.when |= BSC_FD_READ; @@ -112,7 +112,7 @@ static void mncc_sock_close(struct mncc_sock_state *state) } }
-static int mncc_sock_read(struct bsc_fd *bfd) +static int mncc_sock_read(struct osmo_fd *bfd) { struct mncc_sock_state *state = (struct mncc_sock_state *)bfd->data; struct gsm_mncc *mncc_prim; @@ -149,7 +149,7 @@ close: return -1; }
-static int mncc_sock_write(struct bsc_fd *bfd) +static int mncc_sock_write(struct osmo_fd *bfd) { struct mncc_sock_state *state = bfd->data; struct gsm_network *net = state->net; @@ -189,7 +189,7 @@ close: return -1; }
-static int mncc_sock_cb(struct bsc_fd *bfd, unsigned int flags) +static int mncc_sock_cb(struct osmo_fd *bfd, unsigned int flags) { int rc = 0;
@@ -205,10 +205,10 @@ static int mncc_sock_cb(struct bsc_fd *bfd, unsigned int flags) }
/* accept a new connection */ -static int mncc_sock_accept(struct bsc_fd *bfd, unsigned int flags) +static int mncc_sock_accept(struct osmo_fd *bfd, unsigned int flags) { struct mncc_sock_state *state = (struct mncc_sock_state *)bfd->data; - struct bsc_fd *conn_bfd = &state->conn_bfd; + struct osmo_fd *conn_bfd = &state->conn_bfd; struct sockaddr_un un_addr; socklen_t len; int rc; @@ -234,7 +234,7 @@ static int mncc_sock_accept(struct bsc_fd *bfd, unsigned int flags) conn_bfd->cb = mncc_sock_cb; conn_bfd->data = state;
- if (bsc_register_fd(conn_bfd) != 0) { + if (osmo_fd_register(conn_bfd) != 0) { LOGP(DMNCC, LOGL_ERROR, "Failed to register new connection fd\n"); close(conn_bfd->fd); conn_bfd->fd = -1; @@ -251,7 +251,7 @@ static int mncc_sock_accept(struct bsc_fd *bfd, unsigned int flags) int mncc_sock_init(struct gsm_network *net) { struct mncc_sock_state *state; - struct bsc_fd *bfd; + struct osmo_fd *bfd; int rc;
state = talloc_zero(tall_bsc_ctx, struct mncc_sock_state); @@ -275,7 +275,7 @@ int mncc_sock_init(struct gsm_network *net) bfd->cb = mncc_sock_accept; bfd->data = state;
- rc = bsc_register_fd(bfd); + rc = osmo_fd_register(bfd); if (rc < 0) { LOGP(DMNCC, LOGL_ERROR, "Could not register listen fd: %d\n", rc); close(bfd->fd); @@ -289,7 +289,7 @@ int mncc_sock_init(struct gsm_network *net) }
/* FIXME: move this to libosmocore */ -int osmo_unixsock_listen(struct bsc_fd *bfd, int type, const char *path) +int osmo_unixsock_listen(struct osmo_fd *bfd, int type, const char *path) { struct sockaddr_un local; unsigned int namelen; diff --git a/openbsc/src/libtrau/rtp_proxy.c b/openbsc/src/libtrau/rtp_proxy.c index 04e224c..86d5624 100644 --- a/openbsc/src/libtrau/rtp_proxy.c +++ b/openbsc/src/libtrau/rtp_proxy.c @@ -482,7 +482,7 @@ static int rtp_socket_write(struct rtp_socket *rs, struct rtp_sub_socket *rss)
/* callback for the select.c:bfd_* layer */ -static int rtp_bfd_cb(struct bsc_fd *bfd, unsigned int flags) +static int rtp_bfd_cb(struct osmo_fd *bfd, unsigned int flags) { struct rtp_socket *rs = bfd->data; struct rtp_sub_socket *rss; @@ -536,7 +536,7 @@ struct rtp_socket *rtp_socket_create(void) goto out_free;
init_rss(&rs->rtp, rs, rc, RTP_PRIV_RTP); - rc = bsc_register_fd(&rs->rtp.bfd); + rc = osmo_fd_register(&rs->rtp.bfd); if (rc < 0) goto out_rtp_socket;
@@ -545,7 +545,7 @@ struct rtp_socket *rtp_socket_create(void) goto out_rtp_bfd;
init_rss(&rs->rtcp, rs, rc, RTP_PRIV_RTCP); - rc = bsc_register_fd(&rs->rtcp.bfd); + rc = osmo_fd_register(&rs->rtcp.bfd); if (rc < 0) goto out_rtcp_socket;
@@ -558,11 +558,11 @@ struct rtp_socket *rtp_socket_create(void) return rs;
out_rtcp_bfd: - bsc_unregister_fd(&rs->rtcp.bfd); + osmo_fd_unregister(&rs->rtcp.bfd); out_rtcp_socket: close(rs->rtcp.bfd.fd); out_rtp_bfd: - bsc_unregister_fd(&rs->rtp.bfd); + osmo_fd_unregister(&rs->rtp.bfd); out_rtp_socket: close(rs->rtp.bfd.fd); out_free: @@ -713,11 +713,11 @@ int rtp_socket_free(struct rtp_socket *rs) rs->proxy.other_sock) rs->proxy.other_sock->proxy.other_sock = NULL;
- bsc_unregister_fd(&rs->rtp.bfd); + osmo_fd_unregister(&rs->rtp.bfd); close(rs->rtp.bfd.fd); free_tx_queue(&rs->rtp);
- bsc_unregister_fd(&rs->rtcp.bfd); + osmo_fd_unregister(&rs->rtcp.bfd); close(rs->rtcp.bfd.fd); free_tx_queue(&rs->rtcp);
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 51e5077..6437d93 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -256,7 +256,7 @@ int main(int argc, char **argv) }
while (1) { - bsc_select_main(0); + osmo_select_main(0); }
return 0; diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index e1a95a8..8b7c6e2 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -44,7 +44,7 @@ static void send_ping(struct osmo_msc_data *data); /* * MGCP forwarding code */ -static int mgcp_do_read(struct bsc_fd *fd) +static int mgcp_do_read(struct osmo_fd *fd) { struct osmo_msc_data *data = (struct osmo_msc_data *) fd->data; struct msgb *mgcp; @@ -72,7 +72,7 @@ static int mgcp_do_read(struct bsc_fd *fd) return 0; }
-static int mgcp_do_write(struct bsc_fd *fd, struct msgb *msg) +static int mgcp_do_write(struct osmo_fd *fd, struct msgb *msg) { int ret;
@@ -150,7 +150,7 @@ static int mgcp_create_port(struct osmo_msc_data *data) data->mgcp_agent.read_cb = mgcp_do_read; data->mgcp_agent.write_cb = mgcp_do_write;
- if (bsc_register_fd(&data->mgcp_agent.bfd) != 0) { + if (osmo_fd_register(&data->mgcp_agent.bfd) != 0) { LOGP(DMGCP, LOGL_FATAL, "Failed to register BFD\n"); close(data->mgcp_agent.bfd.fd); data->mgcp_agent.bfd.fd = -1; @@ -175,7 +175,7 @@ int msc_queue_write(struct bsc_msc_connection *conn, struct msgb *msg, int proto return 0; }
-static int msc_alink_do_write(struct bsc_fd *fd, struct msgb *msg) +static int msc_alink_do_write(struct osmo_fd *fd, struct msgb *msg) { int ret;
@@ -208,7 +208,7 @@ static void osmo_ext_handle(struct osmo_msc_data *msc, struct msgb *msg) send_lacs(msc->network, msc->msc_con); }
-static int ipaccess_a_fd_cb(struct bsc_fd *bfd) +static int ipaccess_a_fd_cb(struct osmo_fd *bfd) { int error; struct msgb *msg = ipaccess_read_msg(bfd, &error); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_rf.c b/openbsc/src/osmo-bsc/osmo_bsc_rf.c index 8df0306..5ce6bf5 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_rf.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_rf.c @@ -194,7 +194,7 @@ static void rf_delay_cmd_cb(void *data) } }
-static int rf_read_cmd(struct bsc_fd *fd) +static int rf_read_cmd(struct osmo_fd *fd) { struct osmo_bsc_rf_conn *conn = fd->data; char buf[1]; @@ -203,7 +203,7 @@ static int rf_read_cmd(struct bsc_fd *fd) rc = read(fd->fd, buf, sizeof(buf)); if (rc != sizeof(buf)) { LOGP(DINP, LOGL_ERROR, "Short read %d/%s\n", errno, strerror(errno)); - bsc_unregister_fd(fd); + osmo_fd_unregister(fd); close(fd->fd); write_queue_clear(&conn->queue); talloc_free(conn); @@ -230,7 +230,7 @@ static int rf_read_cmd(struct bsc_fd *fd) return 0; }
-static int rf_write_cmd(struct bsc_fd *fd, struct msgb *msg) +static int rf_write_cmd(struct osmo_fd *fd, struct msgb *msg) { int rc;
@@ -243,7 +243,7 @@ static int rf_write_cmd(struct bsc_fd *fd, struct msgb *msg) return 0; }
-static int rf_ctl_accept(struct bsc_fd *bfd, unsigned int what) +static int rf_ctl_accept(struct osmo_fd *bfd, unsigned int what) { struct osmo_bsc_rf_conn *conn; struct osmo_bsc_rf *rf = bfd->data; @@ -273,7 +273,7 @@ static int rf_ctl_accept(struct bsc_fd *bfd, unsigned int what) conn->queue.write_cb = rf_write_cmd; conn->rf = rf;
- if (bsc_register_fd(&conn->queue.bfd) != 0) { + if (osmo_fd_register(&conn->queue.bfd) != 0) { close(fd); talloc_free(conn); return -1; @@ -286,7 +286,7 @@ struct osmo_bsc_rf *osmo_bsc_rf_create(const char *path, struct gsm_network *net { unsigned int namelen; struct sockaddr_un local; - struct bsc_fd *bfd; + struct osmo_fd *bfd; struct osmo_bsc_rf *rf; int rc;
@@ -341,7 +341,7 @@ struct osmo_bsc_rf *osmo_bsc_rf_create(const char *path, struct gsm_network *net bfd->cb = rf_ctl_accept; bfd->data = rf;
- if (bsc_register_fd(bfd) != 0) { + if (osmo_fd_register(bfd) != 0) { LOGP(DINP, LOGL_ERROR, "Failed to register bfd.\n"); close(bfd->fd); talloc_free(rf); diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c index 2077929..8cb90c5 100644 --- a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c +++ b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c @@ -135,7 +135,7 @@ static int mgcp_change_cb(struct mgcp_trunk_config *cfg, int endpoint, int state return 0; }
-static int read_call_agent(struct bsc_fd *fd, unsigned int what) +static int read_call_agent(struct osmo_fd *fd, unsigned int what) { struct sockaddr_in addr; socklen_t slen = sizeof(addr); @@ -254,7 +254,7 @@ int main(int argc, char **argv) }
- if (bsc_register_fd(&cfg->gw_fd.bfd) != 0) { + if (osmo_fd_register(&cfg->gw_fd.bfd) != 0) { LOGP(DMGCP, LOGL_FATAL, "Failed to register the fd\n"); return -1; } @@ -275,7 +275,7 @@ int main(int argc, char **argv)
/* main loop */ while (1) { - bsc_select_main(0); + osmo_select_main(0); }
diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c index 95a5388..be2666d 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -598,7 +598,7 @@ struct msgb *bsc_mgcp_rewrite(char *input, int length, int endpoint, const char return output; }
-static int mgcp_do_read(struct bsc_fd *fd) +static int mgcp_do_read(struct osmo_fd *fd) { struct bsc_nat *nat; struct msgb *msg, *resp; @@ -637,7 +637,7 @@ static int mgcp_do_read(struct bsc_fd *fd) return 0; }
-static int mgcp_do_write(struct bsc_fd *bfd, struct msgb *msg) +static int mgcp_do_write(struct osmo_fd *bfd, struct msgb *msg) { int rc;
@@ -704,7 +704,7 @@ int bsc_mgcp_nat_init(struct bsc_nat *nat) cfg->gw_fd.read_cb = mgcp_do_read; cfg->gw_fd.write_cb = mgcp_do_write;
- if (bsc_register_fd(&cfg->gw_fd.bfd) != 0) { + if (osmo_fd_register(&cfg->gw_fd.bfd) != 0) { LOGP(DMGCP, LOGL_ERROR, "Failed to register MGCP fd.\n"); close(cfg->gw_fd.bfd.fd); cfg->gw_fd.bfd.fd = -1; diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index ffcd388..0fb5843 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -64,7 +64,7 @@ struct log_target *stderr_target; static const char *config_file = "bsc-nat.cfg"; static struct in_addr local_addr; -static struct bsc_fd bsc_listen; +static struct osmo_fd bsc_listen; static const char *msc_ip = NULL; static struct osmo_timer_list sccp_close; static int daemonize = 0; @@ -780,7 +780,7 @@ static void msc_send_reset(struct bsc_msc_connection *msc_con) LOGP(DMSC, LOGL_NOTICE, "Scheduled GSM0808 reset msg for the MSC.\n"); }
-static int ipaccess_msc_read_cb(struct bsc_fd *bfd) +static int ipaccess_msc_read_cb(struct osmo_fd *bfd) { int error; struct bsc_msc_connection *msc_con; @@ -818,7 +818,7 @@ static int ipaccess_msc_read_cb(struct bsc_fd *bfd) return 0; }
-static int ipaccess_msc_write_cb(struct bsc_fd *bfd, struct msgb *msg) +static int ipaccess_msc_write_cb(struct osmo_fd *bfd, struct msgb *msg) { int rc; rc = write(bfd->fd, msg->data, msg->len); @@ -875,7 +875,7 @@ void bsc_close_connection(struct bsc_connection *connection) /* close endpoints allocated by this BSC */ bsc_mgcp_clear_endpoints_for(connection);
- bsc_unregister_fd(&connection->write_queue.bfd); + osmo_fd_unregister(&connection->write_queue.bfd); close(connection->write_queue.bfd.fd); write_queue_clear(&connection->write_queue); llist_del(&connection->list_entry); @@ -1147,7 +1147,7 @@ exit3: return -1; }
-static int ipaccess_bsc_read_cb(struct bsc_fd *bfd) +static int ipaccess_bsc_read_cb(struct osmo_fd *bfd) { int error; struct bsc_connection *bsc = bfd->data; @@ -1194,7 +1194,7 @@ static int ipaccess_bsc_read_cb(struct bsc_fd *bfd) return 0; }
-static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what) +static int ipaccess_listen_bsc_cb(struct osmo_fd *bfd, unsigned int what) { struct bsc_connection *bsc; int fd, rc, on; @@ -1256,7 +1256,7 @@ static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what) bsc->write_queue.read_cb = ipaccess_bsc_read_cb; bsc->write_queue.write_cb = bsc_write_cb; bsc->write_queue.bfd.when = BSC_FD_READ; - if (bsc_register_fd(&bsc->write_queue.bfd) < 0) { + if (osmo_fd_register(&bsc->write_queue.bfd) < 0) { LOGP(DNAT, LOGL_ERROR, "Failed to register BSC fd.\n"); close(fd); talloc_free(bsc); @@ -1514,7 +1514,7 @@ int main(int argc, char **argv) osmo_timer_schedule(&sccp_close, SCCP_CLOSE_TIME, 0);
while (1) { - bsc_select_main(0); + osmo_select_main(0); }
return 0; diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c index 9ddc948..e796b2b 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c @@ -787,7 +787,7 @@ int bsc_conn_type_to_ctr(struct sccp_connections *conn) return con_to_ctr[conn->con_type]; }
-int bsc_write_cb(struct bsc_fd *bfd, struct msgb *msg) +int bsc_write_cb(struct osmo_fd *bfd, struct msgb *msg) { int rc;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c index 5d599c7..910ef40 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c +++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c @@ -58,7 +58,7 @@ static void bsc_nat_ussd_destroy(struct bsc_nat_ussd_con *con) }
close(con->queue.bfd.fd); - bsc_unregister_fd(&con->queue.bfd); + osmo_fd_unregister(&con->queue.bfd); osmo_timer_del(&con->auth_timeout); write_queue_clear(&con->queue); talloc_free(con); @@ -95,7 +95,7 @@ static int forward_sccp(struct bsc_nat *nat, struct msgb *msg) return 0; }
-static int ussd_read_cb(struct bsc_fd *bfd) +static int ussd_read_cb(struct osmo_fd *bfd) { int error; struct bsc_nat_ussd_con *conn = bfd->data; @@ -191,7 +191,7 @@ static void ussd_start_auth(struct bsc_nat_ussd_con *conn) bsc_do_write(&conn->queue, msg, IPAC_PROTO_IPACCESS); }
-static int ussd_listen_cb(struct bsc_fd *bfd, unsigned int what) +static int ussd_listen_cb(struct osmo_fd *bfd, unsigned int what) { struct bsc_nat_ussd_con *conn; struct bsc_nat *nat; @@ -225,7 +225,7 @@ static int ussd_listen_cb(struct bsc_fd *bfd, unsigned int what) conn->queue.read_cb = ussd_read_cb; conn->queue.write_cb = bsc_write_cb;
- if (bsc_register_fd(&conn->queue.bfd) < 0) { + if (osmo_fd_register(&conn->queue.bfd) < 0) { LOGP(DNAT, LOGL_ERROR, "Failed to register USSD fd.\n"); bsc_nat_ussd_destroy(conn); return -1; diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c index 8fec368..261c426 100644 --- a/openbsc/src/osmo-nitb/bsc_hack.c +++ b/openbsc/src/osmo-nitb/bsc_hack.c @@ -307,6 +307,6 @@ int main(int argc, char **argv)
while (1) { log_reset_context(); - bsc_select_main(0); + osmo_select_main(0); } } diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c index 8e987de..9cb6897 100644 --- a/openbsc/src/utils/bs11_config.c +++ b/openbsc/src/utils/bs11_config.c @@ -903,7 +903,7 @@ int main(int argc, char **argv) status_timer.cb = status_timer_cb;
while (1) { - bsc_select_main(0); + osmo_select_main(0); }
abis_nm_bs11_factory_logon(g_bts, 0); diff --git a/openbsc/src/utils/rs232.c b/openbsc/src/utils/rs232.c index 43b0dc4..b322e8a 100644 --- a/openbsc/src/utils/rs232.c +++ b/openbsc/src/utils/rs232.c @@ -36,7 +36,7 @@ /* adaption layer from GSM 08.59 + 12.21 to RS232 */
struct serial_handle { - struct bsc_fd fd; + struct osmo_fd fd; struct llist_head tx_queue;
struct msgb *rx_msg; @@ -51,7 +51,7 @@ static struct serial_handle _ser_handle, *ser_handle = &_ser_handle;
#define LAPD_HDR_LEN 10
-static int handle_ser_write(struct bsc_fd *bfd); +static int handle_ser_write(struct osmo_fd *bfd);
/* callback from abis_nm */ int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml) @@ -88,7 +88,7 @@ int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml) }
/* select.c callback in case we can write to the RS232 */ -static int handle_ser_write(struct bsc_fd *bfd) +static int handle_ser_write(struct osmo_fd *bfd) { struct serial_handle *sh = bfd->data; struct msgb *msg; @@ -119,7 +119,7 @@ static int handle_ser_write(struct bsc_fd *bfd) #define SERIAL_ALLOC_SIZE 300
/* select.c callback in case we can read from the RS232 */ -static int handle_ser_read(struct bsc_fd *bfd) +static int handle_ser_read(struct osmo_fd *bfd) { struct serial_handle *sh = bfd->data; struct msgb *msg; @@ -182,7 +182,7 @@ static int handle_ser_read(struct bsc_fd *bfd) }
/* select.c callback */ -static int serial_fd_cb(struct bsc_fd *bfd, unsigned int what) +static int serial_fd_cb(struct osmo_fd *bfd, unsigned int what) { int rc = 0;
@@ -237,7 +237,7 @@ int rs232_setup(const char *serial_port, unsigned int delay_ms, ser_handle->fd.data = ser_handle; ser_handle->delay_ms = delay_ms; ser_handle->bts = bts; - rc = bsc_register_fd(&ser_handle->fd); + rc = osmo_fd_register(&ser_handle->fd); if (rc < 0) { fprintf(stderr, "could not register FD: %s\n", strerror(rc)); diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index 258938c..e05af1e 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -68,7 +68,7 @@ int main(int argc, char **argv) subscr_get_channel(subscr, RSL_CHANNEED_TCH_F, subscr_cb, (void*)0x2342L);
while (1) { - bsc_select_main(0); + osmo_select_main(0); } }
From: Pablo Neira Ayuso pablo@gnumonks.org
Summary of changes:
s/signal_cbfn/osmo_signal_cbfn/g s/register_signal_handler/osmo_signal_register_handler/g s/unregister_signal_handler/osmo_signal_unregister_handler/g s/dispatch_signal/osmo_signal_dispatch/g --- openbsc/src/gprs/gb_proxy_main.c | 4 ++-- openbsc/src/gprs/sgsn_main.c | 2 +- openbsc/src/ipaccess/ipaccess-config.c | 4 ++-- openbsc/src/ipaccess/network_listen.c | 4 ++-- openbsc/src/libabis/e1_input.c | 6 +++--- openbsc/src/libabis/input/dahdi.c | 4 ++-- openbsc/src/libbsc/abis_nm.c | 20 ++++++++++---------- openbsc/src/libbsc/abis_om2000.c | 6 +++--- openbsc/src/libbsc/abis_rsl.c | 8 ++++---- openbsc/src/libbsc/bsc_api.c | 2 +- openbsc/src/libbsc/bsc_init.c | 6 +++--- openbsc/src/libbsc/bsc_rll.c | 2 +- openbsc/src/libbsc/bts_ericsson_rbs2000.c | 6 +++--- openbsc/src/libbsc/bts_hsl_femtocell.c | 2 +- openbsc/src/libbsc/bts_ipaccess_nanobts.c | 2 +- openbsc/src/libbsc/bts_siemens_bs11.c | 4 ++-- openbsc/src/libbsc/chan_alloc.c | 6 +++--- openbsc/src/libbsc/handover_decision.c | 2 +- openbsc/src/libbsc/handover_logic.c | 6 +++--- openbsc/src/libbsc/meas_proc.c | 2 +- openbsc/src/libgb/gprs_ns.c | 16 ++++++++-------- openbsc/src/libmsc/gsm_04_08.c | 14 +++++++------- openbsc/src/libmsc/gsm_04_11.c | 2 +- openbsc/src/libmsc/gsm_subscriber.c | 6 +++--- openbsc/src/libmsc/rrlp.c | 4 ++-- openbsc/src/libmsc/silent_call.c | 4 ++-- openbsc/src/libmsc/sms_queue.c | 4 ++-- openbsc/src/libmsc/token_auth.c | 4 ++-- openbsc/src/libmsc/vty_interface_layer3.c | 2 +- openbsc/src/osmo-bsc/osmo_bsc_audio.c | 2 +- openbsc/src/osmo-bsc/osmo_bsc_grace.c | 2 +- openbsc/src/osmo-bsc/osmo_bsc_main.c | 2 +- openbsc/src/osmo-bsc/osmo_bsc_msc.c | 4 ++-- openbsc/src/osmo-bsc/osmo_bsc_rf.c | 2 +- openbsc/src/osmo-bsc/osmo_bsc_sccp.c | 2 +- openbsc/src/osmo-nitb/bsc_hack.c | 2 +- 36 files changed, 85 insertions(+), 85 deletions(-)
diff --git a/openbsc/src/gprs/gb_proxy_main.c b/openbsc/src/gprs/gb_proxy_main.c index b0fb664..9ef9098 100644 --- a/openbsc/src/gprs/gb_proxy_main.c +++ b/openbsc/src/gprs/gb_proxy_main.c @@ -98,7 +98,7 @@ static void signal_handler(int signal)
switch (signal) { case SIGINT: - dispatch_signal(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); + osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); break; @@ -239,7 +239,7 @@ int main(int argc, char **argv) } gbcfg.nsi = bssgp_nsi; gprs_ns_vty_init(bssgp_nsi); - register_signal_handler(SS_NS, &gbprox_signal, NULL); + osmo_signal_register_handler(SS_NS, &gbprox_signal, NULL);
rc = gbproxy_parse_config(config_file, &gbcfg); if (rc < 0) { diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c index 6876939..5fdc5b7 100644 --- a/openbsc/src/gprs/sgsn_main.c +++ b/openbsc/src/gprs/sgsn_main.c @@ -105,7 +105,7 @@ static void signal_handler(int signal)
switch (signal) { case SIGINT: - dispatch_signal(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); + osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); break; diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index 5cd901c..e84892c 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -908,8 +908,8 @@ int main(int argc, char **argv) gsm_bts_trx_alloc(bts); bts->oml_tei = stream_id; - register_signal_handler(SS_NM, nm_sig_cb, NULL); - register_signal_handler(SS_IPAC_NWL, nwl_sig_cb, NULL); + osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL); + osmo_signal_register_handler(SS_IPAC_NWL, nwl_sig_cb, NULL);
ipac_nwl_init();
diff --git a/openbsc/src/ipaccess/network_listen.c b/openbsc/src/ipaccess/network_listen.c index cf0a6dc..27d8a1d 100644 --- a/openbsc/src/ipaccess/network_listen.c +++ b/openbsc/src/ipaccess/network_listen.c @@ -222,7 +222,7 @@ static int test_rep(void *_msg) msg->trx->ipaccess.test_state = IPAC_TEST_S_IDLE; /* Send signal to notify higher layers of test completion */ DEBUGP(DNM, "dispatching S_IPAC_NWL_COMPLETE signal\n"); - dispatch_signal(SS_IPAC_NWL, S_IPAC_NWL_COMPLETE, msg->trx); + osmo_signal_dispatch(SS_IPAC_NWL, S_IPAC_NWL_COMPLETE, msg->trx); break; case NM_IPACC_TESTRES_PARTIAL: msg->trx->ipaccess.test_state = IPAC_TEST_S_PARTIAL; @@ -247,5 +247,5 @@ static int nwl_sig_cb(unsigned int subsys, unsigned int signal,
void ipac_nwl_init(void) { - register_signal_handler(SS_NM, nwl_sig_cb, NULL); + osmo_signal_register_handler(SS_NM, nwl_sig_cb, NULL); } diff --git a/openbsc/src/libabis/e1_input.c b/openbsc/src/libabis/e1_input.c index d3a5cda..dd33852 100644 --- a/openbsc/src/libabis/e1_input.c +++ b/openbsc/src/libabis/e1_input.c @@ -576,7 +576,7 @@ int e1inp_event(struct e1inp_ts *ts, int evt, uint8_t tei, uint8_t sapi) isd.sapi = sapi;
/* report further upwards */ - dispatch_signal(SS_INPUT, evt, &isd); + osmo_signal_dispatch(SS_INPUT, evt, &isd); return 0; }
@@ -612,7 +612,7 @@ int e1inp_line_update(struct e1inp_line *line) * configured */ memset(&isd, 0, sizeof(isd)); isd.line = line; - dispatch_signal(SS_INPUT, S_INP_LINE_INIT, &isd); + osmo_signal_dispatch(SS_INPUT, S_INP_LINE_INIT, &isd);
return rc; } @@ -639,7 +639,7 @@ void e1inp_init(void) { tall_sigl_ctx = talloc_named_const(tall_bsc_ctx, 1, "e1inp_sign_link"); - register_signal_handler(SS_GLOBAL, e1i_sig_cb, NULL); + osmo_signal_register_handler(SS_GLOBAL, e1i_sig_cb, NULL);
e1inp_misdn_init(); #ifdef HAVE_DAHDI_USER_H diff --git a/openbsc/src/libabis/input/dahdi.c b/openbsc/src/libabis/input/dahdi.c index e02e141..9b85b7d 100644 --- a/openbsc/src/libabis/input/dahdi.c +++ b/openbsc/src/libabis/input/dahdi.c @@ -83,11 +83,11 @@ static void handle_dahdi_exception(struct e1inp_ts *ts) switch (evt) { case DAHDI_EVENT_ALARM: /* we should notify the code that the line is gone */ - dispatch_signal(SS_INPUT, S_INP_LINE_ALARM, &isd); + osmo_signal_dispatch(SS_INPUT, S_INP_LINE_ALARM, &isd); break; case DAHDI_EVENT_NOALARM: /* alarm has gone, we should re-start the SABM requests */ - dispatch_signal(SS_INPUT, S_INP_LINE_NOALARM, &isd); + osmo_signal_dispatch(SS_INPUT, S_INP_LINE_NOALARM, &isd); break; } } diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 0007816..6ca45f7 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -701,7 +701,7 @@ static int update_admstate(struct gsm_bts *bts, uint8_t obj_class, nsd.old_state = nm_state; nsd.new_state = &new_state; nsd.obj_inst = obj_inst; - dispatch_signal(SS_NM, S_NM_STATECHG_ADM, &nsd); + osmo_signal_dispatch(SS_NM, S_NM_STATECHG_ADM, &nsd);
nm_state->administrative = adm_state;
@@ -760,7 +760,7 @@ static int abis_nm_rx_statechg_rep(struct msgb *mb) nsd.new_state = &new_state; nsd.obj_inst = &foh->obj_inst; nsd.bts = bts; - dispatch_signal(SS_NM, S_NM_STATECHG_OPER, &nsd); + osmo_signal_dispatch(SS_NM, S_NM_STATECHG_OPER, &nsd); nm_state->operational = new_state.operational; nm_state->availability = new_state.availability; if (nm_state->administrative == 0) @@ -827,15 +827,15 @@ static int abis_nm_rcvmsg_report(struct msgb *mb) break; case NM_MT_SW_ACTIVATED_REP: DEBUGPC(DNM, "Software Activated Report\n"); - dispatch_signal(SS_NM, S_NM_SW_ACTIV_REP, mb); + osmo_signal_dispatch(SS_NM, S_NM_SW_ACTIV_REP, mb); break; case NM_MT_FAILURE_EVENT_REP: rx_fail_evt_rep(mb); - dispatch_signal(SS_NM, S_NM_FAIL_REP, mb); + osmo_signal_dispatch(SS_NM, S_NM_FAIL_REP, mb); break; case NM_MT_TEST_REP: DEBUGPC(DNM, "Test Report\n"); - dispatch_signal(SS_NM, S_NM_TEST_REP, mb); + osmo_signal_dispatch(SS_NM, S_NM_TEST_REP, mb); break; default: DEBUGPC(DNM, "reporting NM MT 0x%02x\n", mt); @@ -1043,7 +1043,7 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
nack_data.msg = mb; nack_data.mt = mt; - dispatch_signal(SS_NM, S_NM_NACK, &nack_data); + osmo_signal_dispatch(SS_NM, S_NM_NACK, &nack_data); abis_nm_queue_send_next(mb->trx->bts); return 0; } @@ -1078,10 +1078,10 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb) DEBUGP(DNM, "CONN MDROP LINK ACK\n"); break; case NM_MT_IPACC_RESTART_ACK: - dispatch_signal(SS_NM, S_NM_IPACC_RESTART_ACK, NULL); + osmo_signal_dispatch(SS_NM, S_NM_IPACC_RESTART_ACK, NULL); break; case NM_MT_IPACC_RESTART_NACK: - dispatch_signal(SS_NM, S_NM_IPACC_RESTART_NACK, NULL); + osmo_signal_dispatch(SS_NM, S_NM_IPACC_RESTART_NACK, NULL); break; case NM_MT_SET_BTS_ATTR_ACK: /* The HSL wants an OPSTART _after_ the SI has been set */ @@ -2884,12 +2884,12 @@ static int abis_nm_rx_ipacc(struct msgb *msg) case NM_MT_IPACC_GET_NVATTR_NACK: signal.trx = gsm_bts_trx_by_nr(msg->trx->bts, foh->obj_inst.trx_nr); signal.msg_type = foh->msg_type; - dispatch_signal(SS_NM, S_NM_IPACC_NACK, &signal); + osmo_signal_dispatch(SS_NM, S_NM_IPACC_NACK, &signal); break; case NM_MT_IPACC_SET_NVATTR_ACK: signal.trx = gsm_bts_trx_by_nr(msg->trx->bts, foh->obj_inst.trx_nr); signal.msg_type = foh->msg_type; - dispatch_signal(SS_NM, S_NM_IPACC_ACK, &signal); + osmo_signal_dispatch(SS_NM, S_NM_IPACC_ACK, &signal); break; default: break; diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 7743cd8..19d2042 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -753,7 +753,7 @@ static void update_mo_state(struct gsm_bts *bts, struct abis_om2k_mo *mo, nsd.new_state = &new_state; nsd.om2k_mo = mo;
- dispatch_signal(SS_NM, S_NM_STATECHG_ADM, &nsd); + osmo_signal_dispatch(SS_NM, S_NM_STATECHG_ADM, &nsd);
nm_state->availability = new_state.availability; } @@ -794,7 +794,7 @@ static void signal_op_state(struct gsm_bts *bts, struct abis_om2k_mo *mo) nsd.new_state = nm_state; nsd.om2k_mo = mo;
- dispatch_signal(SS_NM, S_NM_STATECHG_OPER, &nsd); + osmo_signal_dispatch(SS_NM, S_NM_STATECHG_OPER, &nsd); }
static int abis_om2k_sendmsg(struct gsm_bts *bts, struct msgb *msg) @@ -1434,7 +1434,7 @@ static int process_conf_res(struct gsm_bts *bts, struct msgb *msg) nsd.obj = mo2obj(bts, &o2h->mo); nsd.om2k_mo = &o2h->mo; nsd.accordance_ind = acc; - dispatch_signal(SS_NM, S_NM_OM2K_CONF_RES, &nsd); + osmo_signal_dispatch(SS_NM, S_NM_OM2K_CONF_RES, &nsd);
return ret; } diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 941a4ba..4d61dc0 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -55,7 +55,7 @@ static void send_lchan_signal(int sig_no, struct gsm_lchan *lchan, struct lchan_signal_data sig; sig.lchan = lchan; sig.mr = resp; - dispatch_signal(SS_LCHAN, sig_no, &sig); + osmo_signal_dispatch(SS_LCHAN, sig_no, &sig); }
static uint8_t mdisc_by_msgtype(uint8_t msg_type) @@ -1806,7 +1806,7 @@ static int abis_rsl_rx_ipacc_crcx_ack(struct msgb *msg)
ipac_parse_rtp(lchan, &tv);
- dispatch_signal(SS_ABISIP, S_ABISIP_CRCX_ACK, msg->lchan); + osmo_signal_dispatch(SS_ABISIP, S_ABISIP_CRCX_ACK, msg->lchan);
return 0; } @@ -1823,7 +1823,7 @@ static int abis_rsl_rx_ipacc_mdcx_ack(struct msgb *msg)
rsl_tlv_parse(&tv, dh->data, msgb_l2len(msg)-sizeof(*dh)); ipac_parse_rtp(lchan, &tv); - dispatch_signal(SS_ABISIP, S_ABISIP_MDCX_ACK, msg->lchan); + osmo_signal_dispatch(SS_ABISIP, S_ABISIP_MDCX_ACK, msg->lchan);
return 0; } @@ -1839,7 +1839,7 @@ static int abis_rsl_rx_ipacc_dlcx_ind(struct msgb *msg) print_rsl_cause(LOGL_DEBUG, TLVP_VAL(&tv, RSL_IE_CAUSE), TLVP_LEN(&tv, RSL_IE_CAUSE));
- dispatch_signal(SS_ABISIP, S_ABISIP_DLCX_IND, msg->lchan); + osmo_signal_dispatch(SS_ABISIP, S_ABISIP_DLCX_IND, msg->lchan);
return 0; } diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c index 09e9de4..70d6413 100644 --- a/openbsc/src/libbsc/bsc_api.c +++ b/openbsc/src/libbsc/bsc_api.c @@ -671,5 +671,5 @@ static void handle_chan_nack(struct gsm_subscriber_connection *conn,
static __attribute__((constructor)) void on_dso_load_bsc(void) { - register_signal_handler(SS_LCHAN, bsc_handle_lchan_signal, NULL); + osmo_signal_register_handler(SS_LCHAN, bsc_handle_lchan_signal, NULL); } diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 1d14df1..0056bb0 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -82,7 +82,7 @@ int bsc_shutdown_net(struct gsm_network *net)
llist_for_each_entry(bts, &net->bts_list, list) { LOGP(DNM, LOGL_NOTICE, "shutting down OML for BTS %u\n", bts->nr); - dispatch_signal(SS_GLOBAL, S_GLOBAL_BTS_CLOSE_OM, bts); + osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_BTS_CLOSE_OM, bts); }
return 0; @@ -434,8 +434,8 @@ int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *), if (rc < 0) return rc;
- register_signal_handler(SS_NM, nm_sig_cb, NULL); - register_signal_handler(SS_INPUT, inp_sig_cb, NULL); + osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL); + osmo_signal_register_handler(SS_INPUT, inp_sig_cb, NULL);
llist_for_each_entry(bts, &bsc_gsmnet->bts_list, list) { rc = bootstrap_bts(bts); diff --git a/openbsc/src/libbsc/bsc_rll.c b/openbsc/src/libbsc/bsc_rll.c index 9fbe7c6..d12aeee 100644 --- a/openbsc/src/libbsc/bsc_rll.c +++ b/openbsc/src/libbsc/bsc_rll.c @@ -137,5 +137,5 @@ static int rll_lchan_signal(unsigned int subsys, unsigned int signal,
static __attribute__((constructor)) void on_dso_load_rll(void) { - register_signal_handler(SS_CHALLOC, rll_lchan_signal, NULL); + osmo_signal_register_handler(SS_CHALLOC, rll_lchan_signal, NULL); } diff --git a/openbsc/src/libbsc/bts_ericsson_rbs2000.c b/openbsc/src/libbsc/bts_ericsson_rbs2000.c index 95bf38b..c2ae0e7 100644 --- a/openbsc/src/libbsc/bts_ericsson_rbs2000.c +++ b/openbsc/src/libbsc/bts_ericsson_rbs2000.c @@ -257,9 +257,9 @@ int bts_model_rbs2k_init(void) gsm_btsmodel_set_feature(&model_rbs2k, BTS_FEAT_HOPPING); gsm_btsmodel_set_feature(&model_rbs2k, BTS_FEAT_HSCSD);
- register_signal_handler(SS_INPUT, inp_sig_cb, NULL); - register_signal_handler(SS_GLOBAL, gbl_sig_cb, NULL); - register_signal_handler(SS_NM, nm_sig_cb, NULL); + osmo_signal_register_handler(SS_INPUT, inp_sig_cb, NULL); + osmo_signal_register_handler(SS_GLOBAL, gbl_sig_cb, NULL); + osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL);
return gsm_bts_model_register(&model_rbs2k); } diff --git a/openbsc/src/libbsc/bts_hsl_femtocell.c b/openbsc/src/libbsc/bts_hsl_femtocell.c index 9bbf6d2..7264a21 100644 --- a/openbsc/src/libbsc/bts_hsl_femtocell.c +++ b/openbsc/src/libbsc/bts_hsl_femtocell.c @@ -156,7 +156,7 @@ int bts_model_hslfemto_init(void) gsm_btsmodel_set_feature(&model_hslfemto, BTS_FEAT_GPRS); gsm_btsmodel_set_feature(&model_hslfemto, BTS_FEAT_EGPRS);
- register_signal_handler(SS_INPUT, inp_sig_cb, NULL); + osmo_signal_register_handler(SS_INPUT, inp_sig_cb, NULL);
return gsm_bts_model_register(&model_hslfemto); } diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c index 097a889..13bed22 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c @@ -443,7 +443,7 @@ int bts_model_nanobts_init(void) gsm_btsmodel_set_feature(&model_nanobts, BTS_FEAT_GPRS); gsm_btsmodel_set_feature(&model_nanobts, BTS_FEAT_EGPRS);
- register_signal_handler(SS_NM, nm_sig_cb, NULL); + osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL);
return gsm_bts_model_register(&model_nanobts); } diff --git a/openbsc/src/libbsc/bts_siemens_bs11.c b/openbsc/src/libbsc/bts_siemens_bs11.c index 57625cd..44f9358 100644 --- a/openbsc/src/libbsc/bts_siemens_bs11.c +++ b/openbsc/src/libbsc/bts_siemens_bs11.c @@ -583,8 +583,8 @@ int bts_model_bs11_init(void) gsm_btsmodel_set_feature(&model_bs11, BTS_FEAT_HOPPING); gsm_btsmodel_set_feature(&model_bs11, BTS_FEAT_HSCSD);
- register_signal_handler(SS_INPUT, inp_sig_cb, NULL); - register_signal_handler(SS_GLOBAL, gbl_sig_cb, NULL); + osmo_signal_register_handler(SS_INPUT, inp_sig_cb, NULL); + osmo_signal_register_handler(SS_GLOBAL, gbl_sig_cb, NULL);
return gsm_bts_model_register(&model_bs11); } diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index ff745f5..cfd3874 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -284,7 +284,7 @@ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, struct challoc_signal_data sig; sig.bts = bts; sig.type = type; - dispatch_signal(SS_CHALLOC, S_CHALLOC_ALLOC_FAIL, &sig); + osmo_signal_dispatch(SS_CHALLOC, S_CHALLOC_ALLOC_FAIL, &sig); }
return lchan; @@ -306,7 +306,7 @@ void lchan_free(struct gsm_lchan *lchan) /* We might kill an active channel... */ sig.lchan = lchan; sig.mr = NULL; - dispatch_signal(SS_LCHAN, S_LCHAN_UNEXPECTED_RELEASE, &sig); + osmo_signal_dispatch(SS_LCHAN, S_LCHAN_UNEXPECTED_RELEASE, &sig); }
@@ -330,7 +330,7 @@ void lchan_free(struct gsm_lchan *lchan)
sig.lchan = lchan; sig.bts = lchan->ts->trx->bts; - dispatch_signal(SS_CHALLOC, S_CHALLOC_FREED, &sig); + osmo_signal_dispatch(SS_CHALLOC, S_CHALLOC_FREED, &sig);
if (lchan->conn) { LOGP(DRLL, LOGL_ERROR, "the subscriber connection should be gone.\n"); diff --git a/openbsc/src/libbsc/handover_decision.c b/openbsc/src/libbsc/handover_decision.c index d6fd4f4..24c0f79 100644 --- a/openbsc/src/libbsc/handover_decision.c +++ b/openbsc/src/libbsc/handover_decision.c @@ -293,5 +293,5 @@ static int ho_dec_sig_cb(unsigned int subsys, unsigned int signal,
void on_dso_load_ho_dec(void) { - register_signal_handler(SS_LCHAN, ho_dec_sig_cb, NULL); + osmo_signal_register_handler(SS_LCHAN, ho_dec_sig_cb, NULL); } diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c index bf9588b..1aa8fde 100644 --- a/openbsc/src/libbsc/handover_logic.c +++ b/openbsc/src/libbsc/handover_logic.c @@ -344,7 +344,7 @@ static int ho_ipac_crcx_ack(struct gsm_lchan *new_lchan)
sig_ho.old_lchan = ho->old_lchan; sig_ho.new_lchan = new_lchan; - dispatch_signal(SS_HO, S_HANDOVER_ACK, &sig_ho); + osmo_signal_dispatch(SS_HO, S_HANDOVER_ACK, &sig_ho); return 0; }
@@ -388,6 +388,6 @@ static int ho_logic_sig_cb(unsigned int subsys, unsigned int signal,
static __attribute__((constructor)) void on_dso_load_ho_logic(void) { - register_signal_handler(SS_LCHAN, ho_logic_sig_cb, NULL); - register_signal_handler(SS_ABISIP, ho_logic_sig_cb, NULL); + osmo_signal_register_handler(SS_LCHAN, ho_logic_sig_cb, NULL); + osmo_signal_register_handler(SS_ABISIP, ho_logic_sig_cb, NULL); } diff --git a/openbsc/src/libbsc/meas_proc.c b/openbsc/src/libbsc/meas_proc.c index 5ca013d..5b97e74 100644 --- a/openbsc/src/libbsc/meas_proc.c +++ b/openbsc/src/libbsc/meas_proc.c @@ -80,5 +80,5 @@ static int meas_proc_sig_cb(unsigned int subsys, unsigned int signal,
static __attribute__((constructor)) void on_dso_load_meas(void) { - register_signal_handler(SS_LCHAN, meas_proc_sig_cb, NULL); + osmo_signal_register_handler(SS_LCHAN, meas_proc_sig_cb, NULL); } diff --git a/openbsc/src/libgb/gprs_ns.c b/openbsc/src/libgb/gprs_ns.c index 2e549f3..dab57e6 100644 --- a/openbsc/src/libgb/gprs_ns.c +++ b/openbsc/src/libgb/gprs_ns.c @@ -172,7 +172,7 @@ void nsvc_delete(struct gprs_nsvc *nsvc) talloc_free(nsvc); }
-static void ns_dispatch_signal(struct gprs_nsvc *nsvc, unsigned int signal, +static void ns_osmo_signal_dispatch(struct gprs_nsvc *nsvc, unsigned int signal, uint8_t cause) { struct ns_signal_data nssd; @@ -180,7 +180,7 @@ static void ns_dispatch_signal(struct gprs_nsvc *nsvc, unsigned int signal, nssd.nsvc = nsvc; nssd.cause = cause;
- dispatch_signal(SS_NS, signal, &nssd); + osmo_signal_dispatch(SS_NS, signal, &nssd); }
/* Section 10.3.2, Table 13 */ @@ -437,8 +437,8 @@ static void gprs_ns_timer_cb(void *data) "NSEI=%u Tns-alive expired more then " "%u times, blocking NS-VC\n", nsvc->nsei, nsvc->nsi->timeout[NS_TOUT_TNS_ALIVE_RETRIES]); - ns_dispatch_signal(nsvc, S_NS_ALIVE_EXP, 0); - ns_dispatch_signal(nsvc, S_NS_BLOCK, NS_CAUSE_NSVC_BLOCKED); + ns_osmo_signal_dispatch(nsvc, S_NS_ALIVE_EXP, 0); + ns_osmo_signal_dispatch(nsvc, S_NS_BLOCK, NS_CAUSE_NSVC_BLOCKED); return; } /* Tns-test case: send NS-ALIVE PDU */ @@ -631,7 +631,7 @@ static int gprs_ns_rx_reset(struct gprs_nsvc *nsvc, struct msgb *msg)
/* inform interested parties about the fact that this NSVC * has received RESET */ - ns_dispatch_signal(nsvc, S_NS_RESET, *cause); + ns_osmo_signal_dispatch(nsvc, S_NS_RESET, *cause);
return gprs_ns_tx_reset_ack(nsvc); } @@ -665,7 +665,7 @@ static int gprs_ns_rx_block(struct gprs_nsvc *nsvc, struct msgb *msg) cause = (uint8_t *) TLVP_VAL(&tp, NS_IE_CAUSE); //nsvci = (uint16_t *) TLVP_VAL(&tp, NS_IE_VCI);
- ns_dispatch_signal(nsvc, S_NS_BLOCK, *cause); + ns_osmo_signal_dispatch(nsvc, S_NS_BLOCK, *cause); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]);
return gprs_ns_tx_simple(nsvc, NS_PDUT_BLOCK_ACK); @@ -796,7 +796,7 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg, /* Section 7.2: unblocking procedure */ LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS UNBLOCK\n", nsvc->nsei); nsvc->state &= ~NSE_S_BLOCKED; - ns_dispatch_signal(nsvc, S_NS_UNBLOCK, 0); + ns_osmo_signal_dispatch(nsvc, S_NS_UNBLOCK, 0); rc = gprs_ns_tx_simple(nsvc, NS_PDUT_UNBLOCK_ACK); break; case NS_PDUT_UNBLOCK_ACK: @@ -804,7 +804,7 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg, /* mark NS-VC as unblocked + active */ nsvc->state = NSE_S_ALIVE; nsvc->remote_state = NSE_S_ALIVE; - ns_dispatch_signal(nsvc, S_NS_UNBLOCK, 0); + ns_osmo_signal_dispatch(nsvc, S_NS_UNBLOCK, 0); break; case NS_PDUT_BLOCK: rc = gprs_ns_rx_block(nsvc, msg); diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 9b7549f..153c1e5 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -439,7 +439,7 @@ static int mm_rx_id_resp(struct gsm_subscriber_connection *conn, struct msgb *ms DEBUGP(DMM, "IDENTITY RESPONSE: mi_type=0x%02x MI(%s)\n", mi_type, mi_string);
- dispatch_signal(SS_SUBSCR, S_SUBSCR_IDENTITY, gh->data); + osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, gh->data);
switch (mi_type) { case GSM_MI_TYPE_IMSI: @@ -520,7 +520,7 @@ static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb DEBUGPC(DMM, "mi_type=0x%02x MI(%s) type=%s ", mi_type, mi_string, lupd_name(lu->type));
- dispatch_signal(SS_SUBSCR, S_SUBSCR_IDENTITY, &lu->mi_len); + osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, &lu->mi_len);
switch (lu->type) { case GSM48_LUPD_NORMAL: @@ -842,7 +842,7 @@ static int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct m DEBUGPC(DMM, "serv_type=0x%02x mi_type=0x%02x M(%s)\n", req->cm_service_type, mi_type, mi_string);
- dispatch_signal(SS_SUBSCR, S_SUBSCR_IDENTITY, (classmark2 + classmark2_len)); + osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, (classmark2 + classmark2_len));
if (is_siemens_bts(bts)) send_siemens_mrpci(msg->lchan, classmark2-1); @@ -1190,7 +1190,7 @@ static int gsm48_rx_rr_ho_compl(struct msgb *msg)
sig.lchan = msg->lchan; sig.mr = NULL; - dispatch_signal(SS_LCHAN, S_LCHAN_HANDOVER_COMPL, &sig); + osmo_signal_dispatch(SS_LCHAN, S_LCHAN_HANDOVER_COMPL, &sig); /* FIXME: release old channel */
return 0; @@ -1207,7 +1207,7 @@ static int gsm48_rx_rr_ho_fail(struct msgb *msg)
sig.lchan = msg->lchan; sig.mr = NULL; - dispatch_signal(SS_LCHAN, S_LCHAN_HANDOVER_FAIL, &sig); + osmo_signal_dispatch(SS_LCHAN, S_LCHAN_HANDOVER_FAIL, &sig); /* FIXME: release allocated new channel */
return 0; @@ -3343,6 +3343,6 @@ int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg) */ static __attribute__((constructor)) void on_dso_load_0408(void) { - register_signal_handler(SS_HO, handle_ho_signal, NULL); - register_signal_handler(SS_ABISIP, handle_abisip_signal, NULL); + osmo_signal_register_handler(SS_HO, handle_ho_signal, NULL); + osmo_signal_register_handler(SS_ABISIP, handle_abisip_signal, NULL); } diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 1db307a..326c2b8 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -151,7 +151,7 @@ static void send_signal(int sig_no, sig.trans = trans; sig.sms = sms; sig.paging_result = paging_result; - dispatch_signal(SS_SMS, sig_no, &sig); + osmo_signal_dispatch(SS_SMS, sig_no, &sig); }
/* diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index f0372af..f9eebc8 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -97,7 +97,7 @@ static int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, sig_data.bts = conn ? conn->bts : NULL; sig_data.conn = conn; sig_data.paging_result = event; - dispatch_signal( + osmo_signal_dispatch( SS_PAGING, event == GSM_PAGING_SUCCEEDED ? S_PAGING_SUCCEEDED : S_PAGING_EXPIRED, @@ -337,7 +337,7 @@ int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason) subscr_name(s), s->lac); rc = db_sync_subscriber(s); db_subscriber_update(s); - dispatch_signal(SS_SUBSCR, S_SUBSCR_ATTACHED, s); + osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_ATTACHED, s); break; case GSM_SUBSCRIBER_UPDATE_DETACHED: /* Only detach if we are currently in this area */ @@ -346,7 +346,7 @@ int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason) LOGP(DMM, LOGL_INFO, "Subscriber %s DETACHED\n", subscr_name(s)); rc = db_sync_subscriber(s); db_subscriber_update(s); - dispatch_signal(SS_SUBSCR, S_SUBSCR_DETACHED, s); + osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_DETACHED, s); break; default: fprintf(stderr, "subscr_update with unknown reason: %d\n", diff --git a/openbsc/src/libmsc/rrlp.c b/openbsc/src/libmsc/rrlp.c index 75bccb5..161456a 100644 --- a/openbsc/src/libmsc/rrlp.c +++ b/openbsc/src/libmsc/rrlp.c @@ -99,6 +99,6 @@ static int paging_sig_cb(unsigned int subsys, unsigned int signal,
void on_dso_load_rrlp(void) { - register_signal_handler(SS_SUBSCR, subscr_sig_cb, NULL); - register_signal_handler(SS_PAGING, paging_sig_cb, NULL); + osmo_signal_register_handler(SS_SUBSCR, subscr_sig_cb, NULL); + osmo_signal_register_handler(SS_PAGING, paging_sig_cb, NULL); } diff --git a/openbsc/src/libmsc/silent_call.c b/openbsc/src/libmsc/silent_call.c index 9e9b72d..6a188c8 100644 --- a/openbsc/src/libmsc/silent_call.c +++ b/openbsc/src/libmsc/silent_call.c @@ -56,13 +56,13 @@ static int paging_cb_silent(unsigned int hooknum, unsigned int event, conn->lchan->ts->nr, conn->lchan->ts->trx->arfcn); conn->silent_call = 1; /* increment lchan reference count */ - dispatch_signal(SS_SCALL, S_SCALL_SUCCESS, &sigdata); + osmo_signal_dispatch(SS_SCALL, S_SCALL_SUCCESS, &sigdata); break; case GSM_PAGING_EXPIRED: case GSM_PAGING_BUSY: case GSM_PAGING_OOM: DEBUGP(DSMS, "expired\n"); - dispatch_signal(SS_SCALL, S_SCALL_EXPIRED, &sigdata); + osmo_signal_dispatch(SS_SCALL, S_SCALL_EXPIRED, &sigdata); break; default: rc = -EINVAL; diff --git a/openbsc/src/libmsc/sms_queue.c b/openbsc/src/libmsc/sms_queue.c index 18545bf..30fa5f0 100644 --- a/openbsc/src/libmsc/sms_queue.c +++ b/openbsc/src/libmsc/sms_queue.c @@ -303,8 +303,8 @@ int sms_queue_start(struct gsm_network *network, int max_pending) return -1; }
- register_signal_handler(SS_SUBSCR, sms_subscr_cb, network); - register_signal_handler(SS_SMS, sms_sms_cb, network); + osmo_signal_register_handler(SS_SUBSCR, sms_subscr_cb, network); + osmo_signal_register_handler(SS_SMS, sms_sms_cb, network);
network->sms_queue = sms; INIT_LLIST_HEAD(&sms->pending_sms); diff --git a/openbsc/src/libmsc/token_auth.c b/openbsc/src/libmsc/token_auth.c index b9e481d..cf26ba8 100644 --- a/openbsc/src/libmsc/token_auth.c +++ b/openbsc/src/libmsc/token_auth.c @@ -148,6 +148,6 @@ static int token_sms_cb(unsigned int subsys, unsigned int signal, //static __attribute__((constructor)) void on_dso_load_token(void) void on_dso_load_token(void) { - register_signal_handler(SS_SUBSCR, token_subscr_cb, NULL); - register_signal_handler(SS_SMS, token_sms_cb, NULL); + osmo_signal_register_handler(SS_SUBSCR, token_subscr_cb, NULL); + osmo_signal_register_handler(SS_SMS, token_sms_cb, NULL); } diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 6ac2c65..1d0097a 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -764,7 +764,7 @@ DEFUN(smsqueue_fail,
int bsc_vty_init_extra(void) { - register_signal_handler(SS_SCALL, scall_cbfn, NULL); + osmo_signal_register_handler(SS_SCALL, scall_cbfn, NULL);
install_element_ve(&show_subscr_cmd); install_element_ve(&show_subscr_cache_cmd); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_audio.c b/openbsc/src/osmo-bsc/osmo_bsc_audio.c index 515cfa7..64260aa 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_audio.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_audio.c @@ -65,6 +65,6 @@ static int handle_abisip_signal(unsigned int subsys, unsigned int signal, int osmo_bsc_audio_init(struct gsm_network *net) { net->hardcoded_rtp_payload = 98; - register_signal_handler(SS_ABISIP, handle_abisip_signal, net); + osmo_signal_register_handler(SS_ABISIP, handle_abisip_signal, net); return 0; } diff --git a/openbsc/src/osmo-bsc/osmo_bsc_grace.c b/openbsc/src/osmo-bsc/osmo_bsc_grace.c index f699cf3..c67984b 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_grace.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_grace.c @@ -103,5 +103,5 @@ static int handle_rf_signal(unsigned int subsys, unsigned int signal,
static __attribute__((constructor)) void on_dso_load_grace(void) { - register_signal_handler(SS_RF, handle_rf_signal, NULL); + osmo_signal_register_handler(SS_RF, handle_rf_signal, NULL); } diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 6437d93..78a0ccb 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -149,7 +149,7 @@ static void signal_handler(int signal) switch (signal) { case SIGINT: bsc_shutdown_net(bsc_gsmnet); - dispatch_signal(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); + osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); sleep(3); exit(0); break; diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index 8b7c6e2..b4feded 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -306,7 +306,7 @@ static void msc_connection_connected(struct bsc_msc_connection *con) msc_ping_timeout_cb(data);
sig.data = data; - dispatch_signal(SS_MSC, S_MSC_CONNECTED, &sig); + osmo_signal_dispatch(SS_MSC, S_MSC_CONNECTED, &sig); }
/* @@ -325,7 +325,7 @@ static void msc_connection_was_lost(struct bsc_msc_connection *msc) osmo_timer_del(&data->pong_timer);
sig.data = data; - dispatch_signal(SS_MSC, S_MSC_LOST, &sig); + osmo_signal_dispatch(SS_MSC, S_MSC_LOST, &sig);
msc->is_authenticated = 0; bsc_msc_schedule_connect(msc); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_rf.c b/openbsc/src/osmo-bsc/osmo_bsc_rf.c index 5ce6bf5..78550d7 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_rf.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_rf.c @@ -137,7 +137,7 @@ static void send_signal(struct osmo_bsc_rf *rf, int val) sig.net = rf->gsm_network;
rf->policy = val; - dispatch_signal(SS_RF, val, &sig); + osmo_signal_dispatch(SS_RF, val, &sig); }
static int switch_rf_off(struct osmo_bsc_rf *rf) diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c index 099552b..f4cdf36 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c @@ -282,7 +282,7 @@ int osmo_bsc_sccp_init(struct gsm_network *gsmnet) sccp_connection_set_incoming(&sccp_ssn_bssap, msc_sccp_accept, NULL); sccp_set_read(&sccp_ssn_bssap, msc_sccp_read, gsmnet);
- register_signal_handler(SS_MSC, handle_msc_signal, gsmnet); + osmo_signal_register_handler(SS_MSC, handle_msc_signal, gsmnet);
return 0; } diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c index 261c426..8e987b2 100644 --- a/openbsc/src/osmo-nitb/bsc_hack.c +++ b/openbsc/src/osmo-nitb/bsc_hack.c @@ -175,7 +175,7 @@ static void signal_handler(int signal) switch (signal) { case SIGINT: bsc_shutdown_net(bsc_gsmnet); - dispatch_signal(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); + osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); sleep(3); exit(0); break;
From: Pablo Neira Ayuso pablo@gnumonks.org
Summary of changes:
s/struct write_queue/struct osmo_wqueue/g s/write_queue_init/osmo_wqueue_init/g s/write_queue_clear/osmo_wqueue_clear/g s/write_queue_enqueue/osmo_wqueue_enqueue/g s/write_queue_bfd_cb/osmo_wqueue_bfd_cb/g --- openbsc/include/openbsc/bsc_msc.h | 2 +- openbsc/include/openbsc/bsc_nat.h | 8 ++++---- openbsc/include/openbsc/mgcp.h | 2 +- openbsc/include/openbsc/osmo_bsc_rf.h | 2 +- openbsc/include/openbsc/osmo_msc_data.h | 2 +- openbsc/src/libbsc/bsc_msc.c | 14 +++++++------- openbsc/src/osmo-bsc/osmo_bsc_msc.c | 6 +++--- openbsc/src/osmo-bsc/osmo_bsc_rf.c | 6 +++--- openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c | 6 +++--- openbsc/src/osmo-bsc_nat/bsc_nat.c | 4 ++-- openbsc/src/osmo-bsc_nat/bsc_nat_utils.c | 8 ++++---- openbsc/src/osmo-bsc_nat/bsc_ussd.c | 4 ++-- 12 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/openbsc/include/openbsc/bsc_msc.h b/openbsc/include/openbsc/bsc_msc.h index 88f0de4..9543002 100644 --- a/openbsc/include/openbsc/bsc_msc.h +++ b/openbsc/include/openbsc/bsc_msc.h @@ -35,7 +35,7 @@ struct bsc_msc_dest {
struct bsc_msc_connection { - struct write_queue write_queue; + struct osmo_wqueue write_queue; int is_connected; int is_authenticated; int first_contact; diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index 73911bc..52b2ce5 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -76,7 +76,7 @@ struct bsc_connection { int authenticated;
/* the fd we use to communicate */ - struct write_queue write_queue; + struct osmo_wqueue write_queue;
/* the BSS associated */ struct bsc_config *cfg; @@ -286,7 +286,7 @@ struct bsc_nat { };
struct bsc_nat_ussd_con { - struct write_queue queue; + struct osmo_wqueue queue; struct bsc_nat *nat; int authorized;
@@ -361,8 +361,8 @@ uint32_t bsc_mgcp_extract_ci(const char *resp);
int bsc_write(struct bsc_connection *bsc, struct msgb *msg, int id); -int bsc_do_write(struct write_queue *queue, struct msgb *msg, int id); -int bsc_write_msg(struct write_queue *queue, struct msgb *msg); +int bsc_do_write(struct osmo_wqueue *queue, struct msgb *msg, int id); +int bsc_write_msg(struct osmo_wqueue *queue, struct msgb *msg); int bsc_write_cb(struct osmo_fd *bfd, struct msgb *msg);
/* IMSI allow/deny handling */ diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h index 3d8e711..b9f8116 100644 --- a/openbsc/include/openbsc/mgcp.h +++ b/openbsc/include/openbsc/mgcp.h @@ -135,7 +135,7 @@ struct mgcp_config { struct in_addr transcoder_in; int transcoder_remote_base;
- struct write_queue gw_fd; + struct osmo_wqueue gw_fd;
struct mgcp_port_range bts_ports; struct mgcp_port_range net_ports; diff --git a/openbsc/include/openbsc/osmo_bsc_rf.h b/openbsc/include/openbsc/osmo_bsc_rf.h index dbbb3db..6db28cd 100644 --- a/openbsc/include/openbsc/osmo_bsc_rf.h +++ b/openbsc/include/openbsc/osmo_bsc_rf.h @@ -26,7 +26,7 @@ struct osmo_bsc_rf { };
struct osmo_bsc_rf_conn { - struct write_queue queue; + struct osmo_wqueue queue; struct osmo_bsc_rf *rf; };
diff --git a/openbsc/include/openbsc/osmo_msc_data.h b/openbsc/include/openbsc/osmo_msc_data.h index 495c923..3212b36 100644 --- a/openbsc/include/openbsc/osmo_msc_data.h +++ b/openbsc/include/openbsc/osmo_msc_data.h @@ -59,7 +59,7 @@ struct osmo_msc_data {
/* mgcp agent */ - struct write_queue mgcp_agent; + struct osmo_wqueue mgcp_agent;
/* rf ctl related bits */ char *mid_call_txt; diff --git a/openbsc/src/libbsc/bsc_msc.c b/openbsc/src/libbsc/bsc_msc.c index a46f4b9..e9ffce3 100644 --- a/openbsc/src/libbsc/bsc_msc.c +++ b/openbsc/src/libbsc/bsc_msc.c @@ -42,7 +42,7 @@ static void connection_loss(struct bsc_msc_connection *con)
close(fd->fd); fd->fd = -1; - fd->cb = write_queue_bfd_cb; + fd->cb = osmo_wqueue_bfd_cb; fd->when = 0;
con->is_connected = 0; @@ -64,7 +64,7 @@ static int msc_connection_connect(struct osmo_fd *fd, unsigned int what) int rc; int val; struct bsc_msc_connection *con; - struct write_queue *queue; + struct osmo_wqueue *queue;
socklen_t len = sizeof(val);
@@ -73,7 +73,7 @@ static int msc_connection_connect(struct osmo_fd *fd, unsigned int what) return -1; }
- queue = container_of(fd, struct write_queue, bfd); + queue = container_of(fd, struct osmo_wqueue, bfd); con = container_of(queue, struct bsc_msc_connection, write_queue);
/* From here on we will either be connected or reconnect */ @@ -92,7 +92,7 @@ static int msc_connection_connect(struct osmo_fd *fd, unsigned int what)
/* go to full operation */ - fd->cb = write_queue_bfd_cb; + fd->cb = osmo_wqueue_bfd_cb; fd->when = BSC_FD_READ | BSC_FD_EXCEPT;
con->is_connected = 1; @@ -191,7 +191,7 @@ int bsc_msc_connect(struct bsc_msc_connection *con) return ret; } else { fd->when = BSC_FD_READ | BSC_FD_EXCEPT; - fd->cb = write_queue_bfd_cb; + fd->cb = osmo_wqueue_bfd_cb; con->is_connected = 1; if (con->connected) con->connected(con); @@ -219,13 +219,13 @@ struct bsc_msc_connection *bsc_msc_create(void *ctx, struct llist_head *dests)
con->dests = dests; con->write_queue.bfd.fd = -1; - write_queue_init(&con->write_queue, 100); + osmo_wqueue_init(&con->write_queue, 100); return con; }
void bsc_msc_lost(struct bsc_msc_connection *con) { - write_queue_clear(&con->write_queue); + osmo_wqueue_clear(&con->write_queue); osmo_timer_del(&con->timeout_timer);
if (con->write_queue.bfd.fd >= 0) diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index b4feded..6ea8c4f 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -102,7 +102,7 @@ static void mgcp_forward(struct osmo_msc_data *data, struct msgb *msg)
msgb_put(mgcp, msgb_l2len(msg)); memcpy(mgcp->data, msg->l2h, mgcp->len); - if (write_queue_enqueue(&data->mgcp_agent, mgcp) != 0) { + if (osmo_wqueue_enqueue(&data->mgcp_agent, mgcp) != 0) { LOGP(DMGCP, LOGL_FATAL, "Could not queue message to MGCP GW.\n"); msgb_free(mgcp); } @@ -144,7 +144,7 @@ static int mgcp_create_port(struct osmo_msc_data *data) return -1; }
- write_queue_init(&data->mgcp_agent, 10); + osmo_wqueue_init(&data->mgcp_agent, 10); data->mgcp_agent.bfd.when = BSC_FD_READ; data->mgcp_agent.bfd.data = data; data->mgcp_agent.read_cb = mgcp_do_read; @@ -166,7 +166,7 @@ static int mgcp_create_port(struct osmo_msc_data *data) int msc_queue_write(struct bsc_msc_connection *conn, struct msgb *msg, int proto) { ipaccess_prepend_header(msg, proto); - if (write_queue_enqueue(&conn->write_queue, msg) != 0) { + if (osmo_wqueue_enqueue(&conn->write_queue, msg) != 0) { LOGP(DMSC, LOGL_FATAL, "Failed to queue IPA/%d\n", proto); msgb_free(msg); return -1; diff --git a/openbsc/src/osmo-bsc/osmo_bsc_rf.c b/openbsc/src/osmo-bsc/osmo_bsc_rf.c index 78550d7..11cdffe 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_rf.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_rf.c @@ -69,7 +69,7 @@ static void send_resp(struct osmo_bsc_rf_conn *conn, char send) msg->l2h = msgb_put(msg, 1); msg->l2h[0] = send;
- if (write_queue_enqueue(&conn->queue, msg) != 0) { + if (osmo_wqueue_enqueue(&conn->queue, msg) != 0) { LOGP(DINP, LOGL_ERROR, "Failed to enqueue the answer.\n"); msgb_free(msg); return; @@ -205,7 +205,7 @@ static int rf_read_cmd(struct osmo_fd *fd) LOGP(DINP, LOGL_ERROR, "Short read %d/%s\n", errno, strerror(errno)); osmo_fd_unregister(fd); close(fd->fd); - write_queue_clear(&conn->queue); + osmo_wqueue_clear(&conn->queue); talloc_free(conn); return -1; } @@ -265,7 +265,7 @@ static int rf_ctl_accept(struct osmo_fd *bfd, unsigned int what) return -1; }
- write_queue_init(&conn->queue, 10); + osmo_wqueue_init(&conn->queue, 10); conn->queue.bfd.data = conn; conn->queue.bfd.fd = fd; conn->queue.bfd.when = BSC_FD_READ | BSC_FD_WRITE; diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c index be2666d..9ac54da 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -478,7 +478,7 @@ void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg) return; }
- if (write_queue_enqueue(&bsc->nat->mgcp_cfg->gw_fd, output) != 0) { + if (osmo_wqueue_enqueue(&bsc->nat->mgcp_cfg->gw_fd, output) != 0) { LOGP(DMGCP, LOGL_ERROR, "Failed to queue MGCP msg.\n"); msgb_free(output); } @@ -628,7 +628,7 @@ static int mgcp_do_read(struct osmo_fd *fd)
/* we do have a direct answer... e.g. AUEP */ if (resp) { - if (write_queue_enqueue(&nat->mgcp_cfg->gw_fd, resp) != 0) { + if (osmo_wqueue_enqueue(&nat->mgcp_cfg->gw_fd, resp) != 0) { LOGP(DMGCP, LOGL_ERROR, "Failed to enqueue msg.\n"); msgb_free(resp); } @@ -698,7 +698,7 @@ int bsc_mgcp_nat_init(struct bsc_nat *nat) return -1; }
- write_queue_init(&cfg->gw_fd, 10); + osmo_wqueue_init(&cfg->gw_fd, 10); cfg->gw_fd.bfd.when = BSC_FD_READ; cfg->gw_fd.bfd.data = nat; cfg->gw_fd.read_cb = mgcp_do_read; diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 0fb5843..f732488 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -100,7 +100,7 @@ static void queue_for_msc(struct bsc_msc_connection *con, struct msgb *msg) }
- if (write_queue_enqueue(&con->write_queue, msg) != 0) { + if (osmo_wqueue_enqueue(&con->write_queue, msg) != 0) { LOGP(DINP, LOGL_ERROR, "Failed to enqueue the write.\n"); msgb_free(msg); } @@ -877,7 +877,7 @@ void bsc_close_connection(struct bsc_connection *connection)
osmo_fd_unregister(&connection->write_queue.bfd); close(connection->write_queue.bfd.fd); - write_queue_clear(&connection->write_queue); + osmo_wqueue_clear(&connection->write_queue); llist_del(&connection->list_entry);
talloc_free(connection); diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c index e796b2b..4f90cdf 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c @@ -124,7 +124,7 @@ struct bsc_connection *bsc_connection_alloc(struct bsc_nat *nat) return NULL;
con->nat = nat; - write_queue_init(&con->write_queue, 100); + osmo_wqueue_init(&con->write_queue, 100); return con; }
@@ -335,16 +335,16 @@ int bsc_write(struct bsc_connection *bsc, struct msgb *msg, int proto) return bsc_do_write(&bsc->write_queue, msg, proto); }
-int bsc_do_write(struct write_queue *queue, struct msgb *msg, int proto) +int bsc_do_write(struct osmo_wqueue *queue, struct msgb *msg, int proto) { /* prepend the header */ ipaccess_prepend_header(msg, proto); return bsc_write_msg(queue, msg); }
-int bsc_write_msg(struct write_queue *queue, struct msgb *msg) +int bsc_write_msg(struct osmo_wqueue *queue, struct msgb *msg) { - if (write_queue_enqueue(queue, msg) != 0) { + if (osmo_wqueue_enqueue(queue, msg) != 0) { LOGP(DINP, LOGL_ERROR, "Failed to enqueue the write.\n"); msgb_free(msg); return -1; diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c index 910ef40..69cb7a4 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c +++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c @@ -60,7 +60,7 @@ static void bsc_nat_ussd_destroy(struct bsc_nat_ussd_con *con) close(con->queue.bfd.fd); osmo_fd_unregister(&con->queue.bfd); osmo_timer_del(&con->auth_timeout); - write_queue_clear(&con->queue); + osmo_wqueue_clear(&con->queue); talloc_free(con); }
@@ -218,7 +218,7 @@ static int ussd_listen_cb(struct osmo_fd *bfd, unsigned int what) return -1; }
- write_queue_init(&conn->queue, 10); + osmo_wqueue_init(&conn->queue, 10); conn->queue.bfd.data = conn; conn->queue.bfd.fd = fd; conn->queue.bfd.when = BSC_FD_READ;
From: Pablo Neira Ayuso pablo@gnumonks.org
Summary of changes:
s/struct counter/struct osmo_counter/g s/counter_inc/osmo_counter_inc/g s/counter_get/osmo_counter_get/g s/counter_reset/osmo_counter_reset/g s/counter_alloc/osmo_counter_alloc/g s/counter_free/osmo_counter_free --- openbsc/include/openbsc/bsc_nat.h | 12 +++--- openbsc/include/openbsc/db.h | 4 +- openbsc/include/openbsc/gsm_data.h | 60 ++++++++++++++-------------- openbsc/src/libbsc/abis_rsl.c | 8 ++-- openbsc/src/libbsc/bsc_init.c | 4 +- openbsc/src/libbsc/bsc_vty.c | 18 ++++---- openbsc/src/libbsc/gsm_04_08_utils.c | 2 +- openbsc/src/libbsc/handover_logic.c | 10 ++-- openbsc/src/libbsc/paging.c | 6 +- openbsc/src/libcommon/gsm_data.c | 60 ++++++++++++++-------------- openbsc/src/libmsc/db.c | 2 +- openbsc/src/libmsc/gsm_04_08.c | 20 +++++----- openbsc/src/libmsc/gsm_04_11.c | 10 ++-- openbsc/src/libmsc/vty_interface_layer3.c | 44 ++++++++++---------- openbsc/src/osmo-bsc_nat/bsc_nat.c | 6 +- openbsc/src/osmo-bsc_nat/bsc_nat_utils.c | 12 +++--- openbsc/src/osmo-bsc_nat/bsc_nat_vty.c | 10 ++-- openbsc/src/osmo-bsc_nat/bsc_sccp.c | 2 +- openbsc/src/osmo-bsc_nat/bsc_ussd.c | 2 +- openbsc/src/osmo-nitb/bsc_hack.c | 4 +- openbsc/src/utils/bs11_config.c | 2 +- 21 files changed, 149 insertions(+), 149 deletions(-)
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index 52b2ce5..0894f25 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -179,21 +179,21 @@ struct bsc_endpoint { */ struct bsc_nat_statistics { struct { - struct counter *conn; - struct counter *calls; + struct osmo_counter *conn; + struct osmo_counter *calls; } sccp;
struct { - struct counter *reconn; - struct counter *auth_fail; + struct osmo_counter *reconn; + struct osmo_counter *auth_fail; } bsc;
struct { - struct counter *reconn; + struct osmo_counter *reconn; } msc;
struct { - struct counter *reconn; + struct osmo_counter *reconn; } ussd; };
diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h index 818d3d4..37011a1 100644 --- a/openbsc/include/openbsc/db.h +++ b/openbsc/include/openbsc/db.h @@ -73,8 +73,8 @@ int db_apdu_blob_store(struct gsm_subscriber *subscr, uint8_t *apdu);
/* Statistics counter storage */ -struct counter; -int db_store_counter(struct counter *ctr); +struct osmo_counter; +int db_store_counter(struct osmo_counter *ctr); struct rate_ctr_group; int db_store_rate_ctr_group(struct rate_ctr_group *ctrg);
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index e6d6467..bc276d1 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -646,52 +646,52 @@ struct gsm_bts { /* Some statistics of our network */ struct gsmnet_stats { struct { - struct counter *total; - struct counter *no_channel; + struct osmo_counter *total; + struct osmo_counter *no_channel; } chreq; struct { - struct counter *attempted; - struct counter *no_channel; /* no channel available */ - struct counter *timeout; /* T3103 timeout */ - struct counter *completed; /* HO COMPL received */ - struct counter *failed; /* HO FAIL received */ + struct osmo_counter *attempted; + struct osmo_counter *no_channel; /* no channel available */ + struct osmo_counter *timeout; /* T3103 timeout */ + struct osmo_counter *completed; /* HO COMPL received */ + struct osmo_counter *failed; /* HO FAIL received */ } handover; struct { - struct counter *attach; - struct counter *normal; - struct counter *periodic; - struct counter *detach; + struct osmo_counter *attach; + struct osmo_counter *normal; + struct osmo_counter *periodic; + struct osmo_counter *detach; } loc_upd_type; struct { - struct counter *reject; - struct counter *accept; + struct osmo_counter *reject; + struct osmo_counter *accept; } loc_upd_resp; struct { - struct counter *attempted; - struct counter *detached; - struct counter *completed; - struct counter *expired; + struct osmo_counter *attempted; + struct osmo_counter *detached; + struct osmo_counter *completed; + struct osmo_counter *expired; } paging; struct { - struct counter *submitted; /* MO SMS submissions */ - struct counter *no_receiver; - struct counter *delivered; /* MT SMS deliveries */ - struct counter *rp_err_mem; - struct counter *rp_err_other; + struct osmo_counter *submitted; /* MO SMS submissions */ + struct osmo_counter *no_receiver; + struct osmo_counter *delivered; /* MT SMS deliveries */ + struct osmo_counter *rp_err_mem; + struct osmo_counter *rp_err_other; } sms; struct { - struct counter *mo_setup; - struct counter *mo_connect_ack; - struct counter *mt_setup; - struct counter *mt_connect; + struct osmo_counter *mo_setup; + struct osmo_counter *mo_connect_ack; + struct osmo_counter *mt_setup; + struct osmo_counter *mt_connect; } call; struct { - struct counter *rf_fail; - struct counter *rll_err; + struct osmo_counter *rf_fail; + struct osmo_counter *rll_err; } chan; struct { - struct counter *oml_fail; - struct counter *rsl_fail; + struct osmo_counter *oml_fail; + struct osmo_counter *rsl_fail; } bts; };
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 4d61dc0..1001003 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -922,7 +922,7 @@ static int rsl_rx_conn_fail(struct msgb *msg)
LOGPC(DRSL, LOGL_NOTICE, "\n"); /* FIXME: only free it after channel release ACK */ - counter_inc(msg->lchan->ts->trx->bts->network->stats.chan.rf_fail); + osmo_counter_inc(msg->lchan->ts->trx->bts->network->stats.chan.rf_fail); return rsl_rf_chan_release(msg->lchan, 1); }
@@ -1268,7 +1268,7 @@ static int rsl_rx_chan_rqd(struct msgb *msg) lctype = get_ctype_by_chreq(bts->network, rqd_ref->ra); chreq_reason = get_reason_by_chreq(rqd_ref->ra, bts->network->neci);
- counter_inc(bts->network->stats.chreq.total); + osmo_counter_inc(bts->network->stats.chreq.total);
/* * We want LOCATION UPDATES to succeed and will assign a TCH @@ -1281,7 +1281,7 @@ static int rsl_rx_chan_rqd(struct msgb *msg) if (!lchan) { LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s 0x%x\n", msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra); - counter_inc(bts->network->stats.chreq.no_channel); + osmo_counter_inc(bts->network->stats.chreq.no_channel); /* FIXME gather multiple CHAN RQD and reject up to 4 at the same time */ if (bts->network->T3122) rsl_send_imm_ass_rej(bts, 1, rqd_ref, bts->network->T3122 & 0xff); @@ -1436,7 +1436,7 @@ static int rsl_rx_rll_err_ind(struct msgb *msg) rll_indication(msg->lchan, rllh->link_id, BSC_RLLR_IND_ERR_IND);
if (rlm_cause[1] == RLL_CAUSE_T200_EXPIRED) { - counter_inc(msg->lchan->ts->trx->bts->network->stats.chan.rll_err); + osmo_counter_inc(msg->lchan->ts->trx->bts->network->stats.chan.rll_err); return rsl_rf_chan_release(msg->lchan, 1); }
diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 0056bb0..8e62dac 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -275,9 +275,9 @@ static int inp_sig_cb(unsigned int subsys, unsigned int signal, LOGP(DMI, LOGL_ERROR, "Lost some E1 TEI link: %d %p\n", isd->link_type, trx);
if (isd->link_type == E1INP_SIGN_OML) - counter_inc(trx->bts->network->stats.bts.oml_fail); + osmo_counter_inc(trx->bts->network->stats.bts.oml_fail); else if (isd->link_type == E1INP_SIGN_RSL) - counter_inc(trx->bts->network->stats.bts.rsl_fail); + osmo_counter_inc(trx->bts->network->stats.bts.rsl_fail);
/* * free all allocated channels. change the nm_state so the diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 5a4bd6e..4cd027f 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -2518,18 +2518,18 @@ DEFUN(cfg_ts_e1_subslot, void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net) { vty_out(vty, "Channel Requests : %lu total, %lu no channel%s", - counter_get(net->stats.chreq.total), - counter_get(net->stats.chreq.no_channel), VTY_NEWLINE); + osmo_counter_get(net->stats.chreq.total), + osmo_counter_get(net->stats.chreq.no_channel), VTY_NEWLINE); vty_out(vty, "Channel Failures : %lu rf_failures, %lu rll failures%s", - counter_get(net->stats.chan.rf_fail), - counter_get(net->stats.chan.rll_err), VTY_NEWLINE); + osmo_counter_get(net->stats.chan.rf_fail), + osmo_counter_get(net->stats.chan.rll_err), VTY_NEWLINE); vty_out(vty, "Paging : %lu attempted, %lu complete, %lu expired%s", - counter_get(net->stats.paging.attempted), - counter_get(net->stats.paging.completed), - counter_get(net->stats.paging.expired), VTY_NEWLINE); + osmo_counter_get(net->stats.paging.attempted), + osmo_counter_get(net->stats.paging.completed), + osmo_counter_get(net->stats.paging.expired), VTY_NEWLINE); vty_out(vty, "BTS failures : %lu OML, %lu RSL%s", - counter_get(net->stats.bts.oml_fail), - counter_get(net->stats.bts.rsl_fail), VTY_NEWLINE); + osmo_counter_get(net->stats.bts.oml_fail), + osmo_counter_get(net->stats.bts.rsl_fail), VTY_NEWLINE); }
DEFUN(logging_fltr_imsi, diff --git a/openbsc/src/libbsc/gsm_04_08_utils.c b/openbsc/src/libbsc/gsm_04_08_utils.c index 1cff1d9..7599cea 100644 --- a/openbsc/src/libbsc/gsm_04_08_utils.c +++ b/openbsc/src/libbsc/gsm_04_08_utils.c @@ -300,7 +300,7 @@ int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, subscr = conn->subscr; }
- counter_inc(bts->network->stats.paging.completed); + osmo_counter_inc(bts->network->stats.paging.completed);
/* Stop paging on the bts we received the paging response */ paging_request_stop(conn->bts, subscr, conn, msg); diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c index 1aa8fde..0f1582e 100644 --- a/openbsc/src/libbsc/handover_logic.c +++ b/openbsc/src/libbsc/handover_logic.c @@ -96,7 +96,7 @@ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) DEBUGP(DHO, "(old_lchan on BTS %u, new BTS %u)\n", old_lchan->ts->trx->bts->nr, bts->nr);
- counter_inc(bts->network->stats.handover.attempted); + osmo_counter_inc(bts->network->stats.handover.attempted);
if (!old_lchan->conn) { LOGP(DHO, LOGL_ERROR, "Old lchan lacks connection data.\n"); @@ -106,7 +106,7 @@ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) new_lchan = lchan_alloc(bts, old_lchan->type, 0); if (!new_lchan) { LOGP(DHO, LOGL_NOTICE, "No free channel\n"); - counter_inc(bts->network->stats.handover.no_channel); + osmo_counter_inc(bts->network->stats.handover.no_channel); return -ENOSPC; }
@@ -182,7 +182,7 @@ static void ho_T3103_cb(void *_ho) struct gsm_network *net = ho->new_lchan->ts->trx->bts->network;
DEBUGP(DHO, "HO T3103 expired\n"); - counter_inc(net->stats.handover.timeout); + osmo_counter_inc(net->stats.handover.timeout);
ho->new_lchan->conn->ho_lchan = NULL; ho->new_lchan->conn = NULL; @@ -262,7 +262,7 @@ static int ho_gsm48_ho_compl(struct gsm_lchan *new_lchan) ho->old_lchan->ts->trx->bts->nr, new_lchan->ts->trx->bts->nr, ho->old_lchan->ts->trx->arfcn, new_lchan->ts->trx->arfcn);
- counter_inc(net->stats.handover.completed); + osmo_counter_inc(net->stats.handover.completed);
osmo_timer_del(&ho->T3103);
@@ -300,7 +300,7 @@ static int ho_gsm48_ho_fail(struct gsm_lchan *old_lchan) return -ENODEV; }
- counter_inc(net->stats.handover.failed); + osmo_counter_inc(net->stats.handover.failed);
osmo_timer_del(&ho->T3103); llist_del(&ho->list); diff --git a/openbsc/src/libbsc/paging.c b/openbsc/src/libbsc/paging.c index 324104f..2dcd3b4 100644 --- a/openbsc/src/libbsc/paging.c +++ b/openbsc/src/libbsc/paging.c @@ -262,7 +262,7 @@ static void paging_T3113_expired(void *data) req, req->subscr->imsi);
/* must be destroyed before calling cbfn, to prevent double free */ - counter_inc(req->bts->network->stats.paging.expired); + osmo_counter_inc(req->bts->network->stats.paging.expired); cbfn_param = req->cbfn_param; cbfn = req->cbfn;
@@ -311,7 +311,7 @@ int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr, struct gsm_bts *bts = NULL; int num_pages = 0;
- counter_inc(network->stats.paging.attempted); + osmo_counter_inc(network->stats.paging.attempted);
/* start paging subscriber on all BTS within Location Area */ do { @@ -337,7 +337,7 @@ int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr, } while (1);
if (num_pages == 0) - counter_inc(network->stats.paging.detached); + osmo_counter_inc(network->stats.paging.detached);
return num_pages; } diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index 5437548..45e56af 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -290,36 +290,36 @@ struct gsm_network *gsm_network_init(uint16_t country_code, uint16_t network_cod INIT_LLIST_HEAD(&net->upqueue); INIT_LLIST_HEAD(&net->bts_list);
- net->stats.chreq.total = counter_alloc("net.chreq.total"); - net->stats.chreq.no_channel = counter_alloc("net.chreq.no_channel"); - net->stats.handover.attempted = counter_alloc("net.handover.attempted"); - net->stats.handover.no_channel = counter_alloc("net.handover.no_channel"); - net->stats.handover.timeout = counter_alloc("net.handover.timeout"); - net->stats.handover.completed = counter_alloc("net.handover.completed"); - net->stats.handover.failed = counter_alloc("net.handover.failed"); - net->stats.loc_upd_type.attach = counter_alloc("net.loc_upd_type.attach"); - net->stats.loc_upd_type.normal = counter_alloc("net.loc_upd_type.normal"); - net->stats.loc_upd_type.periodic = counter_alloc("net.loc_upd_type.periodic"); - net->stats.loc_upd_type.detach = counter_alloc("net.imsi_detach.count"); - net->stats.loc_upd_resp.reject = counter_alloc("net.loc_upd_resp.reject"); - net->stats.loc_upd_resp.accept = counter_alloc("net.loc_upd_resp.accept"); - net->stats.paging.attempted = counter_alloc("net.paging.attempted"); - net->stats.paging.detached = counter_alloc("net.paging.detached"); - net->stats.paging.completed = counter_alloc("net.paging.completed"); - net->stats.paging.expired = counter_alloc("net.paging.expired"); - net->stats.sms.submitted = counter_alloc("net.sms.submitted"); - net->stats.sms.no_receiver = counter_alloc("net.sms.no_receiver"); - net->stats.sms.delivered = counter_alloc("net.sms.delivered"); - net->stats.sms.rp_err_mem = counter_alloc("net.sms.rp_err_mem"); - net->stats.sms.rp_err_other = counter_alloc("net.sms.rp_err_other"); - net->stats.call.mo_setup = counter_alloc("net.call.mo_setup"); - net->stats.call.mo_connect_ack = counter_alloc("net.call.mo_connect_ack"); - net->stats.call.mt_setup = counter_alloc("net.call.mt_setup"); - net->stats.call.mt_connect = counter_alloc("net.call.mt_connect"); - net->stats.chan.rf_fail = counter_alloc("net.chan.rf_fail"); - net->stats.chan.rll_err = counter_alloc("net.chan.rll_err"); - net->stats.bts.oml_fail = counter_alloc("net.bts.oml_fail"); - net->stats.bts.rsl_fail = counter_alloc("net.bts.rsl_fail"); + net->stats.chreq.total = osmo_counter_alloc("net.chreq.total"); + net->stats.chreq.no_channel = osmo_counter_alloc("net.chreq.no_channel"); + net->stats.handover.attempted = osmo_counter_alloc("net.handover.attempted"); + net->stats.handover.no_channel = osmo_counter_alloc("net.handover.no_channel"); + net->stats.handover.timeout = osmo_counter_alloc("net.handover.timeout"); + net->stats.handover.completed = osmo_counter_alloc("net.handover.completed"); + net->stats.handover.failed = osmo_counter_alloc("net.handover.failed"); + net->stats.loc_upd_type.attach = osmo_counter_alloc("net.loc_upd_type.attach"); + net->stats.loc_upd_type.normal = osmo_counter_alloc("net.loc_upd_type.normal"); + net->stats.loc_upd_type.periodic = osmo_counter_alloc("net.loc_upd_type.periodic"); + net->stats.loc_upd_type.detach = osmo_counter_alloc("net.imsi_detach.count"); + net->stats.loc_upd_resp.reject = osmo_counter_alloc("net.loc_upd_resp.reject"); + net->stats.loc_upd_resp.accept = osmo_counter_alloc("net.loc_upd_resp.accept"); + net->stats.paging.attempted = osmo_counter_alloc("net.paging.attempted"); + net->stats.paging.detached = osmo_counter_alloc("net.paging.detached"); + net->stats.paging.completed = osmo_counter_alloc("net.paging.completed"); + net->stats.paging.expired = osmo_counter_alloc("net.paging.expired"); + net->stats.sms.submitted = osmo_counter_alloc("net.sms.submitted"); + net->stats.sms.no_receiver = osmo_counter_alloc("net.sms.no_receiver"); + net->stats.sms.delivered = osmo_counter_alloc("net.sms.delivered"); + net->stats.sms.rp_err_mem = osmo_counter_alloc("net.sms.rp_err_mem"); + net->stats.sms.rp_err_other = osmo_counter_alloc("net.sms.rp_err_other"); + net->stats.call.mo_setup = osmo_counter_alloc("net.call.mo_setup"); + net->stats.call.mo_connect_ack = osmo_counter_alloc("net.call.mo_connect_ack"); + net->stats.call.mt_setup = osmo_counter_alloc("net.call.mt_setup"); + net->stats.call.mt_connect = osmo_counter_alloc("net.call.mt_connect"); + net->stats.chan.rf_fail = osmo_counter_alloc("net.chan.rf_fail"); + net->stats.chan.rll_err = osmo_counter_alloc("net.chan.rll_err"); + net->stats.bts.oml_fail = osmo_counter_alloc("net.bts.oml_fail"); + net->stats.bts.rsl_fail = osmo_counter_alloc("net.bts.rsl_fail");
net->mncc_recv = mncc_recv;
diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index f08fb79..d25bc21 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -1242,7 +1242,7 @@ int db_apdu_blob_store(struct gsm_subscriber *subscr, return 0; }
-int db_store_counter(struct counter *ctr) +int db_store_counter(struct osmo_counter *ctr) { dbi_result result; char *q_name; diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 153c1e5..6486b19 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -361,7 +361,7 @@ int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause) struct gsm_bts *bts = conn->bts; struct msgb *msg;
- counter_inc(bts->network->stats.loc_upd_resp.reject); + osmo_counter_inc(bts->network->stats.loc_upd_resp.reject);
msg = gsm48_create_loc_upd_rej(cause); if (!msg) { @@ -403,7 +403,7 @@ int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, uint32_t tmsi)
DEBUGP(DMM, "-> LOCATION UPDATE ACCEPT\n");
- counter_inc(bts->network->stats.loc_upd_resp.accept); + osmo_counter_inc(bts->network->stats.loc_upd_resp.accept);
return gsm48_conn_sendmsg(msg, conn, NULL); } @@ -524,13 +524,13 @@ static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb
switch (lu->type) { case GSM48_LUPD_NORMAL: - counter_inc(bts->network->stats.loc_upd_type.normal); + osmo_counter_inc(bts->network->stats.loc_upd_type.normal); break; case GSM48_LUPD_IMSI_ATT: - counter_inc(bts->network->stats.loc_upd_type.attach); + osmo_counter_inc(bts->network->stats.loc_upd_type.attach); break; case GSM48_LUPD_PERIODIC: - counter_inc(bts->network->stats.loc_upd_type.periodic); + osmo_counter_inc(bts->network->stats.loc_upd_type.periodic); break; }
@@ -886,7 +886,7 @@ static int gsm48_rx_mm_imsi_detach_ind(struct msgb *msg) DEBUGP(DMM, "IMSI DETACH INDICATION: mi_type=0x%02x MI(%s): ", mi_type, mi_string);
- counter_inc(bts->network->stats.loc_upd_type.detach); + osmo_counter_inc(bts->network->stats.loc_upd_type.detach);
switch (mi_type) { case GSM_MI_TYPE_TMSI: @@ -1892,7 +1892,7 @@ static int gsm48_cc_rx_setup(struct gsm_trans *trans, struct msgb *msg) subscr_name(trans->subscr), trans->subscr->extension, setup.called.number);
- counter_inc(trans->subscr->net->stats.call.mo_setup); + osmo_counter_inc(trans->subscr->net->stats.call.mo_setup);
/* indicate setup to MNCC */ mncc_recvmsg(trans->subscr->net, trans, MNCC_SETUP_IND, &setup); @@ -1969,7 +1969,7 @@ static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg) new_cc_state(trans, GSM_CSTATE_CALL_PRESENT);
- counter_inc(trans->subscr->net->stats.call.mt_setup); + osmo_counter_inc(trans->subscr->net->stats.call.mt_setup);
return gsm48_conn_sendmsg(msg, trans->conn, trans); } @@ -2190,7 +2190,7 @@ static int gsm48_cc_rx_connect(struct gsm_trans *trans, struct msgb *msg) }
new_cc_state(trans, GSM_CSTATE_CONNECT_REQUEST); - counter_inc(trans->subscr->net->stats.call.mt_connect); + osmo_counter_inc(trans->subscr->net->stats.call.mt_connect);
return mncc_recvmsg(trans->subscr->net, trans, MNCC_SETUP_CNF, &connect); } @@ -2203,7 +2203,7 @@ static int gsm48_cc_rx_connect_ack(struct gsm_trans *trans, struct msgb *msg) gsm48_stop_cc_timer(trans);
new_cc_state(trans, GSM_CSTATE_ACTIVE); - counter_inc(trans->subscr->net->stats.call.mo_connect_ack); + osmo_counter_inc(trans->subscr->net->stats.call.mo_connect_ack); memset(&connect_ack, 0, sizeof(struct gsm_mncc)); connect_ack.callref = trans->callref; diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 326c2b8..5069be7 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -560,7 +560,7 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m uint8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */ int rc = 0;
- counter_inc(conn->bts->network->stats.sms.submitted); + osmo_counter_inc(conn->bts->network->stats.sms.submitted);
gsms = sms_alloc(); if (!gsms) @@ -656,7 +656,7 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m gsms->receiver = subscr_get_by_extension(conn->bts->network, gsms->dest_addr); if (!gsms->receiver) { rc = 1; /* cause 1: unknown subscriber */ - counter_inc(conn->bts->network->stats.sms.no_receiver); + osmo_counter_inc(conn->bts->network->stats.sms.no_receiver); goto out; }
@@ -846,10 +846,10 @@ static int gsm411_rx_rp_error(struct msgb *msg, struct gsm_trans *trans, * to store this in our database and wait for a SMMA message */ /* FIXME */ send_signal(S_SMS_MEM_EXCEEDED, trans, sms, 0); - counter_inc(net->stats.sms.rp_err_mem); + osmo_counter_inc(net->stats.sms.rp_err_mem); } else { send_signal(S_SMS_UNKNOWN_ERROR, trans, sms, 0); - counter_inc(net->stats.sms.rp_err_other); + osmo_counter_inc(net->stats.sms.rp_err_other); }
sms_free(sms); @@ -1139,7 +1139,7 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
DEBUGP(DSMS, "TX: SMS DELIVER\n");
- counter_inc(conn->bts->network->stats.sms.delivered); + osmo_counter_inc(conn->bts->network->stats.sms.delivered); db_sms_inc_deliver_attempts(trans->sms.sms);
return gsm411_rp_sendmsg(msg, trans, GSM411_MT_RP_DATA_MT, msg_ref); diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 1d0097a..f751555 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -673,37 +673,37 @@ DEFUN(show_stats,
openbsc_vty_print_statistics(vty, net); vty_out(vty, "Channel Requests : %lu total, %lu no channel%s", - counter_get(net->stats.chreq.total), - counter_get(net->stats.chreq.no_channel), VTY_NEWLINE); + osmo_counter_get(net->stats.chreq.total), + osmo_counter_get(net->stats.chreq.no_channel), VTY_NEWLINE); vty_out(vty, "Location Update : %lu attach, %lu normal, %lu periodic%s", - counter_get(net->stats.loc_upd_type.attach), - counter_get(net->stats.loc_upd_type.normal), - counter_get(net->stats.loc_upd_type.periodic), VTY_NEWLINE); + osmo_counter_get(net->stats.loc_upd_type.attach), + osmo_counter_get(net->stats.loc_upd_type.normal), + osmo_counter_get(net->stats.loc_upd_type.periodic), VTY_NEWLINE); vty_out(vty, "IMSI Detach Indications : %lu%s", - counter_get(net->stats.loc_upd_type.detach), VTY_NEWLINE); + osmo_counter_get(net->stats.loc_upd_type.detach), VTY_NEWLINE); vty_out(vty, "Location Update Response: %lu accept, %lu reject%s", - counter_get(net->stats.loc_upd_resp.accept), - counter_get(net->stats.loc_upd_resp.reject), VTY_NEWLINE); + osmo_counter_get(net->stats.loc_upd_resp.accept), + osmo_counter_get(net->stats.loc_upd_resp.reject), VTY_NEWLINE); vty_out(vty, "Handover : %lu attempted, %lu no_channel, %lu timeout, " "%lu completed, %lu failed%s", - counter_get(net->stats.handover.attempted), - counter_get(net->stats.handover.no_channel), - counter_get(net->stats.handover.timeout), - counter_get(net->stats.handover.completed), - counter_get(net->stats.handover.failed), VTY_NEWLINE); + osmo_counter_get(net->stats.handover.attempted), + osmo_counter_get(net->stats.handover.no_channel), + osmo_counter_get(net->stats.handover.timeout), + osmo_counter_get(net->stats.handover.completed), + osmo_counter_get(net->stats.handover.failed), VTY_NEWLINE); vty_out(vty, "SMS MO : %lu submitted, %lu no receiver%s", - counter_get(net->stats.sms.submitted), - counter_get(net->stats.sms.no_receiver), VTY_NEWLINE); + osmo_counter_get(net->stats.sms.submitted), + osmo_counter_get(net->stats.sms.no_receiver), VTY_NEWLINE); vty_out(vty, "SMS MT : %lu delivered, %lu no memory, %lu other error%s", - counter_get(net->stats.sms.delivered), - counter_get(net->stats.sms.rp_err_mem), - counter_get(net->stats.sms.rp_err_other), VTY_NEWLINE); + osmo_counter_get(net->stats.sms.delivered), + osmo_counter_get(net->stats.sms.rp_err_mem), + osmo_counter_get(net->stats.sms.rp_err_other), VTY_NEWLINE); vty_out(vty, "MO Calls : %lu setup, %lu connect ack%s", - counter_get(net->stats.call.mo_setup), - counter_get(net->stats.call.mo_connect_ack), VTY_NEWLINE); + osmo_counter_get(net->stats.call.mo_setup), + osmo_counter_get(net->stats.call.mo_connect_ack), VTY_NEWLINE); vty_out(vty, "MT Calls : %lu setup, %lu connect%s", - counter_get(net->stats.call.mt_setup), - counter_get(net->stats.call.mt_connect), VTY_NEWLINE); + osmo_counter_get(net->stats.call.mt_setup), + osmo_counter_get(net->stats.call.mt_connect), VTY_NEWLINE); return CMD_SUCCESS; }
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index f732488..5df4cd8 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -663,7 +663,7 @@ static int forward_sccp_to_bts(struct bsc_msc_connection *msc_con, struct msgb * case SCCP_MSG_TYPE_IT: con = patch_sccp_src_ref_to_bsc(msg, parsed, nat); if (parsed->gsm_type == BSS_MAP_MSG_ASSIGMENT_RQST) { - counter_inc(nat->stats.sccp.calls); + osmo_counter_inc(nat->stats.sccp.calls);
if (con) { struct rate_ctr_group *ctrg; @@ -752,7 +752,7 @@ static void msc_connection_was_lost(struct bsc_msc_connection *con)
static void msc_connection_connected(struct bsc_msc_connection *con) { - counter_inc(nat->stats.msc.reconn); + osmo_counter_inc(nat->stats.msc.reconn); }
static void msc_send_reset(struct bsc_msc_connection *msc_con) @@ -1211,7 +1211,7 @@ static int ipaccess_listen_bsc_cb(struct osmo_fd *bfd, unsigned int what) }
/* count the reconnect */ - counter_inc(nat->stats.bsc.reconn); + osmo_counter_inc(nat->stats.bsc.reconn);
/* * if we are not connected to a msc... just close the socket diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c index 4f90cdf..8765f27 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c @@ -95,12 +95,12 @@ struct bsc_nat *bsc_nat_alloc(void) INIT_LLIST_HEAD(&nat->access_lists); INIT_LLIST_HEAD(&nat->dests);
- nat->stats.sccp.conn = counter_alloc("nat.sccp.conn"); - nat->stats.sccp.calls = counter_alloc("nat.sccp.calls"); - nat->stats.bsc.reconn = counter_alloc("nat.bsc.conn"); - nat->stats.bsc.auth_fail = counter_alloc("nat.bsc.auth_fail"); - nat->stats.msc.reconn = counter_alloc("nat.msc.conn"); - nat->stats.ussd.reconn = counter_alloc("nat.ussd.conn"); + nat->stats.sccp.conn = osmo_counter_alloc("nat.sccp.conn"); + nat->stats.sccp.calls = osmo_counter_alloc("nat.sccp.calls"); + nat->stats.bsc.reconn = osmo_counter_alloc("nat.bsc.conn"); + nat->stats.bsc.auth_fail = osmo_counter_alloc("nat.bsc.auth_fail"); + nat->stats.msc.reconn = osmo_counter_alloc("nat.msc.conn"); + nat->stats.ussd.reconn = osmo_counter_alloc("nat.ussd.conn"); nat->auth_timeout = 2; nat->ping_timeout = 20; nat->pong_timeout = 5; diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c index b892d7a..a115fad 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c @@ -250,15 +250,15 @@ static void dump_stat_total(struct vty *vty, struct bsc_nat *nat) { vty_out(vty, "NAT statistics%s", VTY_NEWLINE); vty_out(vty, " SCCP Connections %lu total, %lu calls%s", - counter_get(nat->stats.sccp.conn), - counter_get(nat->stats.sccp.calls), VTY_NEWLINE); + osmo_counter_get(nat->stats.sccp.conn), + osmo_counter_get(nat->stats.sccp.calls), VTY_NEWLINE); vty_out(vty, " MSC Connections %lu%s", - counter_get(nat->stats.msc.reconn), VTY_NEWLINE); + osmo_counter_get(nat->stats.msc.reconn), VTY_NEWLINE); vty_out(vty, " MSC Connected: %d%s", nat->msc_con->is_connected, VTY_NEWLINE); vty_out(vty, " BSC Connections %lu total, %lu auth failed.%s", - counter_get(nat->stats.bsc.reconn), - counter_get(nat->stats.bsc.auth_fail), VTY_NEWLINE); + osmo_counter_get(nat->stats.bsc.reconn), + osmo_counter_get(nat->stats.bsc.auth_fail), VTY_NEWLINE); }
static void dump_stat_bsc(struct vty *vty, struct bsc_config *conf) diff --git a/openbsc/src/osmo-bsc_nat/bsc_sccp.c b/openbsc/src/osmo-bsc_nat/bsc_sccp.c index f7d868a..de6b421 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_sccp.c +++ b/openbsc/src/osmo-bsc_nat/bsc_sccp.c @@ -129,7 +129,7 @@ struct sccp_connections *create_sccp_src_ref(struct bsc_connection *bsc, bsc_mgcp_init(conn); llist_add_tail(&conn->list_entry, &bsc->nat->sccp_connections); rate_ctr_inc(&bsc->cfg->stats.ctrg->ctr[BCFG_CTR_SCCP_CONN]); - counter_inc(bsc->cfg->nat->stats.sccp.conn); + osmo_counter_inc(bsc->cfg->nat->stats.sccp.conn);
LOGP(DNAT, LOGL_DEBUG, "Created 0x%x <-> 0x%x mapping for con %p\n", sccp_src_ref_to_int(&conn->real_ref), diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c index 69cb7a4..a6fcffc 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c +++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c @@ -209,7 +209,7 @@ static int ussd_listen_cb(struct osmo_fd *bfd, unsigned int what) }
nat = (struct bsc_nat *) bfd->data; - counter_inc(nat->stats.ussd.reconn); + osmo_counter_inc(nat->stats.ussd.reconn);
conn = bsc_nat_ussd_alloc(nat); if (!conn) { diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c index 8e987b2..5e60441 100644 --- a/openbsc/src/osmo-nitb/bsc_hack.c +++ b/openbsc/src/osmo-nitb/bsc_hack.c @@ -195,7 +195,7 @@ static void signal_handler(int signal) }
/* timer handling */ -static int _db_store_counter(struct counter *counter, void *data) +static int _db_store_counter(struct osmo_counter *counter, void *data) { return db_store_counter(counter); } @@ -203,7 +203,7 @@ static int _db_store_counter(struct counter *counter, void *data) static void db_sync_timer_cb(void *data) { /* store counters to database and re-schedule */ - counters_for_each(_db_store_counter, NULL); + osmo_counters_for_each(_db_store_counter, NULL); osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL); }
diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c index 9cb6897..6e82126 100644 --- a/openbsc/src/utils/bs11_config.c +++ b/openbsc/src/utils/bs11_config.c @@ -72,7 +72,7 @@ static const uint8_t too_fast[] = { 0x12, 0x80, 0x00, 0x00, 0x02, 0x02 }; static struct log_target *stderr_target;
/* dummy function to keep gsm_data.c happy */ -struct counter *counter_alloc(const char *name) +struct osmo_counter *osmo_counter_alloc(const char *name) { return NULL; }