Remove dead code left over from NITB split

There still is a lot of dead code that we inherited from the NITB
days, let's remove more of it.

libtrau will be re-introduced as part of osmo-mgw later.

Change-Id: I8e0af56a158f25a4f1384d667c03eb20e72df5b8
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 9d2ee6e..1b86f9a 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -4,7 +4,6 @@
 	abis_om2000.h \
 	abis_rsl.h \
 	arfcn_range_encode.h \
-	auth.h \
 	bsc_msc.h \
 	bsc_msg_filter.h \
 	bsc_nat.h \
@@ -18,7 +17,6 @@
 	common.h \
 	common_bsc.h \
 	common_cs.h \
-	crc24.h \
 	ctrl.h \
 	debug.h \
 	e1_config.h \
@@ -26,16 +24,12 @@
 	gsm_04_80.h \
 	gsm_data.h \
 	gsm_data_shared.h \
-	gsm_subscriber.h \
 	handover.h \
 	handover_decision.h \
 	ipaccess.h \
 	meas_feed.h \
 	meas_rep.h \
 	misdn.h \
-	mncc.h \
-	mncc_int.h \
-	msc_ifaces.h \
 	nat_rewrite_trie.h \
 	network_listen.h \
 	openbscdefines.h \
@@ -52,15 +46,9 @@
 	rest_octets.h \
 	rrlp.h \
 	rs232.h \
-	rtp_proxy.h \
 	signal.h \
-	silent_call.h \
-	sms_queue.h \
 	socket.h \
 	system_information.h \
-	transaction.h \
-	trau_mux.h \
-	trau_upqueue.h \
 	ussd.h \
 	vty.h \
 	bsc_api.h \
diff --git a/include/osmocom/bsc/auth.h b/include/osmocom/bsc/auth.h
deleted file mode 100644
index b314bbf..0000000
--- a/include/osmocom/bsc/auth.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _AUTH_H
-#define _AUTH_H
-
-#include <osmocom/core/utils.h>
-
-struct gsm_auth_tuple;
-
-enum auth_action {
-	AUTH_ERROR		= -1,	/* Internal error */
-	AUTH_NOT_AVAIL		= 0,	/* No auth tuple available */
-	AUTH_DO_AUTH_THEN_CIPH	= 1,	/* Firsth authenticate, then cipher */
-	AUTH_DO_CIPH		= 2,	/* Only ciphering */
-	AUTH_DO_AUTH		= 3,	/* Only authentication, no ciphering */
-};
-
-extern const struct value_string auth_action_names[];
-static inline const char *auth_action_str(enum auth_action a)
-{
-	return get_value_string(auth_action_names, a);
-}
-
-#endif /* _AUTH_H */
diff --git a/include/osmocom/bsc/bss.h b/include/osmocom/bsc/bss.h
index b12487d..9891f5f 100644
--- a/include/osmocom/bsc/bss.h
+++ b/include/osmocom/bsc/bss.h
@@ -6,7 +6,7 @@
 struct msgb;
 
 /* start and stop network */
-extern int bsc_network_alloc(mncc_recv_cb_t mncc_recv);
+extern int bsc_network_alloc(void);
 extern int bsc_network_configure(const char *cfg_file);
 extern int bsc_shutdown_net(struct gsm_network *net);
 
diff --git a/include/osmocom/bsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h
index 320fa94..62d0286 100644
--- a/include/osmocom/bsc/chan_alloc.h
+++ b/include/osmocom/bsc/chan_alloc.h
@@ -24,9 +24,6 @@
 
 struct gsm_subscriber_connection;
 
-/* Find an allocated channel for a specified subscriber */
-struct gsm_subscriber_connection *connection_for_subscr(struct vlr_subscr *vsub);
-
 /* Allocate a logical channel (SDCCH, TCH, ...) */
 struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int allow_bigger);
 
diff --git a/include/osmocom/bsc/common_bsc.h b/include/osmocom/bsc/common_bsc.h
index 08394e9..32e5097 100644
--- a/include/osmocom/bsc/common_bsc.h
+++ b/include/osmocom/bsc/common_bsc.h
@@ -5,5 +5,4 @@
 
 struct gsm_network *bsc_network_init(void *ctx,
 				     uint16_t country_code,
-				     uint16_t network_code,
-				     mncc_recv_cb_t mncc_recv);
+				     uint16_t network_code);
diff --git a/include/osmocom/bsc/common_cs.h b/include/osmocom/bsc/common_cs.h
index 09a4b02..c2e8515 100644
--- a/include/osmocom/bsc/common_cs.h
+++ b/include/osmocom/bsc/common_cs.h
@@ -6,8 +6,6 @@
 struct msgb;
 struct gsm_network;
 
-typedef int (*mncc_recv_cb_t)(struct gsm_network *, struct msgb *);
-
 struct vty;
 
 #define MAX_A5_KEY_LEN	(128/8)
