Browse Source

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
changes/41/28841/5
Maxim Suraev 2 weeks ago committed by msuraev
parent
commit
1470d0b870
  1. 3
      src/libmsc/smpp_smsc.c
  2. 2
      src/libmsc/smpp_smsc.h
  3. 10
      src/libmsc/smpp_vty.c

3
src/libmsc/smpp_smsc.c

@ -947,9 +947,6 @@ static int link_accept_cb(struct smsc *smsc, int fd,
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;

2
src/libmsc/smpp_smsc.h

@ -45,8 +45,6 @@ struct osmo_esme {
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;

10
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 @@ DEFUN(cfg_esme_no_alert_notif, cfg_esme_no_alert_notif_cmd,
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);
}

Loading…
Cancel
Save