mirror of
https://github.com/status-im/miniupnp.git
synced 2025-02-22 02:38:07 +00:00
miniupnpd/testgetifaddr: display addr and mask
This commit is contained in:
parent
333c28a502
commit
d178b14fd3
@ -1,4 +1,4 @@
|
||||
/* $Id: testgetifaddr.c,v 1.6 2013/03/23 10:46:55 nanard Exp $ */
|
||||
/* $Id: testgetifaddr.c,v 1.7 2013/04/27 15:38:57 nanard Exp $ */
|
||||
/* MiniUPnP project
|
||||
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||
* (c) 2006-2013 Thomas Bernard
|
||||
@ -6,7 +6,10 @@
|
||||
* in the LICENCE file provided within the distribution */
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include "getifaddr.h"
|
||||
|
||||
#if defined(__sun)
|
||||
@ -29,5 +32,7 @@ int main(int argc, char * * argv) {
|
||||
return 1;
|
||||
}
|
||||
printf("Interface %s has IP address %s.\n", argv[1], str_addr);
|
||||
printf("addr=%s ", inet_ntoa(addr));
|
||||
printf("mask=%s\n", inet_ntoa(mask));
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user