@@ -20,8 +18,7 @@
 
 struct gsm_network *gsm_network_init(void *ctx,
 				     uint16_t country_code,
-				     uint16_t network_code,
-				     mncc_recv_cb_t mncc_recv);
+				     uint16_t network_code);
 
 int common_cs_vty_init(struct gsm_network *network,
                  int (* config_write_net )(struct vty *));
diff --git a/include/osmocom/bsc/crc24.h b/include/osmocom/bsc/crc24.h
deleted file mode 100644
index 756638c..0000000
--- a/include/osmocom/bsc/crc24.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _CRC24_H
-#define _CRC24_H
-
-#include <stdint.h>
-
-#define INIT_CRC24	0xffffff
-
-uint32_t crc24_calc(uint32_t fcs, uint8_t *cp, unsigned int len);
-
-#endif
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index cbb809b..3268426 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -24,11 +24,9 @@
 
 #define OBSC_NM_W_ACK_CB(__msgb) (__msgb)->cb[3]
 
-struct mncc_sock_state;
 struct gsm_subscriber_group;
 struct bsc_subscr;
 struct vlr_instance;
-struct vlr_subscr;
 struct gprs_ra_id;
 
 #define OBSC_LINKID_CB(__msgb)	(__msgb)->cb[3]
@@ -107,42 +105,15 @@
 	/* global linked list of subscriber_connections */
 	struct llist_head entry;
 
-	/* usage count. If this drops to zero, we start the release
-	 * towards A/Iu */
-	uint32_t use_count;
-
-	/* The MS has opened the conn with a CM Service Request, and we shall
-	 * keep it open for an actual request (or until timeout). */
-	bool received_cm_service_request;
-
 	/* libbsc subscriber information (if available) */
 	struct bsc_subscr *bsub;
 
-	/* libmsc/libvlr subscriber information (if available) */
-	struct vlr_subscr *vsub;
-
-	/* LU expiration handling */
-	uint8_t expire_timer_stopped;
-	/* SMS helpers for libmsc */
-	uint8_t next_rp_ref;
-
-	struct osmo_fsm_inst *conn_fsm;
-
-	/* Are we part of a special "silent" call */
-	int silent_call;
-
-	/* MNCC rtp bridge markers */
-	int mncc_rtp_bridge;
-	int mncc_rtp_create_pending;
-	int mncc_rtp_connect_pending;
-
 	/* bsc structures */
 	struct osmo_bsc_sccp_con *sccp_con; /* BSC */
 
 	/* back pointers */
 	struct gsm_network *network;
 
-	bool in_release;
 	struct gsm_lchan *lchan; /* BSC */
 	struct gsm_lchan *ho_lchan; /* BSC */
 	struct gsm_bts *bts; /* BSC */
@@ -151,9 +122,6 @@
 	struct osmo_timer_list T10; /* BSC */
 	struct gsm_lchan *secondary_lchan; /* BSC */
 
-	/* connected via 2G or 3G? */
-	enum ran_type via_ran;
-
 	struct gsm_classmark classmark;
 
 	uint16_t lac;
@@ -336,10 +304,6 @@
 	struct rate_ctr_group *bsc_ctrs;
 	struct osmo_counter *active_calls;
 
-	/* layer 4 */
-	struct mncc_sock_state *mncc_state;
-	mncc_recv_cb_t mncc_recv;
-	struct llist_head upqueue;
 	/*
 	 * TODO: Move the trans_list into the subscriber connection and
 	 * create a pending list for MT transactions. These exist before
@@ -381,8 +345,6 @@
 	/* MSC data in case we are a true BSC */
 	struct osmo_bsc_data *bsc_data;
 
-	struct gsm_sms_queue *sms_queue;
-
 	/* control interface */
 	struct ctrl_handle *ctrl;
 
