From a7a3947b9bd82e30124baab5c71925f20228ad9a Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 5 Jul 2017 15:19:52 +0200 Subject: move libiu to osmo-iuh/libosmo-ranap Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers available, add iu_dummy.h, containing mere function signatures that match iu_dummy.c and a mostly empty struct ranap_ue_conn_ctx. Make sure we can build with and without --enable-iu: include osmo-iuh headers only with --enable-iu. Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b --- include/openbsc/Makefile.am | 2 +- include/openbsc/gprs_sgsn.h | 4 +-- include/openbsc/gsm_data.h | 6 ++-- include/openbsc/iu.h | 77 -------------------------------------------- include/openbsc/iu_dummy.h | 51 +++++++++++++++++++++++++++++ include/openbsc/iucs.h | 2 +- include/openbsc/iucs_ranap.h | 4 +-- include/openbsc/sgsn.h | 2 +- 8 files changed, 61 insertions(+), 87 deletions(-) delete mode 100644 include/openbsc/iu.h create mode 100644 include/openbsc/iu_dummy.h (limited to 'include') diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 25709f1d2..89e0338f5 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -49,9 +49,9 @@ noinst_HEADERS = \ handover.h \ handover_decision.h \ ipaccess.h \ - iu.h \ iucs.h \ iucs_ranap.h \ + iu_dummy.h \ meas_feed.h \ meas_rep.h \ mgcp.h \ diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h index 4e49c0889..57995e018 100644 --- a/include/openbsc/gprs_sgsn.h +++ b/include/openbsc/gprs_sgsn.h @@ -117,7 +117,7 @@ struct service_info { uint16_t pdp_status; }; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; /* According to TS 03.60, Table 5: SGSN MM and PDP Contexts */ /* Extended by 3GPP TS 23.060, Table 6: SGSN MM and PDP Contexts */ @@ -159,7 +159,7 @@ struct sgsn_mm_ctx { /* CSG Subscription Data */ /* LIPA Allowed */ /* Voice Support Match Indicator */ - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct service_info service; } iu; /* VLR number */ diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 43fc6d330..6079900a1 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -30,7 +30,7 @@ struct gsm_subscriber_group; struct bsc_subscr; struct vlr_instance; struct vlr_subscr; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] @@ -203,7 +203,7 @@ struct gsm_subscriber_connection { /* which Iu-CS connection, if any. */ struct { - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; uint8_t rab_id; } iu; @@ -493,7 +493,7 @@ struct gsm_network { struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; struct osmo_sccp_instance *sccp; } iu; diff --git a/include/openbsc/iu.h b/include/openbsc/iu.h deleted file mode 100644 index 08e4cd06b..000000000 --- a/include/openbsc/iu.h +++ /dev/null @@ -1,77 +0,0 @@ -#pragma once - -#include -#include - -#include -#include -#include - -#include - -struct sgsn_pdp_ctx; -struct msgb; -struct gsm_auth_tuple; -struct osmo_sccp_addr; -struct osmo_ss7_instance; - -struct RANAP_RAB_SetupOrModifiedItemIEs_s; -struct RANAP_GlobalRNC_ID; -struct RANAP_Cause; - -/* Debugging switches from asn1c and osmo-iuh */ -extern int asn_debug; -extern int asn1_xer_print; - -struct ue_conn_ctx { - struct llist_head list; - /* TODO: It's not needed to store the full SCCP address for each - * UE. Rather than that, a pointer to the RNC should be far - * sufficient */ - struct osmo_sccp_addr sccp_addr; - uint32_t conn_id; - int integrity_active; - struct gprs_ra_id ra_id; - enum nsap_addr_enc rab_assign_addr_enc; -}; - -enum iu_event_type { - IU_EVENT_RAB_ASSIGN, - IU_EVENT_SECURITY_MODE_COMPLETE, - IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ - IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ -}; - -extern const struct value_string iu_event_type_names[]; -static inline const char *iu_event_type_str(enum iu_event_type e) -{ - return get_value_string(iu_event_type_names, e); -} - -/* Implementations of iu_recv_cb_t shall find the ue_conn_ctx in msg->dst. */ -typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, - uint16_t *sai); - -typedef int (* iu_event_cb_t )(struct ue_conn_ctx *ue_ctx, - enum iu_event_type type, void *data); - -typedef int (* iu_rab_ass_resp_cb_t )(struct ue_conn_ctx *ue_ctx, uint8_t rab_id, - struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb); - -int iu_tx(struct msgb *msg, uint8_t sapi); - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg); -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id); -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key); -int iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -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); diff --git a/include/openbsc/iu_dummy.h b/include/openbsc/iu_dummy.h new file mode 100644 index 000000000..d5e142801 --- /dev/null +++ b/include/openbsc/iu_dummy.h @@ -0,0 +1,51 @@ +/* Trivial switch-off of external Iu dependencies, + * allowing to run full unit tests even when built without Iu support. */ + +/* + * (C) 2016,2017 by sysmocom s.f.m.c. GmbH + * + * Author: Neels Hofmeyr + * + * All Rights Reserved + * + * 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 . + * + */ + +#include +#include + +#include + +struct msgb; +struct gsm_auth_tuple; +struct RANAP_Cause; +struct osmo_auth_vector; + +struct ranap_ue_conn_ctx { + struct llist_head list; + uint32_t conn_id; +}; + +int ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck); +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); +struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, + uint16_t rtp_port, + bool use_x213_nsap); +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); diff --git a/include/openbsc/iucs.h b/include/openbsc/iucs.h index fb61a5cf1..b7d60645d 100644 --- a/include/openbsc/iucs.h +++ b/include/openbsc/iucs.h @@ -4,4 +4,4 @@ int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg, uint16_t *lac); struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network, - struct ue_conn_ctx *ue); + struct ranap_ue_conn_ctx *ue); diff --git a/include/openbsc/iucs_ranap.h b/include/openbsc/iucs_ranap.h index 748de23d7..c2ff5f90e 100644 --- a/include/openbsc/iucs_ranap.h +++ b/include/openbsc/iucs_ranap.h @@ -1,7 +1,7 @@ #pragma once struct gsm_network; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data); + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data); diff --git a/include/openbsc/sgsn.h b/include/openbsc/sgsn.h index 57b2978ff..f371dc695 100644 --- a/include/openbsc/sgsn.h +++ b/include/openbsc/sgsn.h @@ -112,7 +112,7 @@ struct sgsn_config { } dcomp_v42bis; struct { - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; } iu; }; -- cgit v1.2.3