diff options
author | Boian Bonev <bbonev@ipacct.com> | 2012-10-30 08:18:39 +0200 |
---|---|---|
committer | Boian Bonev <bbonev@ipacct.com> | 2012-10-30 08:18:39 +0200 |
commit | 9fc27002f6566f01bc68303ed8496ae0059601f4 (patch) | |
tree | 40bd2a54aa6445a9fbd9cba603c44ee90e211121 /mndp.c | |
parent | fcd2e8043815a9f5ccfb11786579e1563adfb889 (diff) | |
parent | 11b726cee17622304839279fdce47feb9b86f4f7 (diff) | |
download | MAC-Telnet-9fc27002f6566f01bc68303ed8496ae0059601f4.tar.gz MAC-Telnet-9fc27002f6566f01bc68303ed8496ae0059601f4.zip |
Merge branch 'master' of https://github.com/haakonnessjoen/MAC-Telnet
Diffstat (limited to 'mndp.c')
-rw-r--r-- | mndp.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -28,15 +28,26 @@ #define _(String) gettext (String) +/* This file is also used for the -l option in mactelnet */ +#ifndef FROM_MACTELNET + /* Protocol data direction, not used here, but obligatory for protocol.c */ unsigned char mt_direction_fromserver = 0; int main(int argc, char **argv) { +#else +int mndp(void) { +#endif int sock,result; int optval = 1; struct sockaddr_in si_me, si_remote; unsigned char buff[MT_PACKET_LEN]; +#ifdef FROM_MACTELNET + /* mactelnet.c has this set to 1 */ + mt_direction_fromserver = 0; +#endif + setlocale(LC_ALL, ""); bindtextdomain("mactelnet","/usr/share/locale"); textdomain("mactelnet"); @@ -77,6 +88,8 @@ int main(int argc, char **argv) { } } + printf("\n\E[1m%-17s %s\E[m\n", _("MAC-Address"), _("Identity (platform version hardware) uptime")); + while(1) { struct mt_mndp_info *packet; /* Wait for a UDP packet */ @@ -91,7 +104,7 @@ int main(int argc, char **argv) { if (packet != NULL) { /* Print it */ - printf(" %-17s %s", ether_ntoa((struct ether_addr *)packet->address), packet->identity); + printf("%-17s %s", ether_ntoa((struct ether_addr *)packet->address), packet->identity); if (packet->platform != NULL) { printf(" (%s %s %s)", packet->platform, packet->version, packet->hardware); } |