ESME: use osmo_sock_get_name() for logging
This allows us to drop single-use parameters from osmo_esme to facilitate further code changes.
Related: OS#5568
Change-Id: I34bd4c145b0f6287a323e2350808feb59f1d3187
diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c
index 4ba52fc..da66074 100644
--- a/src/libmsc/smpp_smsc.c
+++ b/src/libmsc/smpp_smsc.c
@@ -947,9 +947,6 @@
esme->wqueue.read_cb = esme_link_read_cb;
esme->wqueue.write_cb = esme_link_write_cb;
- esme->sa_len = OSMO_MIN(sizeof(esme->sa), s_len);
- memcpy(&esme->sa, s, esme->sa_len);
-
llist_add_tail(&esme->list, &smsc->esme_list);
return 0;
diff --git a/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h
index 257589e..76772a3 100644
--- a/src/libmsc/smpp_smsc.h
+++ b/src/libmsc/smpp_smsc.h
@@ -45,8 +45,6 @@
uint32_t own_seq_nr;
struct osmo_wqueue wqueue;
- struct sockaddr_storage sa;
- socklen_t sa_len;
enum esme_read_state read_state;
uint32_t read_len;
diff --git a/src/libmsc/smpp_vty.c b/src/libmsc/smpp_vty.c
index 31e2090..da260a8 100644
--- a/src/libmsc/smpp_vty.c
+++ b/src/libmsc/smpp_vty.c
@@ -30,6 +30,7 @@
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/utils.h>
+#include <osmocom/core/socket.h>
#include <osmocom/core/talloc.h>
#include <osmocom/msc/vty.h>
@@ -524,17 +525,10 @@
static void dump_one_esme(struct vty *vty, struct osmo_esme *esme)
{
- char host[128], serv[128];
-
- host[0] = 0;
- serv[0] = 0;
- getnameinfo((const struct sockaddr *) &esme->sa, esme->sa_len,
- host, sizeof(host), serv, sizeof(serv), NI_NUMERICSERV);
-
vty_out(vty, "ESME System ID: %s, Password: %s, SMPP Version %02x%s",
esme->system_id, esme->acl ? esme->acl->passwd : "",
esme->smpp_version, VTY_NEWLINE);
- vty_out(vty, " Connected from: %s:%s%s", host, serv, VTY_NEWLINE);
+ vty_out(vty, " Connection %s%s", osmo_sock_get_name(tall_vty_ctx, esme->wqueue.bfd.fd), VTY_NEWLINE);
if (esme->smsc->def_route == esme->acl)
vty_out(vty, " Is current default route%s", VTY_NEWLINE);
}