aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_nat_vty.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-08 10:35:20 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 20:24:13 +0800
commit870663af206b3844d7435297321bbffaeb0c58d2 (patch)
tree6a08ee4a00bd5ffa0619416532e7c1fcc30014d5 /openbsc/src/nat/bsc_nat_vty.c
parent02aee149f6cb3f314988a5dc7a041fdcb33c78bd (diff)
nat: Print the IP address of the connected BSCs
Diffstat (limited to 'openbsc/src/nat/bsc_nat_vty.c')
-rw-r--r--openbsc/src/nat/bsc_nat_vty.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c
index 4c60a19f7..7e404672c 100644
--- a/openbsc/src/nat/bsc_nat_vty.c
+++ b/openbsc/src/nat/bsc_nat_vty.c
@@ -92,11 +92,16 @@ DEFUN(show_bsc, show_bsc_cmd, "show connections bsc",
SHOW_STR "Display information about current BSCs")
{
struct bsc_connection *con;
+ struct sockaddr_in sock;
+ socklen_t len = sizeof(sock);
+
llist_for_each_entry(con, &_nat->bsc_connections, list_entry) {
- vty_out(vty, "BSC lac: %d, %d auth: %d fd: %d%s",
+ getpeername(con->write_queue.bfd.fd, (struct sockaddr *) &sock, &len);
+ vty_out(vty, "BSC lac: %d, %d auth: %d fd: %d peername: %s%s",
con->cfg ? con->cfg->nr : -1,
con->cfg ? con->cfg->lac : -1,
- con->authenticated, con->write_queue.bfd.fd, VTY_NEWLINE);
+ con->authenticated, con->write_queue.bfd.fd,
+ inet_ntoa(sock.sin_addr), VTY_NEWLINE);
}
return CMD_SUCCESS;