diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2017-04-12 15:19:45 +0200 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2017-04-28 13:40:48 +0200 |
commit | d0fe7d7db24d65f79224fdb9eb7de0a86c741361 (patch) | |
tree | 4e44365b404648e2399106212de098d75f05246c | |
parent | 05dd583d906733d2bfe66329809d41c3dee54723 (diff) |
WIP: Integrate AoIP into MSC
-rw-r--r-- | openbsc/include/openbsc/Makefile.am | 2 | ||||
-rw-r--r-- | openbsc/include/openbsc/a_iface.h | 25 | ||||
-rw-r--r-- | openbsc/include/openbsc/a_iface_bssap.h | 47 | ||||
-rw-r--r-- | openbsc/include/openbsc/gsm_data.h | 5 | ||||
-rw-r--r-- | openbsc/include/openbsc/iu.h | 2 | ||||
-rw-r--r-- | openbsc/include/openbsc/msc_ifaces.h | 19 | ||||
-rw-r--r-- | openbsc/include/openbsc/osmo_msc.h | 3 | ||||
-rw-r--r-- | openbsc/src/libmsc/Makefile.am | 2 | ||||
-rw-r--r-- | openbsc/src/libmsc/a_iface.c | 196 | ||||
-rw-r--r-- | openbsc/src/libmsc/a_iface_bssap.c | 515 | ||||
-rw-r--r-- | openbsc/src/libmsc/gsm_subscriber.c | 2 | ||||
-rw-r--r-- | openbsc/src/libmsc/msc_ifaces.c | 5 | ||||
-rw-r--r-- | openbsc/src/libmsc/osmo_msc.c | 6 | ||||
-rw-r--r-- | openbsc/src/osmo-msc/msc_main.c | 7 | ||||
-rw-r--r-- | openbsc/tests/libiudummy/iudummy.c | 6 | ||||
-rw-r--r-- | openbsc/tests/msc_vlr/Makefile.am | 2 | ||||
-rw-r--r-- | openbsc/tests/sms_queue/Makefile.am | 4 |
17 files changed, 808 insertions, 40 deletions
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index 14396b74a..84f3250a3 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -2,6 +2,8 @@ noinst_HEADERS = \ abis_nm.h \ abis_om2000.h \ abis_rsl.h \ + a_iface.h \ + a_iface_bssap.h \ arfcn_range_encode.h \ auth.h \ bsc_msc.h \ diff --git a/openbsc/include/openbsc/a_iface.h b/openbsc/include/openbsc/a_iface.h new file mode 100644 index 000000000..d5c5f9efb --- /dev/null +++ b/openbsc/include/openbsc/a_iface.h @@ -0,0 +1,25 @@ +/* (C) 2017 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +/* Initalize A interface connection between to MSC and BSC */ +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); + +#pragma once diff --git a/openbsc/include/openbsc/a_iface_bssap.h b/openbsc/include/openbsc/a_iface_bssap.h new file mode 100644 index 000000000..2b489730f --- /dev/null +++ b/openbsc/include/openbsc/a_iface_bssap.h @@ -0,0 +1,47 @@ +/* (C) 2017 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#pragma once + +/* A structure to hold tha most basic information about a sigtran connection + * we use this struct internally here to pass connection data around */ +struct conn_info { + struct osmo_sccp_addr *called_addr; + struct osmo_sccp_addr *calling_addr; + int conn_id; + struct gsm_network *network; +}; + +/* A structure to pack BSC clling addresses into a list */ +struct bsc_addr { + struct llist_head list; + struct osmo_sccp_addr called_addr; + struct osmo_sccp_addr calling_addr; + struct osmo_sccp_user *scu; +}; + +/* Handle incoming connection less data messages */ +void msc_handle_udt(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg); + +/* Handle incoming connection oriented messages */ +int msc_handle_dt1(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg); + +/* Get a list with all known BSCs */ +struct llist_head *get_bsc_addr_list(void); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 971745980..a0aade64b 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -195,6 +195,11 @@ struct gsm_subscriber_connection { uint16_t mgcp_rtp_port_cn; uint8_t rab_id; } iu; + + struct { + struct osmo_sccp_user *scu; + int conn_id; + } a; }; diff --git a/openbsc/include/openbsc/iu.h b/openbsc/include/openbsc/iu.h index 0cc16d011..a0c481aae 100644 --- a/openbsc/include/openbsc/iu.h +++ b/openbsc/include/openbsc/iu.h @@ -80,3 +80,5 @@ int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc); int iu_vty_config_write(struct vty *vty, const char *indent); + +struct ue_conn_ctx *ue_conn_ctx_alloc(struct osmo_sccp_addr *addr, uint32_t conn_id); diff --git a/openbsc/include/openbsc/msc_ifaces.h b/openbsc/include/openbsc/msc_ifaces.h index 2965c72c5..942e1cebd 100644 --- a/openbsc/include/openbsc/msc_ifaces.h +++ b/openbsc/include/openbsc/msc_ifaces.h @@ -28,20 +28,18 @@ /* Each main linkage must implement this function (see comment above). */ extern int iu_tx(struct msgb *msg, uint8_t sapi); -/* So far this is a dummy implemented in libmsc/a_iface.c. When A-interface - * gets implemented, it should be in a separate lib (like libiu), this function - * should move there, and the following comment should remain here: " - * Each main linkage must implement this function (see comment above). - * " */ +/* 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); -/* So far this is a dummy implemented in libmsc/a_iface.c. When A-interface - * gets implemented, it should be in a separate lib (like libiu), this function - * should move there, and the following comment should remain here: " - * Each main linkage must implement this function (see comment above). - * " */ +/* 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); @@ -50,6 +48,7 @@ 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); diff --git a/openbsc/include/openbsc/osmo_msc.h b/openbsc/include/openbsc/osmo_msc.h index fa7ea293d..6a3b36761 100644 --- a/openbsc/include/openbsc/osmo_msc.h +++ b/openbsc/include/openbsc/osmo_msc.h @@ -69,6 +69,9 @@ void msc_dtap(struct gsm_subscriber_connection *conn, uint8_t link_id, void msc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t alg_id); void msc_rx_sec_mode_compl(struct gsm_subscriber_connection *conn); +void msc_classmark_chg(struct gsm_subscriber_connection *conn, + const uint8_t *cm2, uint8_t cm2_len, + const uint8_t *cm3, uint8_t cm3_len); void msc_subscr_conn_init(void); bool msc_subscr_conn_is_accepted(struct gsm_subscriber_connection *conn); diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am index a320f7d28..50fc2a1be 100644 --- a/openbsc/src/libmsc/Makefile.am +++ b/openbsc/src/libmsc/Makefile.am @@ -13,6 +13,7 @@ AM_CFLAGS = \ $(LIBCRYPTO_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ $(LIBASN1C_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(NULL) noinst_HEADERS = \ @@ -25,6 +26,7 @@ noinst_LIBRARIES = \ libmsc_a_SOURCES = \ a_iface.c \ + a_iface_bssap.c \ auth.c \ msc_vty.c \ db.c \ diff --git a/openbsc/src/libmsc/a_iface.c b/openbsc/src/libmsc/a_iface.c index caf9d4b06..7ed317275 100644 --- a/openbsc/src/libmsc/a_iface.c +++ b/openbsc/src/libmsc/a_iface.c @@ -1,9 +1,8 @@ -/* A-interface implementation, from MSC to BSC */ - -/* (C) 2016 by sysmocom s.m.f.c GmbH <info@sysmocom.de> - * +/* (C) 2017 by Sysmocom s.f.m.c. GmbH * All Rights Reserved * + * Author: Philipp Maier + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -19,35 +18,190 @@ * */ +#include <osmocom/core/utils.h> #include <osmocom/core/msgb.h> #include <osmocom/core/logging.h> - +#include <osmocom/sigtran/sccp_helpers.h> +#include <osmocom/gsm/gsm0808.h> +#include <osmocom/gsm/protocol/gsm_08_08.h> #include <openbsc/debug.h> - -#include <openbsc/gsm_data.h> #include <openbsc/msc_ifaces.h> -#include <openbsc/debug.h> +#include <openbsc/a_iface.h> +#include <openbsc/a_iface_bssap.h> +/* A pointer to the GSM network we work with. By the current paradigm, + * there can only be one gsm_network per MSC. The pointer is set once + * when calling a_init() */ +static struct gsm_network *gsm_network = NULL; + +/* Send DTAP message via A-interface */ int a_tx(struct msgb *msg) { - LOGP(DMSC, LOGL_ERROR, "message to be sent to BSC, but A-interface" - " not implemented.\n%s\n", osmo_hexdump(msg->data, msg->len)); - return -1; + /* FIXME: Wo is taking ownership of *msg? Do we need to free? */ + + struct gsm_subscriber_connection *conn; + struct msgb *msg_resp; + + /* FIXME: Set this to some meaninful value! */ + uint8_t link_id = 0x00; + OSMO_ASSERT(msg); + conn = (struct gsm_subscriber_connection *)msg->dst; + OSMO_ASSERT(conn); + OSMO_ASSERT(conn->a.scu); + + LOGP(DMSC, LOGL_DEBUG, "Passing DTAP message from MSC to BSC (conn_id=%i)\n", conn->a.conn_id); + + msg->l3h = msg->data; + msg_resp = gsm0808_create_dtap(msg, link_id); + if (!msg_resp) { + LOGP(DMSC, LOGL_ERROR, "Unable to generate BSSMAP DTAP message!\n"); + return -EINVAL; + } else + LOGP(DMSC, LOGL_DEBUG, "Massage will be sent as BSSMAP DTAP message!\n"); + + LOGP(DMSC, LOGL_DEBUG, "N-DATA.req(%u, %s)\n", conn->a.conn_id, osmo_hexdump(msg_resp->data, msg_resp->len)); + return osmo_sccp_tx_data_msg(conn->a.scu, conn->a.conn_id, msg_resp); +} + +/* 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) +{ + /* TODO generalize for A- and Iu interfaces, don't name after 08.08 */ + struct msgb *msg_resp; + struct gsm0808_encrypt_info ei; + LOGP(DMSC, LOGL_DEBUG, "Passing Cipher mode command message from MSC to BSC (conn_id=%i)\n", conn->a.conn_id); + uint8_t crm = 0x01; + uint8_t *crm_ptr = NULL; + + /* Setup encryption information */ + if (len > ENCRY_INFO_KEY_MAXLEN || !key) { + LOGP(DMSC, LOGL_ERROR, + "Cipher mode command message could not be generated due to invalid key! (conn_id=%i)\n", + conn->a.conn_id); + return -EINVAL; + } else { + memcpy(&ei.key, key, len); + ei.key_len = len; + } + + if (include_imeisv) + crm_ptr = &crm; + + ei.perm_algo[0] = (uint8_t) (1 << cipher); + ei.perm_algo_len = 1; + + msg_resp = gsm0808_create_cipher(&ei, crm_ptr); + LOGP(DMSC, LOGL_DEBUG, "N-DATA.req(%u, %s)\n", conn->a.conn_id, osmo_hexdump(msg_resp->data, msg_resp->len)); + + return osmo_sccp_tx_data_msg(conn->a.scu, conn->a.conn_id, msg_resp); } +/* Page a subscriber via A-interface */ int a_page(const char *imsi, uint32_t tmsi, uint16_t lac) { - LOGP(DMSC, LOGL_ERROR, "Paging to be sent to BSC, but A-interface" - " not implemented: IMSI %s TMSI 0x%08x LAC %u\n", - imsi, tmsi, lac); - return -1; + struct bsc_addr *addr; + struct llist_head *bsc_addr_list = get_bsc_addr_list(); + struct gsm0808_cell_id_list cil; + int rc = -EINVAL; + + cil.id_discr = CELL_IDENT_LAC; + cil.id_list_lac[0] = lac; + cil.id_list_len = 1; + + /* Deliver paging request to all known BSCs */ + llist_for_each_entry(addr, bsc_addr_list, list) { + LOGP(DMSC, LOGL_DEBUG, "Passing paging message from MSC to BSC %s (imsi=%s, tmsi=0x%08x, lac=%u)\n", + osmo_sccp_addr_dump(&addr->calling_addr), imsi, tmsi, lac); + osmo_sccp_tx_unitdata_msg(addr->scu, &addr->called_addr, &addr->calling_addr, + gsm0808_create_paging(imsi, &tmsi, &cil, NULL)); + rc = 0; + } + + if (rc != 0) + LOGP(DMSC, LOGL_ERROR, "Could not deliver paging because no BSC is available!\n"); + + return rc; } -int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, - const uint8_t *key, int len, int include_imeisv) +/* Send assignment request via A-interface */ +int a_assign(struct gsm_trans *trans) { - /* TODO generalize for A- and Iu interfaces, don't name after 08.08 */ - LOGP(DMSC, LOGL_ERROR, "gsm0808_cipher_mode(): message to be sent to" - " BSC, but A interface not yet implemented.\n"); - return -1; + /* FIXME: Implementation is still missing! */ + printf + ("ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN \n"); + return -ENOTSUP; +} + +/* Callback function, called by the SSCP stack when data arrives */ +static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) +{ + struct osmo_sccp_user *scu = _scu; + struct osmo_scu_prim *scu_prim = (struct osmo_scu_prim *)oph; + int rc = 0; + struct conn_info conn_info; + memset(&conn_info, 0, sizeof(conn_info)); + conn_info.network = gsm_network; + + switch (OSMO_PRIM_HDR(&scu_prim->oph)) { + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): + /* Handle inbound connection indication */ + conn_info.conn_id = scu_prim->u.connect.conn_id; + conn_info.called_addr = &scu_prim->u.connect.called_addr; + conn_info.calling_addr = &scu_prim->u.connect.calling_addr; + osmo_sccp_tx_conn_resp(scu, scu_prim->u.connect.conn_id, &scu_prim->u.connect.called_addr, NULL, 0); + if (msgb_l2len(oph->msg) > 0) { + LOGP(DMSC, LOGL_DEBUG, "N-CONNECT.ind(%u, %s)\n", + scu_prim->u.connect.conn_id, osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + rc = msc_handle_dt1(scu, &conn_info, oph->msg); + } else + LOGP(DMSC, LOGL_DEBUG, "N-CONNECT.ind(%u)\n", scu_prim->u.connect.conn_id); + break; + + case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): + /* Handle incoming connection oriented data */ + conn_info.conn_id = scu_prim->u.data.conn_id; + LOGP(DMSC, LOGL_DEBUG, "N-DATA.ind(%u, %s)\n", + scu_prim->u.data.conn_id, osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + msc_handle_dt1(scu, &conn_info, oph->msg); + break; + + case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): + /* Handle inbound UNITDATA */ + conn_info.called_addr = &scu_prim->u.unitdata.called_addr; + conn_info.calling_addr = &scu_prim->u.unitdata.calling_addr; + msc_handle_udt(scu, &conn_info, oph->msg); + break; + + default: + LOGP(DMSC, LOGL_ERROR, "Unhandled SIGTRAN primitive: %u:%u\n", oph->primitive, oph->operation); + break; + } + + return rc; +} + +/* Initalize A interface connection between to MSC and BSC */ +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) +{ + /* FIXME: Clean this up! */ + /* FIXME: Don't use the simple_server, use the simple_client instead! */ +#define RECEIVER_PC 23 +#define SSN_BSSAP 254 /* SCCP_SSN_BSSAP */ +#define SENDER_PC 1 + + struct osmo_sccp_instance *sccp; + + gsm_network = network; + osmo_ss7_init(); + + sccp = osmo_sccp_simple_server(NULL, SENDER_PC, OSMO_SS7_ASP_PROT_M3UA, -1, "127.0.0.2"); + + /* Why? */ + osmo_sccp_simple_server_add_clnt(sccp, OSMO_SS7_ASP_PROT_M3UA, "RECEIVER", RECEIVER_PC, -1, 0, NULL); + + osmo_sccp_user_bind(sccp, "echo", &sccp_sap_up, SSN_BSSAP); + + return 0; } diff --git a/openbsc/src/libmsc/a_iface_bssap.c b/openbsc/src/libmsc/a_iface_bssap.c new file mode 100644 index 000000000..9f1587457 --- /dev/null +++ b/openbsc/src/libmsc/a_iface_bssap.c @@ -0,0 +1,515 @@ +/* (C) 2017 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <osmocom/core/utils.h> +#include <osmocom/core/msgb.h> +#include <osmocom/core/logging.h> +#include <osmocom/sigtran/sccp_helpers.h> +#include <osmocom/sccp/sccp_types.h> +#include <osmocom/gsm/gsm0808.h> +#include <osmocom/gsm/gsm0808_utils.h> +#include <openbsc/debug.h> +#include <openbsc/gsm_data.h> +#include <openbsc/a_iface_bssap.h> +#include <openbsc/iu.h> +#include <openbsc/osmo_msc.h> + +/* Addresses of all BSCs which have been registered to this MSC */ +static LLIST_HEAD(bsc_addr_list); + +/* + * Helper functions to lookup and allocate subscribers + */ + +/* Allocate a new subscriber connection */ +static struct gsm_subscriber_connection *subscr_conn_allocate_a(struct gsm_network *network, struct ue_conn_ctx *ue, + uint16_t lac, struct osmo_sccp_user *scu, int conn_id) +{ + struct gsm_subscriber_connection *conn; + + LOGP(DMSC, LOGL_NOTICE, "Allocating A-Interface subscriber conn: lac %i, conn_id %i\n", lac, ue->conn_id); + + conn = talloc_zero(ue, struct gsm_subscriber_connection); + if (!conn) + return NULL; + + conn->network = network; + conn->via_ran = RAN_GERAN_A; + conn->iu.ue_ctx = ue; + conn->iu.ue_ctx->rab_assign_addr_enc = network->iu.rab_assign_addr_enc; + conn->lac = lac; + + conn->a.conn_id = conn_id; + conn->a.scu = scu; + + llist_add_tail(&conn->entry, &network->subscr_conns); + LOGP(DMSC, LOGL_NOTICE, "A-Interface subscriber connection successfully allocated!\n"); + return conn; +} + +/* Return an existing A subscriber connection record for the given + * connection IDs, or return NULL if not found. */ +struct gsm_subscriber_connection *subscr_conn_lookup_a(struct gsm_network *network, int conn_id) +{ + struct gsm_subscriber_connection *conn; + + DEBUGP(DMSC, "Looking for A subscriber: conn_id %i\n", conn_id); + //log_subscribers(network); + + llist_for_each_entry(conn, &network->subscr_conns, entry) { + if (conn->via_ran == RAN_GERAN_A && conn->a.conn_id == conn_id) { + DEBUGP(DIUCS, "Found A subscriber for conn_id %i\n", conn_id); + return conn; + } + } + DEBUGP(DMSC, "No A subscriber found for conn_id %i\n", conn_id); + return NULL; +} + +/* + * BSSMAP handling for UNITDATA + */ + +/* Endpoint to handle BSSMAP reset */ +static void bssmap_handle_reset(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg) +{ + struct bsc_addr *addr; + struct bsc_addr *known_addr; + bool addr_unknown = true; + + LOGP(DMSC, LOGL_NOTICE, "Rx RESET from BSC %s\n", osmo_sccp_addr_dump(conn_info->calling_addr)); + osmo_sccp_tx_unitdata_msg(scu, conn_info->called_addr, conn_info->calling_addr, gsm0808_create_reset_ack()); + + /* Check if we know this BSC already, if yes, refresh its item */ + llist_for_each_entry(known_addr, &bsc_addr_list, list) { + if (memcmp(&known_addr->calling_addr, conn_info->calling_addr, sizeof(*conn_info->calling_addr)) == 0) { + LOGP(DMSC, LOGL_NOTICE, "This BSC is already known to this MSC, refreshing its list item\n"); + llist_del(&known_addr->list); + talloc_free(known_addr); + addr_unknown = false; + break; + } + } + if (addr_unknown) + LOGP(DMSC, LOGL_NOTICE, "This BSC is not known to this MSC yet, adding it to list\n"); + + addr = talloc_zero(NULL, struct bsc_addr); + memcpy(&addr->calling_addr, conn_info->calling_addr, sizeof(addr->calling_addr)); + memcpy(&addr->called_addr, conn_info->called_addr, sizeof(addr->called_addr)); + addr->scu = scu; + llist_add(&addr->list, &bsc_addr_list); + + msgb_free(msg); +} + +/* Handle UNITDATA BSSMAP messages */ +static void bssmap_rcvmsg_udt(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg) +{ + /* Note: When in the MSC role, RESET ACK is the only valid message that + * can be received via UNITDATA */ + + if (msgb_l3len(msg) < 1) { + LOGP(DMSC, LOGL_NOTICE, "Error: No data received -- discarding message!\n"); + return; + } + + LOGP(DMSC, LOGL_NOTICE, "Rx BSC UDT BSSMAP %s\n", gsm0808_bssmap_name(msg->l3h[0])); + + switch (msg->l3h[0]) { + case BSS_MAP_MSG_RESET: + bssmap_handle_reset(scu, conn_info, msg); + break; + default: + LOGP(DMSC, LOGL_NOTICE, "Unimplemented message format: %s -- message discarded!\n", + gsm0808_bssmap_name(msg->l3h[0])); + msgb_free(msg); + } +} + +/* Handle incoming connection less data messages */ +void msc_handle_udt(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg) +{ + /* Note: The only valid message type that can be received + * via UNITDATA are BSS Management messages */ + struct bssmap_header *bs; + + LOGP(DMSC, LOGL_NOTICE, "Rx BSC UDT: %s\n", osmo_hexdump(msgb_l2(msg), msgb_l2len(msg))); + + if (msgb_l2len(msg) < sizeof(*bs)) { + LOGP(DMSC, LOGL_ERROR, "Error: Header is too short -- discarding message!\n"); + msgb_free(msg); + return; + } + + bs = (struct bssmap_header *)msgb_l2(msg); + if (bs->length < msgb_l2len(msg) - sizeof(*bs)) { + LOGP(DMSC, LOGL_ERROR, "Error: Message is too short -- discarding message!\n"); + msgb_free(msg); + return; + } + + switch (bs->type) { + case BSSAP_MSG_BSS_MANAGEMENT: + msg->l3h = &msg->l2h[sizeof(struct bssmap_header)]; + bssmap_rcvmsg_udt(scu, conn_info, msg); + break; + default: + LOGP(DMSC, LOGL_ERROR, + "Error: Unimplemented message type: %s -- message discarded!\n", gsm0808_bssmap_name(bs->type)); + msgb_free(msg); + } +} + +/* + * BSSMAP handling for connection oriented data + */ + +/* Endpoint to handle BSSMAP clear request */ +static int bssmap_handle_clear_rqst(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg) +{ + int rc; + struct msgb *msg_resp; + + LOGP(DMSC, LOGL_NOTICE, "BSC requested to clear connection (conn_id=%i)\n", conn_info->conn_id); + msg_resp = gsm0808_create_clear_command(GSM0808_CAUSE_CALL_CONTROL); + rc = osmo_sccp_tx_data_msg(scu, conn_info->conn_id, msg_resp); + + msgb_free(msg); + return rc; +} + +/* Endpoint to handle BSSMAP clear complete */ +static int bssmap_handle_clear_complete(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg) +{ + int rc; + + LOGP(DMSC, LOGL_NOTICE, "Releasing connection (conn_id=%i)\n", conn_info->conn_id); + rc = osmo_sccp_tx_disconn(scu, conn_info->conn_id, + conn_info->called_addr, SCCP_RELEASE_CAUSE_END_USER_ORIGINATED); + + msgb_free(msg); + return rc; +} + +/* Endpoint to handle layer 3 complete messages */ +static int bssmap_handle_l3_compl(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg) +{ + struct tlv_parsed tp; + struct { + uint8_t ident; + struct gsm48_loc_area_id lai; + uint16_t ci; + } __attribute__ ((packed)) lai_ci; + uint16_t mcc; + uint16_t mnc; + uint16_t lac; + uint8_t data_length; + const uint8_t *data; + int rc; + + struct gsm_network *network = conn_info->network; + struct ue_conn_ctx *ue; + struct gsm_subscriber_connection *conn; + + LOGP(DMSC, LOGL_NOTICE, "BSC has completed layer 3 connection (conn_id=%i)\n", conn_info->conn_id); + + tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) - 1, 0, 0); + if (!TLVP_PRESENT(&tp, GSM0808_IE_CELL_IDENTIFIER)) { + LOGP(DMSC, LOGL_ERROR, "Mandatory CELL IDENTIFIER not present -- discarding message!\n"); + goto fail; + } + if (!TLVP_PRESENT(&tp, GSM0808_IE_LAYER_3_INFORMATION)) { + LOGP(DMSC, LOGL_ERROR, "Mandatory LAYER 3 INFORMATION not present -- discarding message!\n"); + goto fail; + } + + /* Parse Cell ID element */ + /* FIXME: Encapsulate this in a parser/generator function inside + * libosmocore, add support for all specified cell identification + * discriminators (see 3GPP ts 3.2.2.17 Cell Identifier) */ + data_length = TLVP_LEN(&tp, GSM0808_IE_CELL_IDENTIFIER); + data = TLVP_VAL(&tp, GSM0808_IE_CELL_IDENTIFIER); + if (sizeof(lai_ci) != data_length) { + LOGP(DMSC, LOGL_ERROR, + "Unable to parse element CELL IDENTIFIER (wrong field length) -- discarding message!\n"); + goto fail; + } + memcpy(&lai_ci, data, sizeof(lai_ci)); + if (lai_ci.ident != CELL_IDENT_WHOLE_GLOBAL) { + LOGP(DMSC, LOGL_ERROR, + "Unable to parse element CELL IDENTIFIER (wrong cell identification discriminator) -- discarding message!\n"); + goto fail; + } + if (gsm48_decode_lai(&lai_ci.lai, &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, + "Unable to parse element CELL IDENTIFIER (lai decoding failed) -- discarding message!\n"); + goto fail; + } + + /* Parse Layer 3 Information element */ + /* FIXME: This is probably to hackish, compiler also complains "assignment discards ‘const’ qualifier..." */ + msg->l3h = TLVP_VAL(&tp, GSM0808_IE_LAYER_3_INFORMATION); + msg->tail = msg->l3h + TLVP_LEN(&tp, GSM0808_IE_LAYER_3_INFORMATION); + + /* Create new subscriber context */ + ue = ue_conn_ctx_alloc(conn_info->calling_addr, conn_info->conn_id); + conn = subscr_conn_allocate_a(network, ue, lac, scu, conn_info->conn_id); + + /* Handover location update to the MSC code */ + /* msc_compl_l3() takes ownership of dtap_msg + * message buffer */ + rc = msc_compl_l3(conn, msg, 0); + if (rc == MSC_CONN_ACCEPT) { + LOGP(DMSC, LOGL_NOTICE, "User has been accepted by MSC.\n"); + return 0; + } else if (rc == MSC_CONN_REJECT) + LOGP(DMSC, LOGL_NOTICE, "User has been rejected by MSC.\n"); + else + LOGP(DMSC, LOGL_NOTICE, "User has been rejected by MSC (unknown error)\n"); + + return -EINVAL; + +fail: + msgb_free(msg); + return -EINVAL; +} + +/* Endpoint to handle BSSMAP classmark update */ +static int bssmap_classmark_upd(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg) +{ + struct gsm_network *network = conn_info->network; + struct gsm_subscriber_connection *conn; + struct tlv_parsed tp; + const uint8_t *cm2 = NULL; + const uint8_t *cm3 = NULL; + uint8_t cm2_len = 0; + uint8_t cm3_len = 0; + + conn = subscr_conn_lookup_a(network, conn_info->conn_id); + if (!conn) + goto fail; + + LOGP(DMSC, LOGL_NOTICE, "BSC sends clasmark update (conn_id=%i)\n", conn->a.conn_id); + + tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) - 1, 0, 0); + if (!TLVP_PRESENT(&tp, GSM0808_IE_CLASSMARK_INFORMATION_T2)) { + LOGP(DMSC, LOGL_ERROR, "Mandatory Classmark Information Type 2 not present -- discarding message!\n"); + goto fail; + } + + cm2 = TLVP_VAL(&tp, GSM0808_IE_CLASSMARK_INFORMATION_T2); + cm2_len = TLVP_LEN(&tp, GSM0808_IE_CLASSMARK_INFORMATION_T2); + + if (TLVP_PRESENT(&tp, GSM0808_IE_CLASSMARK_INFORMATION_T3)) { + cm3 = TLVP_VAL(&tp, GSM0808_IE_CLASSMARK_INFORMATION_T3); + cm3_len = TLVP_LEN(&tp, GSM0808_IE_CLASSMARK_INFORMATION_T3); + } + + /* Inform MSC about the classmark change */ + msc_classmark_chg(conn, cm2, cm2_len, cm3, cm3_len); + + msgb_free(msg); + return 0; + +fail: + msgb_free(msg); + return -EINVAL; +} + +/* Endpoint to handle BSSMAP cipher mode complete */ +static int bssmap_ciph_compl(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg) +{ + /* FIXME: The field GSM0808_IE_LAYER_3_MESSAGE_CONTENTS is optional by + * means of the specification. So there can be messages without L3 info. + * In this case, the code will crash becrause msc_cipher_mode_compl() + * is not able to deal with msg = NULL and apperently + * msc_cipher_mode_compl() was never meant to be used without L3 data. + * This needs to be discussed further! */ + + struct gsm_network *network = conn_info->network; + struct gsm_subscriber_connection *conn; + struct tlv_parsed tp; + uint8_t alg_id = 1; + + conn = subscr_conn_lookup_a(network, conn_info->conn_id); + if (!conn) + goto fail; + + LOGP(DMSC, LOGL_NOTICE, "BSC sends cipher mode complete (conn_id=%i)\n", conn->a.conn_id); + + tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) - 1, 0, 0); + + if (TLVP_PRESENT(&tp, GSM0808_IE_CHOSEN_ENCR_ALG)) { + alg_id = TLVP_VAL(&tp, GSM0808_IE_CHOSEN_ENCR_ALG)[0] - 1; + } + + if (TLVP_PRESENT(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS)) { + msg->l3h = TLVP_VAL(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS); + msg->tail = msg->l3h + TLVP_LEN(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS); + } else { + msgb_free(msg); + msg = NULL; + } + + /* Hand over cipher mode complete message to the MSC, + * msc_cipher_mode_compl() takes ownership for msg */ + msc_cipher_mode_compl(conn, msg, alg_id); + + return 0; +fail: + msgb_free(msg); + return -EINVAL; +} + +/* Endpoint to handle BSSMAP cipher mode reject */ +static int bssmap_ciph_rej(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg) +{ + struct gsm_network *network = conn_info->network; + struct gsm_subscriber_connection *conn; + struct tlv_parsed tp; + uint8_t cause; + + conn = subscr_conn_lookup_a(network, conn_info->conn_id); + if (!conn) + goto fail; + + LOGP(DMSC, LOGL_NOTICE, "BSC sends cipher mode reject (conn_id=%i)\n", conn->a.conn_id); + + tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) - 1, 0, 0); + if (!TLVP_PRESENT(&tp, BSS_MAP_MSG_CIPHER_MODE_REJECT)) { + LOGP(DMSC, LOGL_ERROR, "Cause code is missing -- discarding message!\n"); + goto fail; + } + + cause = TLVP_VAL(&tp, BSS_MAP_MSG_CIPHER_MODE_REJECT)[0]; + LOGP(DMSC, LOGL_NOTICE, "Cipher mode rejection cause: %i\n", cause); + + /* FIXME: Can we do something meaningful here? e.g. report to the + * msc code somehow that the cipher mode command has failed. */ + + msgb_free(msg); + return 0; +fail: + msgb_free(msg); + return -EINVAL; +} + +/* Handle incoming connection oriented BSSMAP messages */ +static int bssmap_rcvmsg_dt1(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg) +{ + if (msgb_l3len(msg) < 1) { + LOGP(DMSC, LOGL_NOTICE, "Error: No data received -- discarding message!\n"); + msgb_free(msg); + return -1; + } + + LOGP(DMSC, LOGL_NOTICE, "Rx MSC DT1 BSSMAP %s\n", gsm0808_bssmap_name(msg->l3h[0])); + + switch (msg->l3h[0]) { + case BSS_MAP_MSG_CLEAR_RQST: + return bssmap_handle_clear_rqst(scu, conn_info, msg); + break; + case BSS_MAP_MSG_CLEAR_COMPLETE: + return bssmap_handle_clear_complete(scu, conn_info, msg); + break; + case BSS_MAP_MSG_COMPLETE_LAYER_3: + return bssmap_handle_l3_compl(scu, conn_info, msg); + break; + case BSS_MAP_MSG_CLASSMARK_UPDATE: + return bssmap_classmark_upd(scu, conn_info, msg); + break; + case BSS_MAP_MSG_CIPHER_MODE_COMPLETE: + return bssmap_ciph_compl(scu, conn_info, msg); + break; + case BSS_MAP_MSG_CIPHER_MODE_REJECT: + return bssmap_ciph_rej(scu, conn_info, msg); + break; + + default: + printf + ("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"); + LOGP(DMSC, LOGL_ERROR, "Unimplemented msg type: %s\n", gsm0808_bssmap_name(msg->l3h[0])); + msgb_free(msg); + return -EINVAL; + } + + /* TODO: Messages we do not handle yet: + BSS_MAP_MSG_SAPI_N_REJECT + BSS_MAP_MSG_ASSIGMENT_FAILURE + BSS_MAP_MSG_ASSIGMENT_COMPLETE + */ + + return -EINVAL; +} + +/* Endpoint to handle regular BSSAP DTAP messages */ +static int dtap_rcvmsg(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg) +{ + struct gsm_network *network = conn_info->network; + struct gsm_subscriber_connection *conn; + + conn = subscr_conn_lookup_a(network, conn_info->conn_id); + if (!conn) { + msgb_free(msg); + return -EINVAL; + } + + LOGP(DMSC, LOGL_NOTICE, "BSC sends layer 3 dtap (conn_id=%i)\n", conn->a.conn_id); + + /* msc_dtap expects the dtap payload in l3h */ + msg->l3h = msg->l2h + 3; + + /* Forward dtap payload into the msc, + * msc_dtap() takes ownership for msg */ + msc_dtap(conn, conn->a.conn_id, msg); + + return 0; +} + +/* Handle incoming connection oriented messages */ +int msc_handle_dt1(struct osmo_sccp_user *scu, struct conn_info *conn_info, struct msgb *msg) +{ + if (msgb_l2len(msg) < sizeof(struct bssmap_header)) { + LOGP(DMSC, LOGL_NOTICE, "The header is too short -- discarding message!\n"); + msgb_free(msg); + } + + switch (msg->l2h[0]) { + case BSSAP_MSG_BSS_MANAGEMENT: + msg->l3h = &msg->l2h[sizeof(struct bssmap_header)]; + return bssmap_rcvmsg_dt1(scu, conn_info, msg); + break; + case BSSAP_MSG_DTAP: + return dtap_rcvmsg(scu, conn_info, msg); + break; + default: + LOGP(DMSC, LOGL_ERROR, "Unimplemented BSSAP msg type: %s\n", gsm0808_bssap_name(msg->l2h[0])); + msgb_free(msg); + return -EINVAL; + } + + return -EINVAL; +} + +/* Get a list with all known BSCs */ +struct llist_head *get_bsc_addr_list(void) +{ + return &bsc_addr_list; +} diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index f92101863..cb95b6cdc 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -144,7 +144,7 @@ struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub, LOGP(DMM, LOGL_DEBUG, "Subscriber %s not paged yet, start paging.\n", vlr_subscr_name(vsub)); rc = msc_paging_request(vsub); - if (rc <= 0) { + if (rc < 0) { LOGP(DMM, LOGL_ERROR, "Subscriber %s paging failed: %d\n", vlr_subscr_name(vsub), rc); return NULL; diff --git a/openbsc/src/libmsc/msc_ifaces.c b/openbsc/src/libmsc/msc_ifaces.c index 1a7d878a2..e0e4773ad 100644 --- a/openbsc/src/libmsc/msc_ifaces.c +++ b/openbsc/src/libmsc/msc_ifaces.c @@ -213,10 +213,7 @@ int msc_call_assignment(struct gsm_trans *trans) switch (conn->via_ran) { case RAN_GERAN_A: - LOGP(DMSC, LOGL_ERROR, - "msc_call_assignment(): A-interface BSSMAP Assignment" - " Request not yet implemented\n"); - return -ENOTSUP; + return a_assign(trans); case RAN_UTRAN_IU: #ifdef BUILD_IU diff --git a/openbsc/src/libmsc/osmo_msc.c b/openbsc/src/libmsc/osmo_msc.c index bfe5343cf..22414fcf1 100644 --- a/openbsc/src/libmsc/osmo_msc.c +++ b/openbsc/src/libmsc/osmo_msc.c @@ -121,9 +121,9 @@ static void msc_assign_fail(struct gsm_subscriber_connection *conn, } /* Receive a CLASSMARK CHNAGE from BSC */ -static void msc_classmark_chg(struct gsm_subscriber_connection *conn, - const uint8_t *cm2, uint8_t cm2_len, - const uint8_t *cm3, uint8_t cm3_len) +void msc_classmark_chg(struct gsm_subscriber_connection *conn, + const uint8_t *cm2, uint8_t cm2_len, + const uint8_t *cm3, uint8_t cm3_len) { conn->classmark.classmark2_len = cm2_len; memcpy(conn->classmark.classmark2, cm2, cm2_len); diff --git a/openbsc/src/osmo-msc/msc_main.c b/openbsc/src/osmo-msc/msc_main.c index 88eba16d4..9987fc90b 100644 --- a/openbsc/src/osmo-msc/msc_main.c +++ b/openbsc/src/osmo-msc/msc_main.c @@ -65,12 +65,14 @@ #include <openbsc/osmo_bsc_rf.h> #include <openbsc/smpp.h> #include <osmocom/sigtran/sccp_sap.h> +#include <osmocom/sigtran/osmo_ss7.h> #include <openbsc/mgcpgw_client.h> #include <openbsc/msc_ifaces.h> #include <openbsc/iu.h> #include <openbsc/iucs.h> #include <openbsc/iucs_ranap.h> +#include <openbsc/a_iface.h> static const char * const osmomsc_copyright = "OsmoMSC - Osmocom Circuit-Switched Core Network implementation\r\n" @@ -504,7 +506,10 @@ TODO: we probably want some of the _net_ ctrl commands from bsc_base_ctrl_cmds_i /* TODO: implement A-Interface and remove above legacy stuff. */ /* Set up IuCS */ - iu_init(tall_msc_ctx, "OsmoMSC", 1, "127.0.0.3", "127.0.0.1", 0, rcvmsg_iu_cs, rx_iu_event); + //iu_init(tall_msc_ctx, "OsmoMSC", 1, "127.0.0.3", "127.0.0.1", 0, rcvmsg_iu_cs, rx_iu_event); + + /* Set up A interface */ + a_init(tall_msc_ctx, "OsmoMSC_A", 254, "127.0.0.3", "127.0.0.1", 0, msc_network); if (msc_cmdline_config.daemonize) { rc = osmo_daemonize(); diff --git a/openbsc/tests/libiudummy/iudummy.c b/openbsc/tests/libiudummy/iudummy.c index 9dae94116..8efb4fa98 100644 --- a/openbsc/tests/libiudummy/iudummy.c +++ b/openbsc/tests/libiudummy/iudummy.c @@ -61,3 +61,9 @@ int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_release() dummy called, NOT sending Release\n"); return 0; } + +struct ue_conn_ctx *ue_conn_ctx_alloc(struct osmo_sccp_addr *addr, uint32_t conn_id) +{ + LOGP(DLGLOBAL, LOGL_INFO, "ue_conn_ctx_alloc() dummy called, NOT allocating UE context\n"); + return NULL; +} diff --git a/openbsc/tests/msc_vlr/Makefile.am b/openbsc/tests/msc_vlr/Makefile.am index 4494d95ae..8c74e6404 100644 --- a/openbsc/tests/msc_vlr/Makefile.am +++ b/openbsc/tests/msc_vlr/Makefile.am @@ -12,6 +12,7 @@ AM_CFLAGS = \ $(LIBCRYPTO_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(NULL) noinst_HEADERS = \ @@ -54,6 +55,7 @@ LDADD = \ $(LIBCRYPTO_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ + $(LIBOSMOSIGTRAN_LIBS) \ -ldbi \ -lrt \ $(NULL) diff --git a/openbsc/tests/sms_queue/Makefile.am b/openbsc/tests/sms_queue/Makefile.am index 011d9fdc9..a6a7a6f29 100644 --- a/openbsc/tests/sms_queue/Makefile.am +++ b/openbsc/tests/sms_queue/Makefile.am @@ -8,6 +8,8 @@ AM_CFLAGS = \ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMORANAP_CFLAGS) \ $(NULL) EXTRA_DIST = \ @@ -38,6 +40,8 @@ sms_queue_test_LDADD = \ $(LIBCRYPTO_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ + $(LIBOSMOSIGTRAN_LIBS) \ + $(LIBOSMORANAP_LIBS) \ -ldbi \ -lrt \ $(NULL) |