@@ -451,7 +413,6 @@
 
 struct gsm_sms {
 	unsigned long long id;
-	struct vlr_subscr *receiver;
 	struct gsm_sms_addr src, dst;
 	enum gsm_sms_source_id source;
 
diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h
index e762c24..9bbcabd 100644
--- a/include/osmocom/bsc/gsm_data_shared.h
+++ b/include/osmocom/bsc/gsm_data_shared.h
@@ -33,7 +33,6 @@
 struct osmo_bsc_data;
 
 struct osmo_bsc_sccp_con;
-struct gsm_sms_queue;
 
 /* RRLP mode of operation */
 enum rrlp_mode {
diff --git a/include/osmocom/bsc/gsm_subscriber.h b/include/osmocom/bsc/gsm_subscriber.h
deleted file mode 100644
index ca66d47..0000000
--- a/include/osmocom/bsc/gsm_subscriber.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef _GSM_SUBSCR_H
-#define _GSM_SUBSCR_H
-
-#include <stdbool.h>
-
-#include <osmocom/core/linuxlist.h>
-#include <osmocom/gsm/protocol/gsm_23_003.h>
-
-#include <osmocom/bsc/gsm_data.h>
-
-#define GSM_NAME_LENGTH 160
-
-#define GSM_EXTENSION_LENGTH 15 /* MSISDN can only be 15 digits length */
-#define GSM_MIN_EXTEN 20000
-#define GSM_MAX_EXTEN 49999
-
-#define GSM_SUBSCRIBER_FIRST_CONTACT	0x00000001
-/* gprs_sgsn.h defines additional flags including and above bit 16 (0x10000) */
-
-#define GSM_SUBSCRIBER_NO_EXPIRATION	0x0
-
-enum gsm_subscriber_field {
-	GSM_SUBSCRIBER_IMSI,
-	GSM_SUBSCRIBER_TMSI,
-	GSM_SUBSCRIBER_EXTENSION,
-	GSM_SUBSCRIBER_ID,
-};
-
-enum gsm_subscriber_update_reason {
-	GSM_SUBSCRIBER_UPDATE_ATTACHED,
-	GSM_SUBSCRIBER_UPDATE_DETACHED,
-	GSM_SUBSCRIBER_UPDATE_EQUIPMENT,
-};
-
-/*
- * Struct for pending channel requests. This is managed in the
- * llist_head requests of each subscriber. The reference counting
- * should work in such a way that a subscriber with a pending request
- * remains in memory.
- */
-struct subscr_request {
-       struct llist_head entry;
-
-       /* human readable label to be able to log pending request kinds */
-       const char *label;
-
-       /* the callback data */
-       gsm_cbfn *cbfn;
-       void *param;
-};
-
-int subscr_update(struct vlr_subscr *vsub, int reason);
-
-/*
- * Paging handling with authentication
- */
-struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub,
-					   gsm_cbfn *cbfn, void *param,
-					   const char *label);
-
-void subscr_remove_request(struct subscr_request *req);
-int subscr_rx_paging_response(struct msgb *msg,
-			      struct gsm_subscriber_connection *conn);
-
-int subscr_paging_dispatch(unsigned int hooknum, unsigned int event,
-			   struct msgb *msg, void *data, void *param);
-
-#endif /* _GSM_SUBSCR_H */
diff --git a/include/osmocom/bsc/ipaccess.h b/include/osmocom/bsc/ipaccess.h
index 82e89c2..3d0f612 100644
--- a/include/osmocom/bsc/ipaccess.h
+++ b/include/osmocom/bsc/ipaccess.h
@@ -2,11 +2,13 @@
 #define _IPACCESS_H
 
 #include <osmocom/abis/e1_input.h>
-#include "gsm_subscriber.h"
 #include <osmocom/core/linuxlist.h>
 #include <osmocom/gsm/protocol/ipaccess.h>
 #include <osmocom/gsm/protocol/gsm_23_003.h>
 
+struct gsm_bts;
+struct gsm_bts_trx;
+
 struct ipac_msgt_sccp_state {
 	uint8_t	src_ref[3];
 	uint8_t	dst_ref[3];
diff --git a/include/osmocom/bsc/mncc.h b/include/osmocom/bsc/mncc.h
deleted file mode 100644
index 881e041..0000000
--- a/include/osmocom/bsc/mncc.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/* GSM Mobile Radio Interface Layer 3 messages on the A-bis interface 
- * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */
-
-/* (C) 2008-2009 by Harald Welte <laforge@gnumonks.org>
- * (C) 2008, 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
- *
- * 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 <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef _MNCC_H
-#define _MNCC_H
-
-#include <osmocom/core/linuxlist.h>
-#include <osmocom/gsm/mncc.h>
-
-#include <stdint.h>
-
-struct gsm_network;
-struct msgb;
-
-
-/* One end of a call */
-struct gsm_call {
-	struct llist_head entry;
-
-	/* network handle */
-	void *net;
-
-	/* the 'local' transaction */
-	uint32_t callref;
-	/* the 'remote' transaction */
-	uint32_t remote_ref;
-};
-
-#define MNCC_SETUP_REQ		0x0101
-#define MNCC_SETUP_IND		0x0102
-#define MNCC_SETUP_RSP		0x0103
-#define MNCC_SETUP_CNF		0x0104
-#define MNCC_SETUP_COMPL_REQ	0x0105
-#define MNCC_SETUP_COMPL_IND	0x0106
-/* MNCC_REJ_* is perfomed via MNCC_REL_* */
-#define MNCC_CALL_CONF_IND	0x0107
-#define MNCC_CALL_PROC_REQ	0x0108
-#define MNCC_PROGRESS_REQ	0x0109
-#define MNCC_ALERT_REQ		0x010a
-#define MNCC_ALERT_IND		0x010b
-#define MNCC_NOTIFY_REQ		0x010c
-#define MNCC_NOTIFY_IND		0x010d
-#define MNCC_DISC_REQ		0x010e
-#define MNCC_DISC_IND		0x010f
-#define MNCC_REL_REQ		0x0110
-#define MNCC_REL_IND		0x0111
-#define MNCC_REL_CNF		0x0112
-#define MNCC_FACILITY_REQ	0x0113
-#define MNCC_FACILITY_IND	0x0114
-#define MNCC_START_DTMF_IND	0x0115
-#define MNCC_START_DTMF_RSP	0x0116
-#define MNCC_START_DTMF_REJ	0x0117
-#define MNCC_STOP_DTMF_IND	0x0118
-#define MNCC_STOP_DTMF_RSP	0x0119
-#define MNCC_MODIFY_REQ		0x011a
-#define MNCC_MODIFY_IND		0x011b
-#define MNCC_MODIFY_RSP		0x011c
-#define MNCC_MODIFY_CNF		0x011d
-#define MNCC_MODIFY_REJ		0x011e
-#define MNCC_HOLD_IND		0x011f
-#define MNCC_HOLD_CNF		0x0120
-#define MNCC_HOLD_REJ		0x0121
-#define MNCC_RETRIEVE_IND	0x0122
-#define MNCC_RETRIEVE_CNF	0x0123
-#define MNCC_RETRIEVE_REJ	0x0124
-#define MNCC_USERINFO_REQ	0x0125
-#define MNCC_USERINFO_IND	0x0126
-#define MNCC_REJ_REQ		0x0127
-#define MNCC_REJ_IND		0x0128
-
-#define MNCC_BRIDGE		0x0200
-#define MNCC_FRAME_RECV		0x0201
-#define MNCC_FRAME_DROP		0x0202
-#define MNCC_LCHAN_MODIFY	0x0203
-#define MNCC_RTP_CREATE		0x0204
-#define MNCC_RTP_CONNECT	0x0205
-#define MNCC_RTP_FREE		0x0206
-
-#define GSM_TCHF_FRAME		0x0300
-#define GSM_TCHF_FRAME_EFR	0x0301
-#define GSM_TCHH_FRAME		0x0302
-#define GSM_TCH_FRAME_AMR	0x0303
-#define GSM_BAD_FRAME		0x03ff
-
-#define MNCC_SOCKET_HELLO	0x0400
-
-#define GSM_MAX_FACILITY	128
-#define GSM_MAX_SSVERSION	128
-#define GSM_MAX_USERUSER	128
-
-#define	MNCC_F_BEARER_CAP	0x0001
-#define MNCC_F_CALLED		0x0002
-#define MNCC_F_CALLING		0x0004
-#define MNCC_F_REDIRECTING	0x0008
-#define MNCC_F_CONNECTED	0x0010
-#define MNCC_F_CAUSE		0x0020
-#define MNCC_F_USERUSER		0x0040
-#define MNCC_F_PROGRESS		0x0080
-#define MNCC_F_EMERGENCY	0x0100
-#define MNCC_F_FACILITY		0x0200
-#define MNCC_F_SSVERSION	0x0400
-#define MNCC_F_CCCAP		0x0800
-#define MNCC_F_KEYPAD		0x1000
-#define MNCC_F_SIGNAL		0x2000
-
-struct gsm_mncc {
-	/* context based information */
-	uint32_t	msg_type;
-	uint32_t	callref;
-
-	/* which fields are present */
-	uint32_t	fields;
-
-	/* data derived informations (MNCC_F_ based) */
-	struct gsm_mncc_bearer_cap	bearer_cap;
-	struct gsm_mncc_number		called;
-	struct gsm_mncc_number		calling;
-	struct gsm_mncc_number		redirecting;
-	struct gsm_mncc_number		connected;
-	struct gsm_mncc_cause		cause;
-	struct gsm_mncc_progress	progress;
-	struct gsm_mncc_useruser	useruser;
-	struct gsm_mncc_facility	facility;
-	struct gsm_mncc_cccap		cccap;
-	struct gsm_mncc_ssversion	ssversion;
-	struct	{
-		int		sup;
-		int		inv;
-	} clir;
-	int		signal;
-
-	/* data derived information, not MNCC_F based */
-	int		keypad;
-	int		more;
-	int		notify; /* 0..127 */
-	int		emergency;
-	char		imsi[16];
-};
-
-struct gsm_data_frame {
-	uint32_t	msg_type;
-	uint32_t	callref;
-	unsigned char	data[0];
-};
-
-#define MNCC_SOCK_VERSION	5
-struct gsm_mncc_hello {
-	uint32_t	msg_type;
-	uint32_t	version;
-
-	/* send the sizes of the structs */
-	uint32_t	mncc_size;
-	uint32_t	data_frame_size;
-
-	/* send some offsets */
-	uint32_t	called_offset;
-	uint32_t	signal_offset;
-	uint32_t	emergency_offset;
-};
-
-struct gsm_mncc_rtp {
-	uint32_t	msg_type;
-	uint32_t	callref;
-	uint32_t	ip;
-	uint16_t	port;
-	uint32_t	payload_type;
-	uint32_t	payload_msg_type;
-};
-
-struct gsm_mncc_bridge {
-	uint32_t	msg_type;
-	uint32_t	callref[2];
-};
-
-const char *get_mncc_name(int value);
-void mncc_set_cause(struct gsm_mncc *data, int loc, int val);
-void cc_tx_to_mncc(struct gsm_network *net, struct msgb *msg);
-
-/* input from CC code into mncc_builtin */
-int int_mncc_recv(struct gsm_network *net, struct msgb *msg);
-
-/* input from CC code into mncc_sock */
-int mncc_sock_from_cc(struct gsm_network *net, struct msgb *msg);
-
-int mncc_sock_init(struct gsm_network *net, const char *sock_path);
-
-#define mncc_is_data_frame(msg_type) \
-	(msg_type == GSM_TCHF_FRAME \
-		|| msg_type == GSM_TCHF_FRAME_EFR \
-		|| msg_type == GSM_TCHH_FRAME \
-		|| msg_type == GSM_TCH_FRAME_AMR \
-		|| msg_type == GSM_BAD_FRAME)
-
-
-#endif
diff --git a/include/osmocom/bsc/mncc_int.h b/include/osmocom/bsc/mncc_int.h
deleted file mode 100644
index 213ce14..0000000
--- a/include/osmocom/bsc/mncc_int.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _MNCC_INT_H
-#define _MNCC_INT_H
-
-#include <stdint.h>
-
-struct mncc_int {
-	uint8_t def_codec[2];
-};
-
-extern struct mncc_int mncc_int;
-
-uint8_t mncc_codec_for_mode(int lchan_type);
-
-#endif
diff --git a/include/osmocom/bsc/msc_ifaces.h b/include/osmocom/bsc/msc_ifaces.h
deleted file mode 100644
index dadb828..0000000
--- a/include/osmocom/bsc/msc_ifaces.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#pragma once
-
-#include <osmocom/core/msgb.h>
-#include <osmocom/bsc/gsm_data.h>
-
-/* These are the interfaces of the MSC layer towards (from?) the BSC and RNC,
- * i.e. in the direction towards the mobile device (MS aka UE).
- *
- * 2G will use the A-interface,
- * 3G aka UMTS will use the Iu-interface (for the MSC, it's IuCS).
- *
- * To allow linking parts of the MSC code without having to include entire
- * infrastructures of external libraries, the core transmitting and receiving
- * functions are left unimplemented. For example, a unit test does not need to
- * link against external ASN1 libraries if it is never going to encode actual
- * outgoing messages. It is up to each building scope to implement real world
- * functions or to plug mere dummy implementations.
- *
- * For example, msc_tx_dtap(conn, msg), depending on conn->via_iface, will call
- * either iu_tx() or a_tx() [note: at time of writing, the A-interface is not
- * yet implemented]. When you try to link against libmsc, you will find that
- * the compiler complains about an undefined reference to iu_tx(). If you,
- * however, link against libiu as well as the osmo-iuh libs (etc.), iu_tx() is
- * available. A unit test may instead simply implement a dummy iu_tx() function
- * and not link against osmo-iuh, see tests/libiudummy/.
- */
-
-/* Each main linkage must implement this function (see comment above). */
-extern int iu_tx(struct msgb *msg, uint8_t sapi);
-
-int msc_tx_dtap(struct gsm_subscriber_connection *conn,
-		struct msgb *msg);
-
-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);
-
-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);
-void msc_call_release(struct gsm_trans *trans);
-int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip);
diff --git a/include/osmocom/bsc/rtp_proxy.h b/include/osmocom/bsc/rtp_proxy.h
deleted file mode 100644
index 918420c..0000000
--- a/include/osmocom/bsc/rtp_proxy.h
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifndef _RTP_PROXY_H
-#define _RTP_PROXY_H
-
-/* RTP proxy handling for ip.access nanoBTS */
-
-/* (C) 2009 by Harald Welte <laforge@gnumonks.org>
- * 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 <http://www.gnu.org/licenses/>.
- *
- */
-
-
-#include <netinet/in.h>
-
-#include <osmocom/core/linuxlist.h>
-#include <osmocom/core/select.h>
-
-#include <osmocom/bsc/mncc.h>
-
-#define RTP_PT_GSM_FULL 3
-#define RTP_PT_GSM_HALF 96
-#define RTP_PT_GSM_EFR 97
-#define RTP_PT_AMR 98
-#define RTP_LEN_GSM_FULL 33
-#define RTP_LEN_GSM_HALF 15
-#define RTP_LEN_GSM_EFR 31
-#define RTP_GSM_DURATION 160
-
-enum rtp_rx_action {
-	RTP_NONE,
-	RTP_PROXY,
-	RTP_RECV_UPSTREAM,
-};
-
-enum rtp_tx_action {
-	RTP_SEND_NONE,
-	RTP_SEND_DOWNSTREAM,
-};
-
-struct rtp_sub_socket {
-	struct sockaddr_in sin_local;
-	struct sockaddr_in sin_remote;
-
-	struct osmo_fd bfd;
-	/* linked list of to-be-transmitted msgb's */
-	struct llist_head tx_queue;
-};
-
-struct rtp_socket {
-	struct llist_head list;
-
-	struct rtp_sub_socket rtp;
-	struct rtp_sub_socket rtcp;
-
-	/* what should we do on receive? */
-	enum rtp_rx_action rx_action;
-	union {
-		struct {
-			struct rtp_socket *other_sock;
-		} proxy;
-		struct {
-			struct gsm_network *net;
-			uint32_t callref;
-		} receive;
-	};
-	enum rtp_tx_action tx_action;
-	struct {
-		uint16_t sequence;
-		uint32_t timestamp;
-		uint32_t ssrc;
-		struct timeval last_tv;
-	} transmit;
-};
-
-struct rtp_socket *rtp_socket_create(void);
-int rtp_socket_bind(struct rtp_socket *rs, uint32_t ip);
-int rtp_socket_connect(struct rtp_socket *rs, uint32_t ip, uint16_t port);
-int rtp_socket_proxy(struct rtp_socket *this, struct rtp_socket *other);
-int rtp_socket_upstream(struct rtp_socket *this, struct gsm_network *net, uint32_t callref);
-int rtp_socket_free(struct rtp_socket *rs);
-int rtp_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame);
-
-#endif /* _RTP_PROXY_H */
diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h
index feab246..58d9acf 100644
--- a/include/osmocom/bsc/signal.h
+++ b/include/osmocom/bsc/signal.h
@@ -34,19 +34,15 @@
  */
 enum signal_subsystems {
 	SS_PAGING,
-	SS_SMS,
 	SS_ABISIP,
 	SS_NM,
 	SS_LCHAN,
-	SS_SUBSCR,
-	SS_SCALL,
 	SS_CHALLOC,
 	SS_IPAC_NWL,
 	SS_RF,
 	SS_MSC,
 	SS_HO,
 	SS_CCCH,
-	SS_SGSN,
 };
 
 /* SS_PAGING signals */
