nat: Rename "struct sccp_connections" to "struct nat_sccp_connection"

The name sccp_connection is used in the osmo-sccp code, sccp_connections
was used in the NAT for tracking a sccp_connection. Rename it so it is
obvious that the struct belongs to the nat.

The rename was done with sed:
$ sed -i s,"struct sccp_connections","struct nat_sccp_connection",g \
		include/openbsc/*.h src/osmo-bsc_nat/* tests/*/*
diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
index 85f940b..701cc72 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
@@ -108,7 +108,7 @@
 	return con->_endpoint_status == NULL;
 }
 
-static int bsc_assign_endpoint(struct bsc_connection *bsc, struct sccp_connections *con)
+static int bsc_assign_endpoint(struct bsc_connection *bsc, struct nat_sccp_connection *con)
 {
 	int multiplex;
 	int timeslot;
@@ -165,9 +165,9 @@
 	return (multiplex << 5) | (timeslot & 0x1f);
 }
 
-int bsc_mgcp_assign_patch(struct sccp_connections *con, struct msgb *msg)
+int bsc_mgcp_assign_patch(struct nat_sccp_connection *con, struct msgb *msg)
 {
-	struct sccp_connections *mcon;
+	struct nat_sccp_connection *mcon;
 	struct tlv_parsed tp;
 	uint16_t cic;
 	uint8_t timeslot;
@@ -299,7 +299,7 @@
 	bsc_write_mgcp(bsc, (uint8_t *) buf, len);
 }
 
