aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_nat/bsc_nat.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-09-02 13:07:45 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-09-03 15:02:46 +0200
commitc1a8687cb83fe7d8dade703587253765b83842ef (patch)
treeb12d9a9d81c59a84413dd1dc9a4a9411bc08e82a /openbsc/src/osmo-bsc_nat/bsc_nat.c
parent0df1ab97a2acfe272124634c9484883dd210070d (diff)
bsc_msc: Add a name field to the MSC Connection to differentiate links
Assign a static name to a MSC Connection and use it. In case there are multiple connections we can now more easily identify them. This is only used for the NAT right now, the BSC could start to name the various MSC connections too.
Diffstat (limited to 'openbsc/src/osmo-bsc_nat/bsc_nat.c')
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 2254a8d86..bbbeb0311 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -804,15 +804,21 @@ static int ipaccess_msc_read_cb(struct osmo_fd *bfd)
ret = ipa_msg_recv(bfd->fd, &msg);
if (ret <= 0) {
if (ret == 0)
- LOGP(DNAT, LOGL_FATAL, "The connection the MSC was lost, exiting\n");
+ LOGP(DNAT, LOGL_FATAL,
+ "The connection the MSC(%s) was lost, exiting\n",
+ msc_con->name);
else
- LOGP(DNAT, LOGL_ERROR, "Failed to parse ip access message: %d\n", ret);
+ LOGP(DNAT, LOGL_ERROR,
+ "Failed to parse ip access message on %s: %d\n",
+ msc_con->name, ret);
bsc_msc_lost(msc_con);
return -1;
}
- LOGP(DNAT, LOGL_DEBUG, "MSG from MSC: %s proto: %d\n", osmo_hexdump(msg->data, msg->len), msg->l2h[0]);
+ LOGP(DNAT, LOGL_DEBUG,
+ "MSG from MSC(%s): %s proto: %d\n", msc_con->name,
+ osmo_hexdump(msg->data, msg->len), msg->l2h[0]);
/* handle base message handling */
hh = (struct ipaccess_head *) msg->data;
@@ -1548,6 +1554,7 @@ int main(int argc, char **argv)
exit(1);
}
+ nat->msc_con->name = "main MSC";
nat->msc_con->connection_loss = msc_connection_was_lost;
nat->msc_con->connected = msc_connection_connected;
nat->msc_con->write_queue.read_cb = ipaccess_msc_read_cb;