@@ -55,15 +51,6 @@
 	S_PAGING_EXPIRED,
 };
 
-/* SS_SMS signals */
-enum signal_sms {
-	S_SMS_SUBMITTED,	/* A SMS has been successfully submitted to us */
-	S_SMS_DELIVERED,	/* A SMS has been successfully delivered to a MS */
-	S_SMS_SMMA,		/* A MS tells us it has more space available */
-	S_SMS_MEM_EXCEEDED,	/* A MS tells us it has no more space available */
-	S_SMS_UNKNOWN_ERROR,	/* A MS tells us it has an error */
-};
-
 /* SS_ABISIP signals */
 enum signal_abisip {
 	S_ABISIP_CRCX_ACK,
@@ -108,20 +95,6 @@
 	S_CHALLOC_FREED,	/* lchan has been successfully freed */
 };
 
-/* SS_SUBSCR signals */
-enum signal_subscr {
-	S_SUBSCR_ATTACHED,
-	S_SUBSCR_DETACHED,
-	S_SUBSCR_IDENTITY,		/* we've received some identity information */
-};
-
-/* SS_SCALL signals */
-enum signal_scall {
-	S_SCALL_SUCCESS,
-	S_SCALL_EXPIRED,
-	S_SCALL_DETACHED,
-};
-
 /* SS_IPAC_NWL signals */
 enum signal_ipaccess {
 	S_IPAC_NWL_COMPLETE,
@@ -138,21 +111,6 @@
 	S_RF_GRACE,
 };
 
