[MERGED] osmo-msc[master]: dead code removal

2018-02-13 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: dead code removal
..


dead code removal

Related: OS#2528
Change-Id: I89157c446d66e11adbe3cad587eb34ec40271c12
---
M include/osmocom/msc/gsm_04_08.h
M include/osmocom/msc/gsm_data.h
M include/osmocom/msc/gsm_data_shared.h
M src/libmsc/vty_interface_layer3.c
4 files changed, 2 insertions(+), 105 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/msc/gsm_04_08.h b/include/osmocom/msc/gsm_04_08.h
index 58cb7ae..f059d75 100644
--- a/include/osmocom/msc/gsm_04_08.h
+++ b/include/osmocom/msc/gsm_04_08.h
@@ -31,9 +31,7 @@
 int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg);
 
 int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id);
-enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *bts, uint8_t ra);
 /* don't use "enum gsm_chreq_reason_t" to avoid circular dependency */
-int get_reason_by_chreq(uint8_t ra, int neci);
 void gsm_net_update_ctype(struct gsm_network *net);
 
 int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn);
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 561cf3d..444618c 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -25,31 +25,12 @@
 /** annotations for msgb ownership */
 #define __uses
 
-#define OBSC_NM_W_ACK_CB(__msgb) (__msgb)->cb[3]
-
 struct mncc_sock_state;
-struct gsm_subscriber_group;
 struct vlr_instance;
 struct vlr_subscr;
 struct ranap_ue_conn_ctx;
 
-#define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3]
-
 #define tmsi_from_string(str) strtoul(str, NULL, 10)
-
-/* 3-bit long values */
-#define EARFCN_PRIO_INVALID 8
-#define EARFCN_MEAS_BW_INVALID 8
-/* 5-bit long values */
-#define EARFCN_QRXLV_INVALID 32
-#define EARFCN_THRESH_LOW_INVALID 32
-
-enum gsm_security_event {
-   GSM_SECURITY_NOAVAIL,
-   GSM_SECURITY_AUTH_FAILED,
-   GSM_SECURITY_SUCCEEDED,
-   GSM_SECURITY_ALREADY,
-};
 
 struct msgb;
 typedef int gsm_cbfn(unsigned int hooknum,
@@ -57,56 +38,12 @@
 struct msgb *msg,
 void *data, void *param);
 
-/* Real authentication information containing Ki */
-enum gsm_auth_algo {
-   AUTH_ALGO_NONE,
-   AUTH_ALGO_XOR,
-   AUTH_ALGO_COMP128v1,
-};
-
-struct gsm_auth_info {
-   enum gsm_auth_algo auth_algo;
-   unsigned int a3a8_ki_len;
-   uint8_t a3a8_ki[16];
-};
-
 struct gsm_auth_tuple {
int use_count;
int key_seq;
struct osmo_auth_vector vec;
 };
 #define GSM_KEY_SEQ_INVAL  7   /* GSM 04.08 - 10.5.1.2 */
-
-/*
- * AUTHENTICATION/CIPHERING state
- */
-struct gsm_security_operation {
-   struct gsm_auth_tuple atuple;
-   gsm_cbfn *cb;
-   void *cb_data;
-};
-
-/*
- * A dummy to keep a connection up for at least
- * a couple of seconds to work around MSC issues.
- */
-struct gsm_anchor_operation {
-   struct osmo_timer_list timeout;
-};
-
-/* Maximum number of neighbor cells whose average we track */
-#define MAX_NEIGH_MEAS 10
-/* Maximum size of the averaging window for neighbor cells */
-#define MAX_WIN_NEIGH_AVG  10
-
-/* processed neighbor measurements for one cell */
-struct neigh_meas_proc {
-   uint16_t arfcn;
-   uint8_t bsic;
-   uint8_t rxlev[MAX_WIN_NEIGH_AVG];
-   unsigned int rxlev_cnt;
-   uint8_t last_seen_nr;
-};
 
 enum ran_type {
RAN_UNKNOWN,
@@ -154,12 +91,6 @@
uint8_t expire_timer_stopped;
/* SMS helpers for libmsc */
uint8_t next_rp_ref;
-
-   /*
-* Operations that have a state and might be pending
-*/
-   struct gsm_security_operation *sec_operation;
-   struct gsm_anchor_operation *anch_operation;
 
struct osmo_fsm_inst *conn_fsm;
 
@@ -311,26 +242,11 @@
/* bit-mask of permitted encryption algorithms. LSB=A5/0, MSB=A5/7 */
uint8_t a5_encryption_mask;
bool authentication_required;
-   int neci;
int send_mm_info;
struct {
int active;
-   /* Window RXLEV averaging */
-   unsigned int win_rxlev_avg; /* number of SACCH frames */
-   /* Window RXQUAL averaging */
-   unsigned int win_rxqual_avg;/* number of SACCH frames */
-   /* Window RXLEV neighbouring cells averaging */
-   unsigned int win_rxlev_avg_neigh; /* number of SACCH frames */
-
-   /* how often should we check for power budget HO */
-   unsigned int pwr_interval;  /* SACCH frames */
-   /* how much better does a neighbor cell have to be ? */
-   unsigned int pwr_hysteresis;/* dBm */
-   /* maximum distacne before we try a handover */
-   unsigned int max_distance;  /* TA values */
} handover;
 
-   struct rate_ctr_group 

osmo-msc[master]: dead code removal

2018-02-13 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6413
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I89157c446d66e11adbe3cad587eb34ec40271c12
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-msc[master]: dead code removal

2018-02-13 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6413

dead code removal

Related: OS#2528
Change-Id: I89157c446d66e11adbe3cad587eb34ec40271c12
---
M include/osmocom/msc/gsm_04_08.h
M include/osmocom/msc/gsm_data.h
M include/osmocom/msc/gsm_data_shared.h
M src/libmsc/vty_interface_layer3.c
4 files changed, 2 insertions(+), 105 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/13/6413/1

diff --git a/include/osmocom/msc/gsm_04_08.h b/include/osmocom/msc/gsm_04_08.h
index 58cb7ae..f059d75 100644
--- a/include/osmocom/msc/gsm_04_08.h
+++ b/include/osmocom/msc/gsm_04_08.h
@@ -31,9 +31,7 @@
 int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg);
 
 int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id);
-enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *bts, uint8_t ra);
 /* don't use "enum gsm_chreq_reason_t" to avoid circular dependency */
-int get_reason_by_chreq(uint8_t ra, int neci);
 void gsm_net_update_ctype(struct gsm_network *net);
 
 int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn);
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 561cf3d..444618c 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -25,31 +25,12 @@
 /** annotations for msgb ownership */
 #define __uses
 
-#define OBSC_NM_W_ACK_CB(__msgb) (__msgb)->cb[3]
-
 struct mncc_sock_state;
-struct gsm_subscriber_group;
 struct vlr_instance;
 struct vlr_subscr;
 struct ranap_ue_conn_ctx;
 
-#define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3]
-
 #define tmsi_from_string(str) strtoul(str, NULL, 10)
-
-/* 3-bit long values */
-#define EARFCN_PRIO_INVALID 8
-#define EARFCN_MEAS_BW_INVALID 8
-/* 5-bit long values */
-#define EARFCN_QRXLV_INVALID 32
-#define EARFCN_THRESH_LOW_INVALID 32
-
-enum gsm_security_event {
-   GSM_SECURITY_NOAVAIL,
-   GSM_SECURITY_AUTH_FAILED,
-   GSM_SECURITY_SUCCEEDED,
-   GSM_SECURITY_ALREADY,
-};
 
 struct msgb;
 typedef int gsm_cbfn(unsigned int hooknum,
@@ -57,56 +38,12 @@
 struct msgb *msg,
 void *data, void *param);
 
-/* Real authentication information containing Ki */
-enum gsm_auth_algo {
-   AUTH_ALGO_NONE,
-   AUTH_ALGO_XOR,
-   AUTH_ALGO_COMP128v1,
-};
-
-struct gsm_auth_info {
-   enum gsm_auth_algo auth_algo;
-   unsigned int a3a8_ki_len;
-   uint8_t a3a8_ki[16];
-};
-
 struct gsm_auth_tuple {
int use_count;
int key_seq;
struct osmo_auth_vector vec;
 };
 #define GSM_KEY_SEQ_INVAL  7   /* GSM 04.08 - 10.5.1.2 */
-
-/*
- * AUTHENTICATION/CIPHERING state
- */
-struct gsm_security_operation {
-   struct gsm_auth_tuple atuple;
-   gsm_cbfn *cb;
-   void *cb_data;
-};
-
-/*
- * A dummy to keep a connection up for at least
- * a couple of seconds to work around MSC issues.
- */
-struct gsm_anchor_operation {
-   struct osmo_timer_list timeout;
-};
-
-/* Maximum number of neighbor cells whose average we track */
-#define MAX_NEIGH_MEAS 10
-/* Maximum size of the averaging window for neighbor cells */
-#define MAX_WIN_NEIGH_AVG  10
-
-/* processed neighbor measurements for one cell */
-struct neigh_meas_proc {
-   uint16_t arfcn;
-   uint8_t bsic;
-   uint8_t rxlev[MAX_WIN_NEIGH_AVG];
-   unsigned int rxlev_cnt;
-   uint8_t last_seen_nr;
-};
 
 enum ran_type {
RAN_UNKNOWN,
@@ -154,12 +91,6 @@
uint8_t expire_timer_stopped;
/* SMS helpers for libmsc */
uint8_t next_rp_ref;
-
-   /*
-* Operations that have a state and might be pending
-*/
-   struct gsm_security_operation *sec_operation;
-   struct gsm_anchor_operation *anch_operation;
 
struct osmo_fsm_inst *conn_fsm;
 
@@ -311,26 +242,11 @@
/* bit-mask of permitted encryption algorithms. LSB=A5/0, MSB=A5/7 */
uint8_t a5_encryption_mask;
bool authentication_required;
-   int neci;
int send_mm_info;
struct {
int active;
-   /* Window RXLEV averaging */
-   unsigned int win_rxlev_avg; /* number of SACCH frames */
-   /* Window RXQUAL averaging */
-   unsigned int win_rxqual_avg;/* number of SACCH frames */
-   /* Window RXLEV neighbouring cells averaging */
-   unsigned int win_rxlev_avg_neigh; /* number of SACCH frames */
-
-   /* how often should we check for power budget HO */
-   unsigned int pwr_interval;  /* SACCH frames */
-   /* how much better does a neighbor cell have to be ? */
-   unsigned int pwr_hysteresis;/* dBm */
-   /* maximum distacne before we try a handover */
-   unsigned int max_distance;  /* TA values */
} handover;
 
-   struct rate_ctr_group *bsc_ctrs;
struct rate_ctr_group *msc_ctrs;
struct osmo_counter *active_calls;
 
@@ -347,21 +263,10 @@