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_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)