-struct paging_signal_data {
-	struct vlr_subscr *vsub;
-	struct gsm_bts *bts;
-
-	int paging_result;
-
-	/* NULL in case the paging didn't work */
-	struct gsm_subscriber_connection *conn;
-};
-
-struct scall_signal_data {
-	struct gsm_subscriber_connection *conn;
-	void *data;
-};
-
 struct ipacc_ack_signal_data {
 	struct gsm_bts_trx *trx;
 	uint8_t msg_type;
@@ -197,15 +155,6 @@
 	struct gsm_network *net;
 };
 
-struct sms_signal_data {
-	/* The transaction where this occured */
-	struct gsm_trans *trans;
-	/* Can be NULL for SMMA */
-	struct gsm_sms *sms;
-	/* int paging result. Only the ones with > 0 */
-	int paging_result;
-};
-
 struct lchan_signal_data {
 	/* The lchan the signal happened on */
 	struct gsm_lchan *lchan;
@@ -239,22 +188,4 @@
 	uint16_t rach_access_count;
 };
 
-/* GPRS SGSN signals SS_SGSN */
-enum signal_sgsn {
-	S_SGSN_ATTACH,
-	S_SGSN_DETACH,
-	S_SGSN_UPDATE,
-	S_SGSN_PDP_ACT,
-	S_SGSN_PDP_DEACT,
-	S_SGSN_PDP_TERMINATE,
-	S_SGSN_PDP_FREE,
-	S_SGSN_MM_FREE,
-};
-
-struct sgsn_mm_ctx;
-struct sgsn_signal_data {
-	struct sgsn_mm_ctx *mm;
-	struct sgsn_pdp_ctx *pdp;	/* non-NULL for PDP_ACT, PDP_DEACT, PDP_FREE */
-};
-
 #endif