-void bsc_mgcp_init(struct sccp_connections *con)
+void bsc_mgcp_init(struct nat_sccp_connection *con)
 {
 	con->msc_endp = -1;
 	con->bsc_endp = -1;
@@ -310,7 +310,7 @@
  * once the internal DLCX response arrives this can be combined with the
  * the BSC side and forwarded as a trap.
  */
-static void remember_pending_dlcx(struct sccp_connections *con, uint32_t transaction)
+static void remember_pending_dlcx(struct nat_sccp_connection *con, uint32_t transaction)
 {
 	struct bsc_nat_call_stats *stats;
 	struct bsc_connection *bsc = con->bsc;
@@ -366,7 +366,7 @@
 	llist_add_tail(&stats->entry, &bsc->pending_dlcx);
 }
 
-void bsc_mgcp_dlcx(struct sccp_connections *con)
+void bsc_mgcp_dlcx(struct nat_sccp_connection *con)
 {
 	/* send a DLCX down the stream */
 	if (con->bsc_endp != -1 && con->bsc->_endpoint_status) {
@@ -475,10 +475,10 @@
 }
 
 
-struct sccp_connections *bsc_mgcp_find_con(struct bsc_nat *nat, int endpoint)
+struct nat_sccp_connection *bsc_mgcp_find_con(struct bsc_nat *nat, int endpoint)
 {
-	struct sccp_connections *con = NULL;
-	struct sccp_connections *sccp;
+	struct nat_sccp_connection *con = NULL;
+	struct nat_sccp_connection *sccp;
 
 	llist_for_each_entry(sccp, &nat->sccp_connections, list_entry) {
 		if (sccp->msc_endp == -1)
@@ -501,7 +501,7 @@
 {
 	struct bsc_nat *nat;
 	struct bsc_endpoint *bsc_endp;
-	struct sccp_connections *sccp;
+	struct nat_sccp_connection *sccp;
 	struct mgcp_endpoint *mgcp_endp;
 	struct msgb *bsc_msg;
 
@@ -590,7 +590,7 @@
 
 	/* if a CRCX failed... send a DLCX down the stream */
 	if (bsc_endp->transaction_state == MGCP_ENDP_CRCX) {
-		struct sccp_connections *con;
+		struct nat_sccp_connection *con;
 		con = bsc_mgcp_find_con(bsc->nat, ENDPOINT_NUMBER(endp));
 		if (!con) {
 			LOGP(DMGCP, LOGL_ERROR,
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 76d6577..21f5287 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -200,7 +200,7 @@
 	bsc_send_data(bsc, id_req, sizeof(id_req), IPAC_PROTO_IPACCESS);
 }
 
-static struct msgb *nat_create_rlsd(struct sccp_connections *conn)
+static struct msgb *nat_create_rlsd(struct nat_sccp_connection *conn)
 {
 	struct sccp_connection_released *rel;
 	struct msgb *msg;
@@ -221,7 +221,7 @@
 	return msg;
 }
 
-static void nat_send_rlsd_ussd(struct bsc_nat *nat, struct sccp_connections *conn)
+static void nat_send_rlsd_ussd(struct bsc_nat *nat, struct nat_sccp_connection *conn)
 {
 	struct msgb *msg;
 
@@ -235,7 +235,7 @@
 	bsc_do_write(&nat->ussd_con->queue, msg, IPAC_PROTO_SCCP);
 }
 
-static void nat_send_rlsd_msc(struct sccp_connections *conn)
+static void nat_send_rlsd_msc(struct nat_sccp_connection *conn)
 {
 	struct msgb *msg;
 
@@ -247,7 +247,7 @@
 	queue_for_msc(conn->msc_con, msg);
 }
 
-static void nat_send_rlsd_bsc(struct sccp_connections *conn)
+static void nat_send_rlsd_bsc(struct nat_sccp_connection *conn)
 {
 	struct msgb *msg;
 	struct sccp_connection_released *rel;
@@ -268,7 +268,7 @@
 	bsc_write(conn->bsc, msg, IPAC_PROTO_SCCP);
 }
 
-static struct msgb *nat_creat_clrc(struct sccp_connections *conn, uint8_t cause)
+static struct msgb *nat_creat_clrc(struct nat_sccp_connection *conn, uint8_t cause)
 {
 	struct msgb *msg;
 	struct msgb *sccp;
@@ -290,7 +290,7 @@
 	return sccp;
 }
 
-static int nat_send_clrc_bsc(struct sccp_connections *conn)
+static int nat_send_clrc_bsc(struct nat_sccp_connection *conn)
 {
 	struct msgb *sccp;
 
@@ -423,7 +423,7 @@
  *  2.1) Depending on the con type reject the service, or just close it
  */
 static void bsc_send_con_release(struct bsc_connection *bsc,
-		struct sccp_connections *con,
+		struct nat_sccp_connection *con,
 		struct bsc_nat_reject_cause *cause)
 {
 	struct msgb *rlsd;
@@ -496,7 +496,7 @@
 	 */
 	if (payload) {
 		struct msgb *cc, *udt, *clear, *rlsd;
-		struct sccp_connections *con;
+		struct nat_sccp_connection *con;
 		con = create_sccp_src_ref(bsc, parsed);
 		if (!con)
 			goto send_refuse;
@@ -612,7 +612,7 @@
  * Update the auth status. This can be either a CIPHER MODE COMAMND or
  * a CM Serivce Accept. Maybe also LU Accept or such in the future.
  */
-static void update_con_authorize(struct sccp_connections *con,
+static void update_con_authorize(struct nat_sccp_connection *con,
 				 struct bsc_nat_parsed *parsed,
 				 struct msgb *msg)
 {
@@ -642,7 +642,7 @@
 
 static int forward_sccp_to_bts(struct bsc_msc_connection *msc_con, struct msgb *msg)
 {
-	struct sccp_connections *con = NULL;
+	struct nat_sccp_connection *con = NULL;
 	struct bsc_connection *bsc;
 	struct bsc_nat_parsed *parsed;
 	int proto;
@@ -862,7 +862,7 @@
  */
 void bsc_close_connection(struct bsc_connection *connection)
 {
-	struct sccp_connections *sccp_patch, *tmp;
+	struct nat_sccp_connection *sccp_patch, *tmp;
 	struct bsc_cmd_list *cmd_entry, *cmd_tmp;
 	struct rate_ctr *ctr = NULL;
 
@@ -912,7 +912,7 @@
 
 static void bsc_maybe_close(struct bsc_connection *bsc)
 {
-	struct sccp_connections *sccp;
+	struct nat_sccp_connection *sccp;
 	if (!bsc->nat->blocked)
 		return;
 
@@ -987,7 +987,7 @@
 	     bsc->write_queue.bfd.fd);
 }
 
-static void handle_con_stats(struct sccp_connections *con)
+static void handle_con_stats(struct nat_sccp_connection *con)
 {
 	struct rate_ctr_group *ctrg;
 	int id = bsc_conn_type_to_ctr(con);
@@ -1038,7 +1038,7 @@
 	/* modify the SCCP entries */
 	if (parsed->ipa_proto == IPAC_PROTO_SCCP) {
 		int filter;
-		struct sccp_connections *con;
+		struct nat_sccp_connection *con;
 		switch (parsed->sccp_type) {
 		case SCCP_MSG_TYPE_CR:
 			memset(&cause, 0, sizeof(cause));
@@ -1433,7 +1433,7 @@
 {
 	int destroyed = 0;
 	struct bsc_connection *bsc, *bsc_tmp;
-	struct sccp_connections *conn, *tmp1;
+	struct nat_sccp_connection *conn, *tmp1;
 	struct timespec now;
 	clock_gettime(CLOCK_MONOTONIC, &now);
 
@@ -1595,7 +1595,7 @@
 /* Close all connections handed out to the USSD module */
 int bsc_close_ussd_connections(struct bsc_nat *nat)
 {
-	struct sccp_connections *con;
+	struct nat_sccp_connection *con;
 	llist_for_each_entry(con, &nat->sccp_connections, list_entry) {
 		if (con->con_local != NAT_CON_END_USSD)
 			continue;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_filter.c b/openbsc/src/osmo-bsc_nat/bsc_nat_filter.c
index 5ab3a97..8ccc262 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_filter.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_filter.c
@@ -290,7 +290,7 @@
 
 static int _dt_check_id_resp(struct bsc_connection *bsc,
 			     uint8_t *data, unsigned int length,
-			     struct sccp_connections *con,
+			     struct nat_sccp_connection *con,
 			     struct bsc_nat_reject_cause *cause)
 {
 	char mi_string[GSM48_MI_SIZE];
@@ -404,7 +404,7 @@
 }
 
 int bsc_nat_filter_dt(struct bsc_connection *bsc, struct msgb *msg,
-		struct sccp_connections *con, struct bsc_nat_parsed *parsed,
+		struct nat_sccp_connection *con, struct bsc_nat_parsed *parsed,
 		struct bsc_nat_reject_cause *cause)
 {
 	uint32_t len;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c
index 2e6d9a3..b4c87d0 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c
@@ -271,7 +271,7 @@
 	return 0;
 }
 
-void sccp_connection_destroy(struct sccp_connections *conn)
+void sccp_connection_destroy(struct nat_sccp_connection *conn)
 {
 	LOGP(DNAT, LOGL_DEBUG, "Destroy 0x%x <-> 0x%x mapping for con %p\n",
 	     sccp_src_ref_to_int(&conn->real_ref),
@@ -486,7 +486,7 @@
 	[NAT_CON_TYPE_OTHER]		= BCFG_CTR_CON_OTHER,
 };
 
-int bsc_conn_type_to_ctr(struct sccp_connections *conn)
+int bsc_conn_type_to_ctr(struct nat_sccp_connection *conn)
 {
 	return con_to_ctr[conn->con_type];
 }
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
index e5993b4..46dc38e 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
@@ -178,7 +178,7 @@
       SHOW_STR "Display information about SCCP\n"
       "All active connections\n")
 {
-	struct sccp_connections *con;
+	struct nat_sccp_connection *con;
 	vty_out(vty, "Listing all open SCCP connections%s", VTY_NEWLINE);
 
 	llist_for_each_entry(con, &_nat->sccp_connections, list_entry) {
diff --git a/openbsc/src/osmo-bsc_nat/bsc_sccp.c b/openbsc/src/osmo-bsc_nat/bsc_sccp.c
index de6b421..25c13d4 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_sccp.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_sccp.c
@@ -42,7 +42,7 @@
 /* check if we are using this ref for patched already */
 static int sccp_ref_is_free(struct sccp_source_reference *ref, struct bsc_nat *nat)
 {
-	struct sccp_connections *conn;
+	struct nat_sccp_connection *conn;
 
 	llist_for_each_entry(conn, &nat->sccp_connections, list_entry) {
 		if (memcmp(ref, &conn->patched_ref, sizeof(*ref)) == 0)
@@ -82,10 +82,10 @@
 	return -1;
 }
 
-struct sccp_connections *create_sccp_src_ref(struct bsc_connection *bsc,
+struct nat_sccp_connection *create_sccp_src_ref(struct bsc_connection *bsc,
 					     struct bsc_nat_parsed *parsed)
 {
-	struct sccp_connections *conn;
+	struct nat_sccp_connection *conn;
 
 	/* Some commercial BSCs like to reassign there SRC ref */
 	llist_for_each_entry(conn, &bsc->nat->sccp_connections, list_entry) {
@@ -111,7 +111,7 @@
 	}
 
 
-	conn = talloc_zero(bsc->nat, struct sccp_connections);
+	conn = talloc_zero(bsc->nat, struct nat_sccp_connection);
 	if (!conn) {
 		LOGP(DNAT, LOGL_ERROR, "Memory allocation failure.\n");
 		return NULL;
@@ -138,7 +138,7 @@
 	return conn;
 }
 
-int update_sccp_src_ref(struct sccp_connections *sccp, struct bsc_nat_parsed *parsed)
+int update_sccp_src_ref(struct nat_sccp_connection *sccp, struct bsc_nat_parsed *parsed)
 {
 	if (!parsed->dest_local_ref || !parsed->src_local_ref) {
 		LOGP(DNAT, LOGL_ERROR, "CC MSG should contain both local and dest address.\n");
@@ -156,7 +156,7 @@
 
 void remove_sccp_src_ref(struct bsc_connection *bsc, struct msgb *msg, struct bsc_nat_parsed *parsed)
 {
-	struct sccp_connections *conn;
+	struct nat_sccp_connection *conn;
 
 	llist_for_each_entry(conn, &bsc->nat->sccp_connections, list_entry) {
 		if (memcmp(parsed->src_local_ref,
@@ -176,11 +176,11 @@
  * an address that was assigned by the MUX, we need to update the
  * dest reference to the real network.
  */
-struct sccp_connections *patch_sccp_src_ref_to_bsc(struct msgb *msg,
+struct nat_sccp_connection *patch_sccp_src_ref_to_bsc(struct msgb *msg,
 						   struct bsc_nat_parsed *parsed,
 						   struct bsc_nat *nat)
 {
-	struct sccp_connections *conn;
+	struct nat_sccp_connection *conn;
 
 	if (!parsed->dest_local_ref) {
 		LOGP(DNAT, LOGL_ERROR, "MSG should contain dest_local_ref.\n");
@@ -208,11 +208,11 @@
  * in all other cases we need to work by the destination local
  * reference..
  */
-struct sccp_connections *patch_sccp_src_ref_to_msc(struct msgb *msg,
+struct nat_sccp_connection *patch_sccp_src_ref_to_msc(struct msgb *msg,
 						   struct bsc_nat_parsed *parsed,
 						   struct bsc_connection *bsc)
 {
-	struct sccp_connections *conn;
+	struct nat_sccp_connection *conn;
 
 	llist_for_each_entry(conn, &bsc->nat->sccp_connections, list_entry) {
 		if (conn->bsc != bsc)
@@ -235,10 +235,10 @@
 	return NULL;
 }
 
-struct sccp_connections *bsc_nat_find_con_by_bsc(struct bsc_nat *nat,
+struct nat_sccp_connection *bsc_nat_find_con_by_bsc(struct bsc_nat *nat,
 						 struct sccp_source_reference *ref)
 {
-	struct sccp_connections *conn;
+	struct nat_sccp_connection *conn;
 
 	llist_for_each_entry(conn, &nat->sccp_connections, list_entry) {
 		if (memcmp(ref, &conn->real_ref, sizeof(*ref)) == 0)
diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c
index 80d6e77..f6dbef2 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c
@@ -68,7 +68,7 @@
 
 static int forward_sccp(struct bsc_nat *nat, struct msgb *msg)
 {
-	struct sccp_connections *con;
+	struct nat_sccp_connection *con;
 	struct bsc_nat_parsed *parsed;
 
 
@@ -255,7 +255,7 @@
 			 ntohl(addr.s_addr), 5001, 0, ussd_listen_cb, nat);
 }
 
-static int forward_ussd_simple(struct sccp_connections *con, struct msgb *input)
+static int forward_ussd_simple(struct nat_sccp_connection *con, struct msgb *input)
 {
 	struct msgb *copy;
 	struct bsc_nat_ussd_con *ussd;
@@ -279,7 +279,7 @@
 	return 0;
 }
 
-static int forward_ussd(struct sccp_connections *con, const struct ussd_request *req,
+static int forward_ussd(struct nat_sccp_connection *con, const struct ussd_request *req,
 			struct msgb *input)
 {
 	struct msgb *msg, *copy;
@@ -323,7 +323,7 @@
 	return 0;
 }
 
-int bsc_check_ussd(struct sccp_connections *con, struct bsc_nat_parsed *parsed,
+int bsc_check_ussd(struct nat_sccp_connection *con, struct bsc_nat_parsed *parsed,
 		   struct msgb *msg)
 {
 	uint32_t len;