aboutsummaryrefslogtreecommitdiffstats
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-04-08 10:35:20 +0200
commit9e2e2e04d1dcb999fe60a0135e99f5e8bf24a59d (patch)
tree23fd278a58171933679ef9a2faedebd833ebef1c
parent2ab6db015321941f9e6216118a9cf1cf624ac21e (diff)
nat: Print the IP address of the connected BSCs
-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;