diff --git a/include/osmocom/bsc/silent_call.h b/include/osmocom/bsc/silent_call.h
deleted file mode 100644
index 5fec77b..0000000
--- a/include/osmocom/bsc/silent_call.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _SILENT_CALL_H
-#define _SILENT_CALL_H
-
-struct gsm_subscriber_connection;
-
-extern int gsm_silent_call_start(struct vlr_subscr *vsub,
-                                 void *data, int type);
-extern int gsm_silent_call_stop(struct vlr_subscr *vsub);
-
-#if 0
-extern int silent_call_rx(struct gsm_subscriber_connection *conn, struct msgb *msg);
-extern int silent_call_reroute(struct gsm_subscriber_connection *conn, struct msgb *msg);
-#endif
-
-#endif /* _SILENT_CALL_H */
diff --git a/include/osmocom/bsc/smpp.h b/include/osmocom/bsc/smpp.h
deleted file mode 100644
index bcdac8f..0000000
--- a/include/osmocom/bsc/smpp.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#pragma once
-
-int smpp_openbsc_alloc_init(void *ctx);
-int smpp_openbsc_start(struct gsm_network *net);
diff --git a/include/osmocom/bsc/sms_queue.h b/include/osmocom/bsc/sms_queue.h
deleted file mode 100644
index 2a8bd58..0000000
--- a/include/osmocom/bsc/sms_queue.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef SMS_QUEUE_H
-#define SMS_QUEUE_H
-
-struct gsm_network;
-struct gsm_sms_queue;
-struct vty;
-
-int sms_queue_start(struct gsm_network *, int in_flight);
-int sms_queue_trigger(struct gsm_sms_queue *);
-
-/* vty helper functions */
-int sms_queue_stats(struct gsm_sms_queue *, struct vty* vty);
-int sms_queue_set_max_pending(struct gsm_sms_queue *, int max);
-int sms_queue_set_max_failure(struct gsm_sms_queue *, int fail);
-int sms_queue_clear(struct gsm_sms_queue *);
-
-#endif
diff --git a/include/osmocom/bsc/transaction.h b/include/osmocom/bsc/transaction.h
deleted file mode 100644
index 5465548..0000000
--- a/include/osmocom/bsc/transaction.h
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef _TRANSACT_H
-#define _TRANSACT_H
-
-#include <osmocom/bsc/gsm_data.h>
-#include <osmocom/bsc/gsm_subscriber.h>
-#include <osmocom/core/linuxlist.h>
-#include <osmocom/bsc/mncc.h>
-#include <osmocom/gsm/gsm0411_smc.h>
-#include <osmocom/gsm/gsm0411_smr.h>
-
-enum bridge_state {
-	BRIDGE_STATE_NONE,
-	BRIDGE_STATE_LOOPBACK_PENDING,
-	BRIDGE_STATE_LOOPBACK_ESTABLISHED,
-	BRIDGE_STATE_BRIDGE_PENDING,
-	BRIDGE_STATE_BRIDGE_ESTABLISHED,
-};
-
-/* One transaction */
-struct gsm_trans {
-	/* Entry in list of all transactions */
-	struct llist_head entry;
-
-	/* Back pointer to the network struct */
-	struct gsm_network *net;
-
-	/* The protocol within which we live */
-	uint8_t protocol;
-
-	/* The current transaction ID */
-	uint8_t transaction_id;
-
-	/* To whom we belong, unique identifier of remote MM entity */
-	struct vlr_subscr *vsub;
-
-	/* The associated connection we are using to transmit messages */
-	struct gsm_subscriber_connection *conn;
-
-	/* reference from MNCC or other application */
-	uint32_t callref;
-
-	/* if traffic channel receive was requested */
-	int tch_recv;
-
-	/* is thats one paging? */
-	struct subscr_request *paging_request;
-
-	/* bearer capabilities (rate and codec) */
-	struct gsm_mncc_bearer_cap bearer_cap;
-
-	/* status of the assignment, true when done */
-	bool assignment_done;
-
-	/* if true, TCH_RTP_CREATE is sent after the
-	 * assignment is done */
-	bool tch_rtp_create;
-
-	union {
-		struct {
-
-			/* current call state */
-			int state;
-
-			/* current timer and message queue */
-			int Tcurrent;		/* current CC timer */
-			int T308_second;	/* used to send release again */
-			struct osmo_timer_list timer;
-			struct gsm_mncc msg;	/* stores setup/disconnect/release message */
-		} cc;
-		struct {
-			struct gsm411_smc_inst smc_inst;
-			struct gsm411_smr_inst smr_inst;
-
-			struct gsm_sms *sms;
-		} sms;
-	};
-
-	struct {
-		struct gsm_trans *peer;
-		enum bridge_state state;
-	} bridge;
-};
-
-
-
-struct gsm_trans *trans_find_by_id(struct gsm_subscriber_connection *conn,
-				   uint8_t proto, uint8_t trans_id);
-struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
-					uint32_t callref);
-
-struct gsm_trans *trans_alloc(struct gsm_network *net,
-			      struct vlr_subscr *vsub,
-			      uint8_t protocol, uint8_t trans_id,
-			      uint32_t callref);
-void trans_free(struct gsm_trans *trans);
-
-int trans_assign_trans_id(struct gsm_network *net, struct vlr_subscr *vsub,
-			  uint8_t protocol, uint8_t ti_flag);
-struct gsm_trans *trans_has_conn(const struct gsm_subscriber_connection *conn);
-void trans_conn_closed(struct gsm_subscriber_connection *conn);
-
-#endif
diff --git a/include/osmocom/bsc/trau_mux.h b/include/osmocom/bsc/trau_mux.h
deleted file mode 100644
index eeceff5..0000000
--- a/include/osmocom/bsc/trau_mux.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Simple TRAU frame reflector to route voice calls */
-
-/* (C) 2009 by Harald Welte <laforge@gnumonks.org>
- * 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 <http://www.gnu.org/licenses/>.
- *
- */
-
-/* The "TRAU mux map" defines which particular 16kbit sub-slot (in which E1
- * timeslot on which E1 interface) should be directly muxed to which other 
- * sub-slot.  Entries in the mux map are always bi-directional. 
- *
- * The idea of all this is to directly switch voice channels in the BSC
- * from one phone to another.  We do this right now since we don't support
- * any external interface for voice channels, and in the future as an
- * optimization to routing them externally.
- */
-
-#include <stdint.h>
-#include <osmocom/bsc/gsm_data.h>
-#include <osmocom/bsc/mncc.h>
-
-struct decoded_trau_frame;
-
-/* map a TRAU mux map entry */
-int trau_mux_map(const struct gsm_e1_subslot *src,
-		 const struct gsm_e1_subslot *dst);
-int trau_mux_map_lchan(const struct gsm_lchan *src,	
-			const struct gsm_lchan *dst);
-
-/* unmap a TRAU mux map entry */
-int trau_mux_unmap(const struct gsm_e1_subslot *ss, uint32_t callref);
-
-/* we get called by subchan_demux */
-int trau_mux_input(struct gsm_e1_subslot *src_e1_ss,
-		   const uint8_t *trau_bits, int num_bits);
-
-/* add a trau receiver */
-int trau_recv_lchan(struct gsm_lchan *lchan, uint32_t callref);
-
-/* send trau from application */
-int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame);
-
-/* switch trau muxer to new lchan */
-int switch_trau_mux(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan);
-
-/* callback invoked if we receive TRAU frames */
-int subch_cb(struct subch_demux *dmx, int ch, uint8_t *data, int len, void *_priv);
-
-/* TRAU frame transcoding */
-struct msgb *trau_decode_fr(uint32_t callref,
-	const struct decoded_trau_frame *tf);
-struct msgb *trau_decode_efr(uint32_t callref,
-	const struct decoded_trau_frame *tf);
-void trau_encode_fr(struct decoded_trau_frame *tf,
-	const unsigned char *data);
-void trau_encode_efr(struct decoded_trau_frame *tf,
-	const unsigned char *data);
diff --git a/include/osmocom/bsc/trau_upqueue.h b/include/osmocom/bsc/trau_upqueue.h
deleted file mode 100644
index ecc7658..0000000
--- a/include/osmocom/bsc/trau_upqueue.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _TRAU_UPQUEUE_H
-#define _TRAU_UPQUEUE_H
-
-void trau_tx_to_mncc(struct gsm_network *net, struct msgb *msg);
-
-#endif /* _TRAU_UPQUEUE_H */
-