diff options
-rw-r--r-- | openbsc/include/openbsc/a_iface.h | 13 | ||||
-rw-r--r-- | openbsc/include/openbsc/msc_ifaces.h | 17 | ||||
-rw-r--r-- | openbsc/src/libmsc/a_iface.c | 10 | ||||
-rw-r--r-- | openbsc/src/libmsc/gsm_04_08.c | 5 | ||||
-rw-r--r-- | openbsc/src/libmsc/gsm_subscriber.c | 3 | ||||
-rw-r--r-- | openbsc/src/libmsc/msc_ifaces.c | 9 | ||||
-rw-r--r-- | openbsc/tests/msc_vlr/Makefile.am | 4 | ||||
-rw-r--r-- | openbsc/tests/msc_vlr/msc_vlr_tests.c | 12 |
8 files changed, 36 insertions, 37 deletions
diff --git a/openbsc/include/openbsc/a_iface.h b/openbsc/include/openbsc/a_iface.h index d5c5f9efb..483ffa47f 100644 --- a/openbsc/include/openbsc/a_iface.h +++ b/openbsc/include/openbsc/a_iface.h @@ -22,4 +22,17 @@ int a_init(void *ctx, const char *name, uint32_t local_pc, const char *listen_addr, const char *remote_addr, uint16_t local_port, struct gsm_network *network); +/* Send DTAP message via A-interface */ +int a_iface_tx_dtap(struct msgb *msg); + +/* Send Cipher mode command via A-interface */ +int a_iface_tx_cipher_mode(struct gsm_subscriber_connection *conn, + int cipher, const uint8_t *key, int len, int include_imeisv); + +/* Page a subscriber via A-interface */ +int a_iface_tx_paging(const char *imsi, uint32_t tmsi, uint16_t lac); + +/* Send assignment request via A-interface */ +int a_iface_tx_assignment(struct gsm_trans *trans); + #pragma once diff --git a/openbsc/include/openbsc/msc_ifaces.h b/openbsc/include/openbsc/msc_ifaces.h index e278f9305..620859b7c 100644 --- a/openbsc/include/openbsc/msc_ifaces.h +++ b/openbsc/include/openbsc/msc_ifaces.h @@ -28,18 +28,6 @@ /* Each main linkage must implement this function (see comment above). */ extern int iu_tx(struct msgb *msg, uint8_t sapi); -/* FIXME: Maybe the function prototypes that are implemented in a_iface.c - * should be moved to a_iface.h too? */ - -/* Send DTAP message via A-interface (see also: a_iface.c) */ -extern int a_tx(struct msgb *msg); - -/* Page a subscriber via A-interface (see also: a_iface.c) */ -extern int a_page(const char *imsi, uint32_t tmsi, uint16_t lac); - -/* Send assignment request via A-interface */ -extern int a_assign(struct gsm_trans *trans); - int msc_tx_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg); @@ -47,11 +35,6 @@ int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn); int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, enum gsm48_reject_value value); -/* TODO: specific to A interface, move this away */ -/* Send Cipher mode command via A-interface (see also: a_iface.c) */ -int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, - const uint8_t *key, int len, int include_imeisv); - int msc_tx_common_id(struct gsm_subscriber_connection *conn); int msc_call_assignment(struct gsm_trans *trans); int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2); diff --git a/openbsc/src/libmsc/a_iface.c b/openbsc/src/libmsc/a_iface.c index ffde21d85..e5907c408 100644 --- a/openbsc/src/libmsc/a_iface.c +++ b/openbsc/src/libmsc/a_iface.c @@ -47,7 +47,7 @@ static struct gsm_network *gsm_network = NULL; /* Send DTAP message via A-interface */ -int a_tx(struct msgb *msg) +int a_iface_tx_dtap(struct msgb *msg) { struct gsm_subscriber_connection *conn; struct msgb *msg_resp; @@ -74,8 +74,8 @@ int a_tx(struct msgb *msg) } /* Send Cipher mode command via A-interface */ -int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, - int cipher, const uint8_t *key, int len, int include_imeisv) +int a_iface_tx_cipher_mode(struct gsm_subscriber_connection *conn, + int cipher, const uint8_t *key, int len, int include_imeisv) { /* TODO generalize for A- and Iu interfaces, don't name after 08.08 */ struct msgb *msg_resp; @@ -108,7 +108,7 @@ int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, } /* Page a subscriber via A-interface */ -int a_page(const char *imsi, uint32_t tmsi, uint16_t lac) +int a_iface_tx_paging(const char *imsi, uint32_t tmsi, uint16_t lac) { struct a_bsc_addr *addr; struct llist_head *bsc_addr_list = get_bsc_addr_list(); @@ -259,7 +259,7 @@ static int enc_speeach_codec_list(struct gsm0808_speech_codec_list *scl, const s } /* Send assignment request via A-interface */ -int a_assign(struct gsm_trans *trans) +int a_iface_tx_assignment(struct gsm_trans *trans) { struct gsm_subscriber_connection *conn; struct gsm0808_channel_type ct; diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 4e7b0bb70..64c5a673d 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -74,6 +74,7 @@ #include <openbsc/msc_ifaces.h> #include <openbsc/iu.h> +#include <openbsc/a_iface.h> #include <assert.h> @@ -3804,8 +3805,8 @@ static int msc_vlr_set_ciph_mode(void *msc_conn_ref, case RAN_GERAN_A: DEBUGP(DMM, "-> CIPHER MODE COMMAND %s\n", vlr_subscr_name(conn->vsub)); - return msc_gsm0808_tx_cipher_mode(conn, ciph, tuple->vec.kc, 8, - retrieve_imeisv); + return a_iface_tx_cipher_mode(conn, ciph, tuple->vec.kc, 8, + retrieve_imeisv); case RAN_UTRAN_IU: DEBUGP(DMM, "-> SECURITY MODE CONTROL %s\n", vlr_subscr_name(conn->vsub)); diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index f92101863..5de96e7cf 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -43,6 +43,7 @@ #include <openbsc/iu.h> #include <openbsc/osmo_msc.h> #include <openbsc/msc_ifaces.h> +#include <openbsc/a_iface.h> void *tall_sub_req_ctx; @@ -111,7 +112,7 @@ int msc_paging_request(struct vlr_subscr *vsub) * Need to add BSC paging at some point. */ switch (vsub->cs.attached_via_ran) { case RAN_GERAN_A: - return a_page(vsub->imsi, vsub->tmsi, vsub->lac); + return a_iface_tx_paging(vsub->imsi, vsub->tmsi, vsub->lac); case RAN_UTRAN_IU: return iu_page_cs(vsub->imsi, vsub->tmsi == GSM_RESERVED_TMSI? diff --git a/openbsc/src/libmsc/msc_ifaces.c b/openbsc/src/libmsc/msc_ifaces.c index fdd5608db..8d5364767 100644 --- a/openbsc/src/libmsc/msc_ifaces.c +++ b/openbsc/src/libmsc/msc_ifaces.c @@ -29,6 +29,7 @@ #include <openbsc/mgcp.h> #include <openbsc/mgcpgw_client.h> #include <openbsc/vlr.h> +#include <openbsc/a_iface.h> #include "../../bscconfig.h" @@ -45,7 +46,7 @@ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) switch (conn->via_ran) { case RAN_GERAN_A: msg->dst = conn; - return a_tx(msg); + return a_iface_tx_dtap(msg); case RAN_UTRAN_IU: msg->dst = conn->iu.ue_ctx; @@ -180,7 +181,7 @@ static void mgcp_response_rab_act_cs_crcx(struct mgcp_response *r, void *priv) /* use_x213_nsap == 0 for ip.access nano3G */ } else if (trans->conn->via_ran == RAN_GERAN_A) { /* Assign a voice channel via A on 2G */ - if (a_assign(trans) == -EINVAL) + if (a_iface_tx_assignment(trans) == -EINVAL) goto rab_act_cs_error; } else goto rab_act_cs_error; @@ -241,8 +242,8 @@ int msc_call_assignment(struct gsm_trans *trans) case RAN_GERAN_A: /* FIXME We first go for conn_iu_rab_act_cs(), this function * will create a loopback rtp connection first and then call - * a_assign(). Probably we need to find another name for - * conn_iu_rab_act_cs? */ + * a_iface_tx_assignment(). Probably we need to find another + * name for conn_iu_rab_act_cs? */ return conn_iu_rab_act_cs(trans); case RAN_UTRAN_IU: diff --git a/openbsc/tests/msc_vlr/Makefile.am b/openbsc/tests/msc_vlr/Makefile.am index 8c74e6404..94119200b 100644 --- a/openbsc/tests/msc_vlr/Makefile.am +++ b/openbsc/tests/msc_vlr/Makefile.am @@ -63,8 +63,8 @@ LDADD = \ LDFLAGS = \ -Wl,--wrap=gsup_client_create \ -Wl,--wrap=gsup_client_send \ - -Wl,--wrap=a_tx \ - -Wl,--wrap=a_page \ + -Wl,--wrap=a_iface_tx_dtap \ + -Wl,--wrap=a_iface_tx_paging \ -Wl,--wrap=iu_tx \ -Wl,--wrap=iu_page_cs \ -Wl,--wrap=msc_stop_paging \ diff --git a/openbsc/tests/msc_vlr/msc_vlr_tests.c b/openbsc/tests/msc_vlr/msc_vlr_tests.c index 14ccfd8a9..75786bac4 100644 --- a/openbsc/tests/msc_vlr/msc_vlr_tests.c +++ b/openbsc/tests/msc_vlr/msc_vlr_tests.c @@ -297,9 +297,9 @@ int __wrap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) return _paging_sent(RAN_UTRAN_IU, imsi, tmsi ? *tmsi : GSM_RESERVED_TMSI, lac); } -/* override, requires '-Wl,--wrap=a_page' */ -int __real_a_page(const char *imsi, uint32_t tmsi, uint16_t lac); -int __wrap_a_page(const char *imsi, uint32_t tmsi, uint16_t lac) +/* override, requires '-Wl,--wrap=a_iface_tx_paging' */ +int __real_a_iface_tx_paging(const char *imsi, uint32_t tmsi, uint16_t lac); +int __wrap_a_iface_tx_paging(const char *imsi, uint32_t tmsi, uint16_t lac) { return _paging_sent(RAN_GERAN_A, imsi, tmsi, lac); } @@ -468,9 +468,9 @@ int __wrap_iu_tx(struct msgb *msg, uint8_t sapi) return _validate_dtap(msg, RAN_UTRAN_IU); } -/* override, requires '-Wl,--wrap=a_tx' */ -int __real_a_tx(struct msgb *msg, uint8_t sapi); -int __wrap_a_tx(struct msgb *msg, uint8_t sapi) +/* override, requires '-Wl,--wrap=a_iface_tx_dtap' */ +int __real_a_iface_tx_dtap(struct msgb *msg); +int __wrap_a_iface_tx_dtap(struct msgb *msg) { return _validate_dtap(msg, RAN_GERAN_A); } |