diff options
author | Håkon Nessjøen <haakon.nessjoen@gmail.com> | 2013-01-13 18:26:15 +0100 |
---|---|---|
committer | Håkon Nessjøen <haakon.nessjoen@gmail.com> | 2013-01-13 18:26:15 +0100 |
commit | dcb176155767156662c1177592016508376dadcd (patch) | |
tree | 449abe444d09284e9fedf64d164d3c898a6f9a4a | |
parent | 9c6a8fd84ff7dddf01d5e1b33a6a6d935816795b (diff) | |
download | MAC-Telnet-dcb176155767156662c1177592016508376dadcd.tar.gz MAC-Telnet-dcb176155767156662c1177592016508376dadcd.zip |
Added "batch-mode" output for mactelnet -l option. Added interface info to mndp packets.
-rw-r--r-- | mactelnet.c | 11 | ||||
-rw-r--r-- | mactelnetd.c | 1 | ||||
-rw-r--r-- | mndp.c | 21 | ||||
-rw-r--r-- | mndp.h | 2 | ||||
-rw-r--r-- | po/mactelnet.pot | 128 | ||||
-rw-r--r-- | po/nb.po | 141 | ||||
-rw-r--r-- | protocol.h | 4 |
7 files changed, 172 insertions, 136 deletions
diff --git a/mactelnet.c b/mactelnet.c index 51d9df1..9ea06b4 100644 --- a/mactelnet.c +++ b/mactelnet.c @@ -74,6 +74,7 @@ static int mndp_timeout = 0; static int is_a_tty = 1; static int quiet_mode = 0; +static int batch_mode = 0; static int keepalive_counter = 0; @@ -438,7 +439,7 @@ int main (int argc, char **argv) { textdomain("mactelnet"); while (1) { - c = getopt(argc, argv, "lnqt:u:p:U:vh?"); + c = getopt(argc, argv, "lnqt:u:p:U:vh?B"); if (c == -1) { break; @@ -489,6 +490,9 @@ int main (int argc, char **argv) { run_mndp = 1; break; + case 'B': + batch_mode = 1; + case 'h': case '?': print_help = 1; @@ -497,7 +501,7 @@ int main (int argc, char **argv) { } } if (run_mndp) { - return mndp(mndp_timeout); + return mndp(mndp_timeout, batch_mode); } if (argc - optind < 1 || print_help) { print_version(); @@ -509,7 +513,8 @@ int main (int argc, char **argv) { " discover it.\n" " identity The identity/name of your destination device. Uses\n" " MNDP protocol to find it.\n" - " -l List/Search for routers nearby. (using MNDP)\n" + " -l List/Search for routers nearby (MNDP). You may use -t to set timeout.\n" + " -B Batch mode. Use computer readable output (CSV), for use with -l.\n" " -n Do not use broadcast packets. Less insecure but requires\n" " root privileges.\n" " -t <timeout> Amount of seconds to wait for a response on each interface.\n" diff --git a/mactelnetd.c b/mactelnetd.c index 2c31e90..cdb2727 100644 --- a/mactelnetd.c +++ b/mactelnetd.c @@ -804,6 +804,7 @@ void mndp_broadcast() { mndp_add_attribute(&pdata, MT_MNDPTYPE_HARDWARE, s_uname.machine, strlen(s_uname.machine)); mndp_add_attribute(&pdata, MT_MNDPTYPE_TIMESTAMP, &uptime, 4); mndp_add_attribute(&pdata, MT_MNDPTYPE_SOFTID, MT_SOFTID_MACTELNET, strlen(MT_SOFTID_MACTELNET)); + mndp_add_attribute(&pdata, MT_MNDPTYPE_IFNAME, interface->name, strlen(interface->name)); header->cksum = in_cksum((unsigned short *)&(pdata.data), pdata.size); send_special_udp(interface, MT_MNDP_PORT, &pdata); @@ -37,6 +37,7 @@ unsigned char mt_direction_fromserver = 0; int main(int argc, char **argv) { + int batch_mode = 0; #else void sig_alarm(int signo) @@ -44,7 +45,7 @@ void sig_alarm(int signo) exit(0); } -int mndp(int timeout) { +int mndp(int timeout, int batch_mode) { #endif int sock,result; int optval = 1; @@ -97,8 +98,11 @@ int mndp(int timeout) { } } - printf("\n\E[1m%-17s %s\E[m\n", _("MAC-Address"), _("Identity (platform version hardware) uptime")); - + if (batch_mode) { + printf("%s\n", _("MAC-Address,Identity,Platform,Version,Hardware,Uptime,Softid,Ifname")); + } else { + printf("\n\E[1m%-17s %s\E[m\n", _("MAC-Address"), _("Identity (platform version hardware) uptime")); + } #ifdef FROM_MACTELNET if (timeout > 0) { alarm(timeout); @@ -117,7 +121,7 @@ int mndp(int timeout) { /* Parse MNDP packet */ packet = parse_mndp(buff, result); - if (packet != NULL) { + if (packet != NULL && !batch_mode) { /* Print it */ printf("%-17s %s", ether_ntoa((struct ether_addr *)packet->address), packet->identity); if (packet->platform != NULL) { @@ -129,6 +133,15 @@ int mndp(int timeout) { if (packet->softid != NULL) { printf(" %s", packet->softid); } + if (packet->ifname != NULL) { + printf(" %s", packet->ifname); + } + putchar('\n'); + } else if (packet != NULL) { + /* Print it */ + printf("'%s','%s',", ether_ntoa((struct ether_addr *)packet->address), packet->identity); + printf("'%s','%s','%s',", packet->platform, packet->version, packet->hardware); + printf("'%d','%s','%s'", packet->uptime, packet->softid, packet->ifname); putchar('\n'); } } @@ -1,6 +1,6 @@ #ifndef _MNDP_H #define _MNDP_H -int mndp(int timeout); +int mndp(int timeout, int batch_mode); #endif diff --git a/po/mactelnet.pot b/po/mactelnet.pot index 22a579c..311c386 100644 --- a/po/mactelnet.pot +++ b/po/mactelnet.pot @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: mactelnet\n" "Report-Msgid-Bugs-To: haakon.nessjoen@gmail.com\n" -"POT-Creation-Date: 2012-07-17 21:29+0200\n" +"POT-Creation-Date: 2013-01-13 17:53+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" @@ -62,12 +61,12 @@ msgstr "" msgid "Packet size must be between 18 and %d\n" msgstr "" -#: macping.c:179 mactelnetd.c:940 +#: macping.c:179 mactelnetd.c:954 #, c-format msgid "You need to have root privileges to use %s.\n" msgstr "" -#: macping.c:207 mndp.c:68 protocol.c:429 +#: macping.c:207 mndp.c:78 protocol.c:429 #, c-format msgid "Error binding to %s:%d\n" msgstr "" @@ -92,58 +91,58 @@ msgstr "" msgid "%s Reply of %d bytes of unequal data\n" msgstr "" -#: mactelnet.c:100 +#: mactelnet.c:104 #, c-format msgid "" "Failed dropping privileges. The user %s is not a valid username on local " "system.\n" msgstr "" -#: mactelnet.c:106 +#: mactelnet.c:110 #, c-format msgid "setgid: Error dropping group privileges\n" msgstr "" -#: mactelnet.c:110 +#: mactelnet.c:114 #, c-format msgid "setuid: Error dropping user privileges\n" msgstr "" -#: mactelnet.c:115 +#: mactelnet.c:119 #, c-format msgid "Failed to drop privileges\n" msgstr "" -#: mactelnet.c:181 +#: mactelnet.c:185 #, c-format msgid "" "\n" "Connection timed out\n" msgstr "" -#: mactelnet.c:330 +#: mactelnet.c:339 #, c-format msgid "Connection closed.\n" msgstr "" -#: mactelnet.c:336 +#: mactelnet.c:345 #, c-format msgid "Unhandeled packet type: %d received from server %s\n" msgstr "" -#: mactelnet.c:358 +#: mactelnet.c:367 #, c-format msgid "Error: No suitable devices found\n" msgstr "" -#: mactelnet.c:498 +#: mactelnet.c:517 #, c-format msgid "" "Usage: %s <MAC|identity> [-h] [-n] [-t <timeout>] [-u <user>] [-p " "<password>] [-U <user>] | -l\n" msgstr "" -#: mactelnet.c:501 +#: mactelnet.c:520 #, c-format msgid "" "\n" @@ -152,7 +151,10 @@ msgid "" " discover it.\n" " identity The identity/name of your destination device. Uses\n" " MNDP protocol to find it.\n" -" -l List/Search for routers nearby. (using MNDP)\n" +" -l List/Search for routers nearby (MNDP). You may use -t to " +"set timeout.\n" +" -B Batch mode. Use computer readable output (CSV), for use " +"with -l.\n" " -n Do not use broadcast packets. Less insecure but requires\n" " root privileges.\n" " -t <timeout> Amount of seconds to wait for a response on each " @@ -166,156 +168,156 @@ msgid "" "\n" msgstr "" -#: mactelnet.c:531 +#: mactelnet.c:551 #, c-format msgid "You need to have root privileges to use the -n parameter.\n" msgstr "" -#: mactelnet.c:541 +#: mactelnet.c:561 #, c-format msgid "The -U option must be used in conjunction with the -n parameter.\n" msgstr "" -#: mactelnet.c:570 +#: mactelnet.c:590 #, c-format msgid "Login: " msgstr "" -#: mactelnet.c:577 +#: mactelnet.c:597 msgid "Password: " msgstr "" -#: mactelnet.c:602 +#: mactelnet.c:625 #, c-format msgid "Connecting to %s..." msgstr "" -#: mactelnet.c:612 mactelnetd.c:244 mactelnetd.c:981 +#: mactelnet.c:635 mactelnetd.c:245 mactelnetd.c:995 #, c-format msgid "Error binding to %s:%d, %s\n" msgstr "" -#: mactelnet.c:617 +#: mactelnet.c:640 #, c-format msgid "Connection failed.\n" msgstr "" -#: mactelnet.c:621 +#: mactelnet.c:644 #, c-format msgid "done\n" msgstr "" -#: mactelnetd.c:249 +#: mactelnetd.c:250 #, c-format msgid "Listening on %s for %s\n" msgstr "" -#: mactelnetd.c:409 +#: mactelnetd.c:418 #, c-format msgid "(%d) Invalid login by %s." msgstr "" #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:412 +#: mactelnetd.c:421 msgid "Login failed, incorrect username or password\r\n" msgstr "" #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:429 +#: mactelnetd.c:438 msgid "Terminal error\r\n" msgstr "" -#: mactelnetd.c:440 +#: mactelnetd.c:449 #, c-format msgid "(%d) Login ok, but local user not accessible (%s)." msgstr "" #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:442 +#: mactelnetd.c:451 msgid "Local user not accessible\r\n" msgstr "" -#: mactelnetd.c:451 +#: mactelnetd.c:460 #, c-format msgid "Error opening %s: %s" msgstr "" #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:453 +#: mactelnetd.c:462 msgid "Error opening terminal\r\n" msgstr "" -#: mactelnetd.c:464 +#: mactelnetd.c:473 #, c-format msgid "(%d) User %s logged in." msgstr "" -#: mactelnetd.c:502 +#: mactelnetd.c:511 #, c-format msgid "(%d) Could not log in %s (%d:%d): setuid/setgid: %s" msgstr "" #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:504 +#: mactelnetd.c:513 msgid "Internal error\r\n" msgstr "" -#: mactelnetd.c:510 +#: mactelnetd.c:519 #, c-format msgid "(%d) User %s disconnected with " msgstr "" -#: mactelnetd.c:603 +#: mactelnetd.c:615 #, c-format msgid "(%d) Unhandeled control packet type: %d" msgstr "" -#: mactelnetd.c:649 +#: mactelnetd.c:661 #, c-format msgid "(%d) New connection from %s." msgstr "" -#: mactelnetd.c:677 mactelnetd.c:1111 +#: mactelnetd.c:689 mactelnetd.c:1125 #, c-format msgid "(%d) Connection closed." msgstr "" -#: mactelnetd.c:723 +#: mactelnetd.c:735 #, c-format msgid "(%d) Unhandeled packet type: %d" msgstr "" #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:816 +#: mactelnetd.c:830 msgid "" "\r\n" "\r\n" "Daemon shutting down.\r\n" msgstr "" -#: mactelnetd.c:818 +#: mactelnetd.c:832 msgid "Daemon shutting down" msgstr "" -#: mactelnetd.c:849 +#: mactelnetd.c:863 msgid "SIGHUP: Reloading interfaces" msgstr "" -#: mactelnetd.c:860 +#: mactelnetd.c:874 msgid "No devices found! Exiting.\n" msgstr "" -#: mactelnetd.c:874 +#: mactelnetd.c:888 #, c-format msgid "(%d) Connection closed because interface %s is gone." msgstr "" -#: mactelnetd.c:927 +#: mactelnetd.c:941 #, c-format msgid "Usage: %s [-f|-n|-h]\n" msgstr "" -#: mactelnetd.c:930 +#: mactelnetd.c:944 #, c-format msgid "" "\n" @@ -326,71 +328,75 @@ msgid "" "\n" msgstr "" -#: mactelnetd.c:1003 +#: mactelnetd.c:1017 #, c-format msgid "MNDP: Error binding to %s:%d, %s\n" msgstr "" -#: mactelnetd.c:1007 +#: mactelnetd.c:1021 #, c-format msgid "Bound to %s:%d" msgstr "" -#: mactelnetd.c:1033 +#: mactelnetd.c:1047 msgid "Unable to find any valid network interfaces\n" msgstr "" -#: mactelnetd.c:1109 +#: mactelnetd.c:1123 #, c-format msgid "(%d) Connection to user %s closed." msgstr "" -#: mactelnetd.c:1119 +#: mactelnetd.c:1133 #, c-format msgid "(%d) Waiting for ack\n" msgstr "" -#: mactelnetd.c:1135 +#: mactelnetd.c:1149 #, c-format msgid "(%d) Session timed out" msgstr "" #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:1138 +#: mactelnetd.c:1152 msgid "Timeout\r\n" msgstr "" -#: mndp.c:73 +#: mndp.c:83 #, c-format msgid "Searching for MikroTik routers... Abort with CTRL+C.\n" msgstr "" -#: mndp.c:77 +#: mndp.c:87 #, c-format msgid "Unable to send broadcast packets: Operating in receive only mode.\n" msgstr "" -#: mndp.c:87 +#: mndp.c:97 #, c-format msgid "Unable to send broadcast packet: Operating in receive only mode.\n" msgstr "" -#: mndp.c:91 +#: mndp.c:102 +msgid "MAC-Address,Identity,Platform,Version,Hardware,Uptime,Softid,Ifname" +msgstr "" + +#: mndp.c:104 msgid "MAC-Address" msgstr "" -#: mndp.c:91 +#: mndp.c:104 msgid "Identity (platform version hardware) uptime" msgstr "" -#: mndp.c:98 +#: mndp.c:117 #, c-format msgid "An error occured. aborting\n" msgstr "" -#: mndp.c:112 +#: mndp.c:131 #, c-format -msgid " up %d days %d hours" +msgid " up %d days %d hours" msgstr "" #: protocol.c:84 protocol.c:148 @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# Copyright (C) 2013 Håkon Nessjøen +# This file is distributed under the same license as the mactelnet package. +# Håkon Nessjøen <haakon.nessjoen@gmail.com>, 2013 # msgid "" msgstr "" "Project-Id-Version: mactelnet\n" "Report-Msgid-Bugs-To: haakon.nessjoen@gmail.com\n" -"POT-Creation-Date: 2012-07-17 21:29+0200\n" -"PO-Revision-Date: 2012-09-23 00:08+0100\n" +"POT-Creation-Date: 2013-01-13 17:53+0100\n" +"PO-Revision-Date: 2013-01-13 18:15+0100\n" "Last-Translator: Håkon Nessjøen <haakon.nessjoen@gmail.com>\n" "Language-Team: Håkon Nessjøen <haakon.nessjoen@gmail.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.3\n" +"X-Generator: vim\n" "Language: nb\n" "X-Poedit-SourceCharset: UTF-8\n" @@ -71,12 +71,12 @@ msgstr "" msgid "Packet size must be between 18 and %d\n" msgstr "Pakkestørrelse må være mellom 18 og %d\n" -#: macping.c:179 mactelnetd.c:940 +#: macping.c:179 mactelnetd.c:954 #, c-format msgid "You need to have root privileges to use %s.\n" msgstr "Du trenger superbruker-rettigheter for å bruke %s.\n" -#: macping.c:207 mndp.c:68 protocol.c:429 +#: macping.c:207 mndp.c:78 protocol.c:429 #, c-format msgid "Error binding to %s:%d\n" msgstr "Klarte ikke binde mot %s:%d\n" @@ -101,7 +101,7 @@ msgstr "%s %d byte, ping tid %.2f ms%s\n" msgid "%s Reply of %d bytes of unequal data\n" msgstr "%s Retur av %d byter med usammensvarende data\n" -#: mactelnet.c:100 +#: mactelnet.c:104 #, c-format msgid "" "Failed dropping privileges. The user %s is not a valid username on local " @@ -110,22 +110,22 @@ msgstr "" "Klarte ikke droppe privilegier. Brukernavnet %s er ikke gyldig på det lokale " "systemet.\n" -#: mactelnet.c:106 +#: mactelnet.c:110 #, c-format msgid "setgid: Error dropping group privileges\n" msgstr "setgid: Klarte ikke droppe gruppeprivilegier\n" -#: mactelnet.c:110 +#: mactelnet.c:114 #, c-format msgid "setuid: Error dropping user privileges\n" msgstr "setud: Klarte ikke droppe brukerprivilegier\n" -#: mactelnet.c:115 +#: mactelnet.c:119 #, c-format msgid "Failed to drop privileges\n" msgstr "Klarte ikke droppe privilegier\n" -#: mactelnet.c:181 +#: mactelnet.c:185 #, c-format msgid "" "\n" @@ -134,22 +134,22 @@ msgstr "" "\n" "Tilkoblingen fikk tidsavbrudd\n" -#: mactelnet.c:330 +#: mactelnet.c:339 #, c-format msgid "Connection closed.\n" msgstr "Tilkoblingen ble stengt.\n" -#: mactelnet.c:336 +#: mactelnet.c:345 #, c-format msgid "Unhandeled packet type: %d received from server %s\n" msgstr "Uhåndtert pakketype: %d mottatt fra server %s\n" -#: mactelnet.c:358 +#: mactelnet.c:367 #, c-format msgid "Error: No suitable devices found\n" msgstr "Feil: Ingen brukbare enheter funnet\n" -#: mactelnet.c:498 +#: mactelnet.c:517 #, c-format msgid "" "Usage: %s <MAC|identity> [-h] [-n] [-t <timeout>] [-u <user>] [-p " @@ -158,7 +158,7 @@ msgstr "" "Bruksmåte: %s <MAC|identitet> [-h] [-n] [-t <tidsbegrensning>] [-u " "<brukernavn>] [-p <passord>] [-U <brukernavn>] | -l\n" -#: mactelnet.c:501 +#: mactelnet.c:520 #, c-format msgid "" "\n" @@ -167,7 +167,10 @@ msgid "" " discover it.\n" " identity The identity/name of your destination device. Uses\n" " MNDP protocol to find it.\n" -" -l List/Search for routers nearby. (using MNDP)\n" +" -l List/Search for routers nearby (MNDP). You may use -t to " +"set timeout.\n" +" -B Batch mode. Use computer readable output (CSV), for use " +"with -l.\n" " -n Do not use broadcast packets. Less insecure but requires\n" " root privileges.\n" " -t <timeout> Amount of seconds to wait for a response on each " @@ -187,7 +190,9 @@ msgstr "" " å finne den.\n" " identitet Identiteten til enheten. Bruker MNDP protokollen\n" " til å finne den.\n" -" -l List/Søk etter routere i nærheten. (ved å bruke MNDP)\n" +" -l List/Søk etter routere i nærheten (bruker MNDP). Du kan \n" +" bruke -t til å sette timeout.\n" +" -B Batch modus. Gir datamaskin-lesbar info for data fra -l.\n" " -n Ikke bruk broadcast pakker. Mindre usikkert, men bruker\n" " root privilegier.\n" " -t <tidsbegr.> Antall sekunder å vente for respons på hvert grensesnitt.\n" @@ -199,127 +204,127 @@ msgstr "" " -h Denne hjelpen.\n" "\n" -#: mactelnet.c:531 +#: mactelnet.c:551 #, c-format msgid "You need to have root privileges to use the -n parameter.\n" msgstr "Du trenger root privilegier for å bruke -n parameteren.\n" -#: mactelnet.c:541 +#: mactelnet.c:561 #, c-format msgid "The -U option must be used in conjunction with the -n parameter.\n" msgstr "-U parameteren må brukes i forbindelse med -n parameteren.\n" -#: mactelnet.c:570 +#: mactelnet.c:590 #, c-format msgid "Login: " msgstr "Bruker: " -#: mactelnet.c:577 +#: mactelnet.c:597 msgid "Password: " msgstr "Passord: " -#: mactelnet.c:602 +#: mactelnet.c:625 #, c-format msgid "Connecting to %s..." msgstr "Kobler til %s…" -#: mactelnet.c:612 mactelnetd.c:244 mactelnetd.c:981 +#: mactelnet.c:635 mactelnetd.c:245 mactelnetd.c:995 #, c-format msgid "Error binding to %s:%d, %s\n" msgstr "Problemer med å binde til %s:%d, %s\n" -#: mactelnet.c:617 +#: mactelnet.c:640 #, c-format msgid "Connection failed.\n" msgstr "Tilkobling feilet.\n" -#: mactelnet.c:621 +#: mactelnet.c:644 #, c-format msgid "done\n" msgstr "ferdig\n" -#: mactelnetd.c:249 +#: mactelnetd.c:250 #, c-format msgid "Listening on %s for %s\n" msgstr "Lytter på %s for %s\n" -#: mactelnetd.c:409 +#: mactelnetd.c:418 #, c-format msgid "(%d) Invalid login by %s." msgstr "(%d) Ugyldig login av %s." #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:412 +#: mactelnetd.c:421 msgid "Login failed, incorrect username or password\r\n" msgstr "Login feilet, ugyldig brukernavn eller passord\r\n" #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:429 +#: mactelnetd.c:438 msgid "Terminal error\r\n" msgstr "Terminalfeil\r\n" -#: mactelnetd.c:440 +#: mactelnetd.c:449 #, c-format msgid "(%d) Login ok, but local user not accessible (%s)." msgstr "(%d) Login ok, men lokal bruker er ikke tilgjengelig (%s)." #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:442 +#: mactelnetd.c:451 msgid "Local user not accessible\r\n" msgstr "Lokal bruker er ikke tilgjengelig\r\n" -#: mactelnetd.c:451 +#: mactelnetd.c:460 #, c-format msgid "Error opening %s: %s" msgstr "Klarer ikke åpne %s: %s" #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:453 +#: mactelnetd.c:462 msgid "Error opening terminal\r\n" msgstr "Klarer ikke åpne terminal\r\n" -#: mactelnetd.c:464 +#: mactelnetd.c:473 #, c-format msgid "(%d) User %s logged in." msgstr "(%d) Bruker %s logget inn." -#: mactelnetd.c:502 +#: mactelnetd.c:511 #, c-format msgid "(%d) Could not log in %s (%d:%d): setuid/setgid: %s" msgstr "(%d) Kunne ikke logge inn %s (%d:%d): setuid/setgid: %s" #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:504 +#: mactelnetd.c:513 msgid "Internal error\r\n" msgstr "Intern feil\r\n" -#: mactelnetd.c:510 +#: mactelnetd.c:519 #, c-format msgid "(%d) User %s disconnected with " msgstr "(%d) Bruker %s frakoblet med " -#: mactelnetd.c:603 +#: mactelnetd.c:615 #, c-format msgid "(%d) Unhandeled control packet type: %d" msgstr "(%d) Uhåndtert kontrollpakke-type: %d" -#: mactelnetd.c:649 +#: mactelnetd.c:661 #, c-format msgid "(%d) New connection from %s." msgstr "(%d) Ny tilkobling fra %s." -#: mactelnetd.c:677 mactelnetd.c:1111 +#: mactelnetd.c:689 mactelnetd.c:1125 #, c-format msgid "(%d) Connection closed." msgstr "(%d) Tilkobling lukket." -#: mactelnetd.c:723 +#: mactelnetd.c:735 #, c-format msgid "(%d) Unhandeled packet type: %d" msgstr "(%d) Uhåndtert pakke-type: %d" #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:816 +#: mactelnetd.c:830 msgid "" "\r\n" "\r\n" @@ -329,29 +334,29 @@ msgstr "" "\r\n" "Tjener avslutter.\r\n" -#: mactelnetd.c:818 +#: mactelnetd.c:832 msgid "Daemon shutting down" msgstr "Tjener avslutter" -#: mactelnetd.c:849 +#: mactelnetd.c:863 msgid "SIGHUP: Reloading interfaces" msgstr "SIGHUP: Laster grensesnitt på nytt" -#: mactelnetd.c:860 +#: mactelnetd.c:874 msgid "No devices found! Exiting.\n" msgstr "Ingen enheter funnet! Avslutter.\n" -#: mactelnetd.c:874 +#: mactelnetd.c:888 #, c-format msgid "(%d) Connection closed because interface %s is gone." msgstr "(%d) Tilkobling lukket på grunn av at %s er borte." -#: mactelnetd.c:927 +#: mactelnetd.c:941 #, c-format msgid "Usage: %s [-f|-n|-h]\n" msgstr "Bruksmåte: %s [-f|-n|-h]\n" -#: mactelnetd.c:930 +#: mactelnetd.c:944 #, c-format msgid "" "\n" @@ -368,71 +373,75 @@ msgstr "" " -h Denne hjelpen.\n" "\n" -#: mactelnetd.c:1003 +#: mactelnetd.c:1017 #, c-format msgid "MNDP: Error binding to %s:%d, %s\n" msgstr "MNDP: Klarte ikke binde til %s:%d, %s\n" -#: mactelnetd.c:1007 +#: mactelnetd.c:1021 #, c-format msgid "Bound to %s:%d" msgstr "Bundet to %s:%d" -#: mactelnetd.c:1033 +#: mactelnetd.c:1047 msgid "Unable to find any valid network interfaces\n" msgstr "Klarte ikke finne noen gyldige nettverksgrensesnitt\n" -#: mactelnetd.c:1109 +#: mactelnetd.c:1123 #, c-format msgid "(%d) Connection to user %s closed." msgstr "(%d) Tilkobling til bruker %s lukket." -#: mactelnetd.c:1119 +#: mactelnetd.c:1133 #, c-format msgid "(%d) Waiting for ack\n" msgstr "(%d) Venter på ack\n" -#: mactelnetd.c:1135 +#: mactelnetd.c:1149 #, c-format msgid "(%d) Session timed out" msgstr "(%d) Sesjonen utgikk på tidsavbrudd" #. _ Please include both \r and \n in translation, this is needed for the terminal emulator. -#: mactelnetd.c:1138 +#: mactelnetd.c:1152 msgid "Timeout\r\n" msgstr "Tidsavbrudd\r\n" -#: mndp.c:73 +#: mndp.c:83 #, c-format msgid "Searching for MikroTik routers... Abort with CTRL+C.\n" msgstr "Søker etter MikroTik rutere… Avbryt med CTRL+C.\n" -#: mndp.c:77 +#: mndp.c:87 #, c-format msgid "Unable to send broadcast packets: Operating in receive only mode.\n" msgstr "Klarer ikke sende broadcast pakker: Jobber i kun-motta-modus.\n" -#: mndp.c:87 +#: mndp.c:97 #, c-format msgid "Unable to send broadcast packet: Operating in receive only mode.\n" msgstr "Klarer ikke sende broadcast pakke: Jobber i kun-motta-modus.\n" -#: mndp.c:91 +#: mndp.c:102 +msgid "MAC-Address,Identity,Platform,Version,Hardware,Uptime,Softid,Ifname" +msgstr "MAC-Adresse,Identitet,Plattform,Versjon,Maskinvare,Oppetid,Softid,Enhetsnavn" + +#: mndp.c:104 msgid "MAC-Address" msgstr "MAC-Adresse" -#: mndp.c:91 +#: mndp.c:104 msgid "Identity (platform version hardware) uptime" msgstr "Identitet (plattform versjon maskinvare) oppetid" -#: mndp.c:98 +#: mndp.c:117 #, c-format msgid "An error occured. aborting\n" msgstr "En feil oppstod. avbryter\n" -#: mndp.c:112 +#: mndp.c:131 #, c-format -msgid " up %d days %d hours" +msgid " up %d days %d hours" msgstr " oppe %d dager %d timer" #: protocol.c:84 protocol.c:148 @@ -75,7 +75,8 @@ enum mt_mndp_attrtype { MT_MNDPTYPE_PLATFORM = 0x0008, MT_MNDPTYPE_TIMESTAMP = 0x000a, MT_MNDPTYPE_SOFTID = 0x000b, - MT_MNDPTYPE_HARDWARE = 0x000c + MT_MNDPTYPE_HARDWARE = 0x000c, + MT_MNDPTYPE_IFNAME = 0x0010 }; /* MNDP packet header */ @@ -111,6 +112,7 @@ struct mt_mndp_info { char platform[MT_MNDP_MAX_STRING_LENGTH]; char hardware[MT_MNDP_MAX_STRING_LENGTH]; char softid[MT_MNDP_MAX_STRING_LENGTH]; + char ifname[MT_MNDP_MAX_STRING_LENGTH]; unsigned int uptime; }; |