From 7175eb2a1d83ae10a7bc0c1961a6d13fb40a1456 Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Sun, 20 May 2012 16:53:56 +0200 Subject: Added -l option to mactelnet, so you don't have to know about the mndp tool to find it. --- Makefile | 4 ++-- docs/mactelnet.1 | 7 +++++++ mactelnet.c | 10 ++++++++-- mndp.c | 13 +++++++++++++ mndp.h | 6 ++++++ 5 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 mndp.h diff --git a/Makefile b/Makefile index 15a73c1..5b9ae91 100644 --- a/Makefile +++ b/Makefile @@ -42,8 +42,8 @@ interfaces.o: interfaces.c interfaces.h md5.o: md5.c md5.h ${CC} -Wall ${CFLAGS} -c md5.c -mactelnet: config.h mactelnet.c mactelnet.h protocol.o console.c console.h interfaces.o md5.o - ${CC} -Wall ${CFLAGS} ${LDFLAGS} -o mactelnet mactelnet.c protocol.o console.c interfaces.o md5.o ${LIBS} +mactelnet: config.h mactelnet.c mactelnet.h protocol.o console.c console.h interfaces.o md5.o mndp.c + ${CC} -Wall ${CFLAGS} ${LDFLAGS} -o mactelnet mactelnet.c protocol.o console.c interfaces.o md5.o -DFROM_MACTELNET mndp.c ${LIBS} mactelnetd: config.h mactelnetd.c protocol.o interfaces.o console.c console.h users.o users.h md5.o ${CC} -Wall ${CFLAGS} ${LDFLAGS} -o mactelnetd mactelnetd.c protocol.o console.c interfaces.o users.o md5.o ${LIBS} diff --git a/docs/mactelnet.1 b/docs/mactelnet.1 index 7ca091e..d29591d 100644 --- a/docs/mactelnet.1 +++ b/docs/mactelnet.1 @@ -12,6 +12,13 @@ If specified, the hostname (identity) will be looked up via MNDP discovery. These programs follow the usual GNU command line syntax. A summary of options is included below. .TP +.B \-l +This will discover RouterOS or MAC-Telnetd enabled devices. It will +list the MAC-address software version, and uptime of every device +or machine it discovers. To exit the discovery, use +.B Control + C +\. +.TP .B \-n Do not use broadcast packets. A tad less insecure but requires root privileges. This means that ethernet packets will have the specified mac-address as the packet diff --git a/mactelnet.c b/mactelnet.c index c78b262..6f2ec80 100644 --- a/mactelnet.c +++ b/mactelnet.c @@ -43,6 +43,7 @@ #include "interfaces.h" #include "config.h" #include "mactelnet.h" +#include "mndp.h" #define PROGRAM_NAME "MAC-Telnet" @@ -408,7 +409,7 @@ int main (int argc, char **argv) { textdomain("mactelnet"); while (1) { - c = getopt(argc, argv, "nqt:u:p:vh?"); + c = getopt(argc, argv, "lnqt:u:p:vh?"); if (c == -1) { break; @@ -447,6 +448,10 @@ int main (int argc, char **argv) { quiet_mode = 1; break; + case 'l': + return mndp(); + break; + case 'h': case '?': print_help = 1; @@ -456,12 +461,13 @@ int main (int argc, char **argv) { } if (argc - optind < 1 || print_help) { print_version(); - fprintf(stderr, _("Usage: %s [-h] [-n] [-t ] [-u ] [-p ]\n"), argv[0]); + fprintf(stderr, _("Usage: %s [-h] [-n] [-t ] [-u ] [-p ] | <-l>\n"), argv[0]); if (print_help) { fprintf(stderr, _("\nParameters:\n" " MAC MAC-Address of the RouterOS/mactelnetd device. Use mndp to discover it.\n" " identity The identity/name of your destination device. Uses MNDP protocol to find it.\n" + " -l List/Search for routers nearby. (using MNDP)\n" " -n Do not use broadcast packets. Less insecure but requires root privileges.\n" " -t Amount of seconds to wait for a response on each interface.\n" " -u Specify username on command line.\n" diff --git a/mndp.c b/mndp.c index 1b070e2..bec7c64 100644 --- a/mndp.c +++ b/mndp.c @@ -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 Identity (platform version hardware) uptime\E[m\n", "MAC-Address"); + while(1) { struct mt_mndp_info *packet; /* Wait for a UDP packet */ diff --git a/mndp.h b/mndp.h new file mode 100644 index 0000000..77c489f --- /dev/null +++ b/mndp.h @@ -0,0 +1,6 @@ +#ifndef _MNDP_H +#define _MNDP_H + +int mndp(void); + +#endif \ No newline at end of file -- cgit v1.2.3 From 8d0a3a56e5ce113a962ff04255dc38abac08640f Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Sun, 20 May 2012 17:20:00 +0200 Subject: Fixed missing translation in i18n template. Bugfixed Makefile a bit. --- Makefile | 9 ++++++--- mactelnet.c | 2 +- mndp.c | 4 ++-- po/mactelnet.pot | 51 ++++++++++++++++++++++++++++++--------------------- 4 files changed, 39 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 5b9ae91..1cecd59 100644 --- a/Makefile +++ b/Makefile @@ -5,13 +5,14 @@ CC?=gcc all: macping mndp mactelnet mactelnetd -clean: dist-clean +clean: distclean -dist-clean: +distclean: rm -f mactelnet macping mactelnetd mndp + rm po/*.pot rm -f *.o -dist: dist-clean po/mactelnet.pot +dist: distclean po install: all install-docs install -d $(DESTDIR)/usr/bin @@ -27,6 +28,8 @@ install-docs: install -d $(DESTDIR)/usr/share/man/man1/ install docs/*.1 $(DESTDIR)/usr/share/man/man1/ +po: po/mactelnet.pot + po/mactelnet.pot: *.c xgettext --package-name=mactelnet --msgid-bugs-address=haakon.nessjoen@gmail.com -d mactelnet -C -c_ -k_ -kgettext_noop *.c -o po/mactelnet.pot diff --git a/mactelnet.c b/mactelnet.c index 6f2ec80..f83518f 100644 --- a/mactelnet.c +++ b/mactelnet.c @@ -461,7 +461,7 @@ int main (int argc, char **argv) { } if (argc - optind < 1 || print_help) { print_version(); - fprintf(stderr, _("Usage: %s [-h] [-n] [-t ] [-u ] [-p ] | <-l>\n"), argv[0]); + fprintf(stderr, _("Usage: %s [-h] [-n] [-t ] [-u ] [-p ] | -l\n"), argv[0]); if (print_help) { fprintf(stderr, _("\nParameters:\n" diff --git a/mndp.c b/mndp.c index bec7c64..b229d3b 100644 --- a/mndp.c +++ b/mndp.c @@ -88,7 +88,7 @@ int mndp(void) { } } - printf("\n\E[1m%-17s Identity (platform version hardware) uptime\E[m\n", "MAC-Address"); + printf("\n\E[1m%-17s %s\E[m\n", _("MAC-Address"), _("Identity (platform version hardware) uptime")); while(1) { struct mt_mndp_info *packet; @@ -104,7 +104,7 @@ int mndp(void) { 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); } diff --git a/po/mactelnet.pot b/po/mactelnet.pot index 415844c..841d607 100644 --- a/po/mactelnet.pot +++ b/po/mactelnet.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mactelnet\n" "Report-Msgid-Bugs-To: haakon.nessjoen@gmail.com\n" -"POT-Creation-Date: 2012-02-28 15:15+0100\n" +"POT-Creation-Date: 2012-05-20 17:16+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -67,7 +67,7 @@ msgstr "" msgid "You need to have root privileges to use %s.\n" msgstr "" -#: macping.c:207 mndp.c:57 protocol.c:429 +#: macping.c:207 mndp.c:68 protocol.c:429 #, c-format msgid "Error binding to %s:%d\n" msgstr "" @@ -92,36 +92,36 @@ msgstr "" msgid "%s Reply of %d bytes of unequal data\n" msgstr "" -#: mactelnet.c:154 +#: mactelnet.c:155 #, c-format msgid "" "\n" "Connection timed out\n" msgstr "" -#: mactelnet.c:303 +#: mactelnet.c:304 #, c-format msgid "Connection closed.\n" msgstr "" -#: mactelnet.c:309 +#: mactelnet.c:310 #, c-format msgid "Unhandeled packet type: %d received from server %s\n" msgstr "" -#: mactelnet.c:331 +#: mactelnet.c:332 #, c-format msgid "Error: No suitable devices found\n" msgstr "" -#: mactelnet.c:459 +#: mactelnet.c:464 #, c-format msgid "" "Usage: %s [-h] [-n] [-t ] [-u ] [-p " -"]\n" +"] | -l\n" msgstr "" -#: mactelnet.c:462 +#: mactelnet.c:467 #, c-format msgid "" "\n" @@ -130,6 +130,7 @@ msgid "" "discover it.\n" " identity The identity/name of your destination device. Uses MNDP protocol " "to find it.\n" +" -l List/Search for routers nearby. (using MNDP)\n" " -n Do not use broadcast packets. Less insecure but requires root " "privileges.\n" " -t Amount of seconds to wait for a response on each interface.\n" @@ -140,36 +141,36 @@ msgid "" "\n" msgstr "" -#: mactelnet.c:486 +#: mactelnet.c:492 #, c-format msgid "You need to have root privileges to use the -n parameter.\n" msgstr "" -#: mactelnet.c:518 +#: mactelnet.c:524 #, c-format msgid "Login: " msgstr "" -#: mactelnet.c:525 +#: mactelnet.c:531 msgid "Password: " msgstr "" -#: mactelnet.c:550 +#: mactelnet.c:556 #, c-format msgid "Connecting to %s..." msgstr "" -#: mactelnet.c:560 mactelnetd.c:244 mactelnetd.c:981 +#: mactelnet.c:566 mactelnetd.c:244 mactelnetd.c:981 #, c-format msgid "Error binding to %s:%d, %s\n" msgstr "" -#: mactelnet.c:565 +#: mactelnet.c:571 #, c-format msgid "Connection failed.\n" msgstr "" -#: mactelnet.c:569 +#: mactelnet.c:575 #, c-format msgid "done\n" msgstr "" @@ -329,27 +330,35 @@ msgstr "" msgid "Timeout\r\n" msgstr "" -#: mndp.c:62 +#: mndp.c:73 #, c-format msgid "Searching for MikroTik routers... Abort with CTRL+C.\n" msgstr "" -#: mndp.c:66 +#: mndp.c:77 #, c-format msgid "Unable to send broadcast packets: Operating in receive only mode.\n" msgstr "" -#: mndp.c:76 +#: mndp.c:87 #, c-format msgid "Unable to send broadcast packet: Operating in receive only mode.\n" msgstr "" -#: mndp.c:85 +#: mndp.c:91 +msgid "MAC-Address" +msgstr "" + +#: mndp.c:91 +msgid "Identity (platform version hardware) uptime" +msgstr "" + +#: mndp.c:98 #, c-format msgid "An error occured. aborting\n" msgstr "" -#: mndp.c:99 +#: mndp.c:112 #, c-format msgid " up %d days %d hours" msgstr "" -- cgit v1.2.3 From 092e396b00ee4805c2a924f1b1c00cbc6e07a33c Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Tue, 17 Jul 2012 22:19:19 +0200 Subject: Added -U flag for dropping privileges in raw mode in mactelnet. Manually merged from Ali Onur Uyar's commit 8720817a0b in his MAC-Telnet repo at github (aouyar) --- mactelnet.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 57 insertions(+), 11 deletions(-) diff --git a/mactelnet.c b/mactelnet.c index f83518f..0620b8d 100644 --- a/mactelnet.c +++ b/mactelnet.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -77,6 +78,7 @@ static int keepalive_counter = 0; static unsigned char encryptionkey[128]; static char username[255]; static char password[255]; +static char nonpriv_username[255]; struct net_interface interfaces[MAX_INTERFACES]; struct net_interface *active_interface; @@ -92,6 +94,30 @@ static void print_version() { fprintf(stderr, PROGRAM_NAME " " PROGRAM_VERSION "\n"); } +void drop_privileges(char *username) { + struct passwd *user = (struct passwd *) getpwnam(username); + if (user == NULL) { + fprintf(stderr, _("Failed dropping privileges. The user %s is not a valid username on local system.\n"), username); + exit(1); + } + if (getuid() == 0) { + /* process is running as root, drop privileges */ + if (setgid(user->pw_gid) != 0) { + fprintf(stderr, _("setgid: Error dropping group privileges\n")); + exit(1); + } + if (setuid(user->pw_uid) != 0) { + fprintf(stderr, _("setuid: Error dropping user privileges\n")); + exit(1); + } + /* Verify if the privileges were developed. */ + if (setuid(0) != -1) { + fprintf(stderr, _("Failed to drop privileges\n")); + exit(1); + } + } +} + static int send_udp(struct mt_packet *packet, int retransmit) { int sent_bytes; @@ -401,6 +427,7 @@ int main (int argc, char **argv) { struct sockaddr_in si_me; unsigned char buff[1500]; unsigned char print_help = 0, have_username = 0, have_password = 0; + unsigned char drop_priv = 0; int c; int optval = 1; @@ -409,7 +436,7 @@ int main (int argc, char **argv) { textdomain("mactelnet"); while (1) { - c = getopt(argc, argv, "lnqt:u:p:vh?"); + c = getopt(argc, argv, "lnqt:u:p:U:vh?"); if (c == -1) { break; @@ -435,6 +462,13 @@ int main (int argc, char **argv) { have_password = 1; break; + case 'U': + /* Save nonpriv_username */ + strncpy(nonpriv_username, optarg, sizeof(nonpriv_username) - 1); + nonpriv_username[sizeof(nonpriv_username) - 1] = '\0'; + drop_priv = 1; + break; + case 't': connect_timeout = atoi(optarg); break; @@ -461,19 +495,24 @@ int main (int argc, char **argv) { } if (argc - optind < 1 || print_help) { print_version(); - fprintf(stderr, _("Usage: %s [-h] [-n] [-t ] [-u ] [-p ] | -l\n"), argv[0]); + fprintf(stderr, _("Usage: %s [-h] [-n] [-t ] [-u ] [-p ] [-U ] | -l\n"), argv[0]); if (print_help) { fprintf(stderr, _("\nParameters:\n" - " MAC MAC-Address of the RouterOS/mactelnetd device. Use mndp to discover it.\n" - " identity The identity/name of your destination device. Uses MNDP protocol to find it.\n" - " -l List/Search for routers nearby. (using MNDP)\n" - " -n Do not use broadcast packets. Less insecure but requires root privileges.\n" - " -t Amount of seconds to wait for a response on each interface.\n" - " -u Specify username on command line.\n" - " -p Specify password on command line.\n" - " -q Quiet mode.\n" - " -h This help.\n" + " MAC MAC-Address of the RouterOS/mactelnetd device. Use mndp to\n" + " 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" + " -n Do not use broadcast packets. Less insecure but requires\n" + " root privileges.\n" + " -t Amount of seconds to wait for a response on each interface.\n" + " -u Specify username on command line.\n" + " -p Specify password on command line.\n" + " -U Drop privileges to this user. Used in conjunction with -n\n" + " for security.\n" + " -q Quiet mode.\n" + " -h This help.\n" "\n")); } return 1; @@ -494,6 +533,13 @@ int main (int argc, char **argv) { } sockfd = net_init_raw_socket(); + + if (drop_priv) { + drop_privileges(nonpriv_username); + } + } else if (drop_priv) { + fprintf(stderr, _("The -U option must be used in conjunction with the -n parameter.\n")); + return 1; } /* Receive regular udp packets with this socket */ -- cgit v1.2.3 From 8bb7351cc1598da5ef6b799c019c75509a9a642f Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Tue, 17 Jul 2012 22:20:59 +0200 Subject: Updated internationalization, sped up code by using fputs instead of fprintf. Updated readme. Bumped version. --- Makefile | 2 +- README.markdown | 27 ++++++++++-------- config.h | 2 +- mactelnet.c | 2 +- po/mactelnet.pot | 86 ++++++++++++++++++++++++++++++++++++++------------------ 5 files changed, 77 insertions(+), 42 deletions(-) diff --git a/Makefile b/Makefile index 1cecd59..a7f2abd 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ clean: distclean distclean: rm -f mactelnet macping mactelnetd mndp - rm po/*.pot + rm -f po/*.pot rm -f *.o dist: distclean po diff --git a/README.markdown b/README.markdown index e1bd784..45d4cd8 100644 --- a/README.markdown +++ b/README.markdown @@ -1,8 +1,7 @@ MAC-Telnet for Linux ==================== -A linux console tool for connecting to MikroTik RouterOS devices via their -ethernet address. +Console tools for connecting to, and serving, devices using MikroTik RouterOS MAC-Telnet protocol. Installation ------------ @@ -22,17 +21,23 @@ Usage ----- # mactelnet -h - Usage: mactelnet [-h] [-n] [-t ] [-u ] [-p ] + Usage: mactelnet [-h] [-n] [-t ] [-u ] [-p ] [-U ] | -l Parameters: - MAC MAC-Address of the RouterOS device. Use mndp to discover them. - identity The identity/name of your RouterOS device. Uses MNDP protocol to find it.. - -n Do not use broadcast packets. Less insecure but requires root privileges. - -t Amount of seconds to wait for a response on each interface. - -u Specify username on command line. - -p Specify password on command line. - -h This help. - + MAC MAC-Address of the RouterOS/mactelnetd device. Use mndp to + discover it. + identity The identity/name of your destination device. Uses + MNDP protocol to find it. + -l List/Search for routers nearby. (using MNDP) + -n Do not use broadcast packets. Less insecure but requires + root privileges. + -t Amount of seconds to wait for a response on each interface. + -u Specify username on command line. + -p Specify password on command line. + -U Drop privileges to this user. Used in conjunction with -n + for security. + -q Quiet mode. + -h This help. Example: diff --git a/config.h b/config.h index c2c1fd4..1e7734f 100644 --- a/config.h +++ b/config.h @@ -21,7 +21,7 @@ #define DEBUG 0 -#define PROGRAM_VERSION "0.3.3" +#define PROGRAM_VERSION "0.3.4" #if defined(__APPLE__) && defined(__MACH__) #define PLATFORM_NAME "Mac OS X" diff --git a/mactelnet.c b/mactelnet.c index 0620b8d..19624ea 100644 --- a/mactelnet.c +++ b/mactelnet.c @@ -289,7 +289,7 @@ static int handle_packet(unsigned char *data, int data_len) { the data is raw terminal data to be outputted to the terminal. */ else if (cpkt.cptype == MT_CPTYPE_PLAINDATA) { cpkt.data[cpkt.length] = 0; - printf("%s", cpkt.data); + fputs((const char *)cpkt.data, stdout); } /* END_AUTH means that the user/password negotiation is done, and after this point diff --git a/po/mactelnet.pot b/po/mactelnet.pot index 841d607..22a579c 100644 --- a/po/mactelnet.pot +++ b/po/mactelnet.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mactelnet\n" "Report-Msgid-Bugs-To: haakon.nessjoen@gmail.com\n" -"POT-Creation-Date: 2012-05-20 17:16+0200\n" +"POT-Creation-Date: 2012-07-17 21:29+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -92,85 +92,115 @@ msgstr "" msgid "%s Reply of %d bytes of unequal data\n" msgstr "" -#: mactelnet.c:155 +#: mactelnet.c:100 +#, c-format +msgid "" +"Failed dropping privileges. The user %s is not a valid username on local " +"system.\n" +msgstr "" + +#: mactelnet.c:106 +#, c-format +msgid "setgid: Error dropping group privileges\n" +msgstr "" + +#: mactelnet.c:110 +#, c-format +msgid "setuid: Error dropping user privileges\n" +msgstr "" + +#: mactelnet.c:115 +#, c-format +msgid "Failed to drop privileges\n" +msgstr "" + +#: mactelnet.c:181 #, c-format msgid "" "\n" "Connection timed out\n" msgstr "" -#: mactelnet.c:304 +#: mactelnet.c:330 #, c-format msgid "Connection closed.\n" msgstr "" -#: mactelnet.c:310 +#: mactelnet.c:336 #, c-format msgid "Unhandeled packet type: %d received from server %s\n" msgstr "" -#: mactelnet.c:332 +#: mactelnet.c:358 #, c-format msgid "Error: No suitable devices found\n" msgstr "" -#: mactelnet.c:464 +#: mactelnet.c:498 #, c-format msgid "" -"Usage: %s [-h] [-n] [-t ] [-u ] [-p " -"] | -l\n" +"Usage: %s [-h] [-n] [-t ] [-u ] [-p " +"] [-U ] | -l\n" msgstr "" -#: mactelnet.c:467 +#: mactelnet.c:501 #, c-format msgid "" "\n" "Parameters:\n" -" MAC MAC-Address of the RouterOS/mactelnetd device. Use mndp to " -"discover it.\n" -" identity The identity/name of your destination device. Uses MNDP protocol " -"to find it.\n" -" -l List/Search for routers nearby. (using MNDP)\n" -" -n Do not use broadcast packets. Less insecure but requires root " -"privileges.\n" -" -t Amount of seconds to wait for a response on each interface.\n" -" -u Specify username on command line.\n" -" -p Specify password on command line.\n" -" -q Quiet mode.\n" -" -h This help.\n" +" MAC MAC-Address of the RouterOS/mactelnetd device. Use mndp to\n" +" 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" +" -n Do not use broadcast packets. Less insecure but requires\n" +" root privileges.\n" +" -t Amount of seconds to wait for a response on each " +"interface.\n" +" -u Specify username on command line.\n" +" -p Specify password on command line.\n" +" -U Drop privileges to this user. Used in conjunction with -n\n" +" for security.\n" +" -q Quiet mode.\n" +" -h This help.\n" "\n" msgstr "" -#: mactelnet.c:492 +#: mactelnet.c:531 #, c-format msgid "You need to have root privileges to use the -n parameter.\n" msgstr "" -#: mactelnet.c:524 +#: mactelnet.c:541 +#, c-format +msgid "The -U option must be used in conjunction with the -n parameter.\n" +msgstr "" + +#: mactelnet.c:570 #, c-format msgid "Login: " msgstr "" -#: mactelnet.c:531 +#: mactelnet.c:577 msgid "Password: " msgstr "" -#: mactelnet.c:556 +#: mactelnet.c:602 #, c-format msgid "Connecting to %s..." msgstr "" -#: mactelnet.c:566 mactelnetd.c:244 mactelnetd.c:981 +#: mactelnet.c:612 mactelnetd.c:244 mactelnetd.c:981 #, c-format msgid "Error binding to %s:%d, %s\n" msgstr "" -#: mactelnet.c:571 +#: mactelnet.c:617 #, c-format msgid "Connection failed.\n" msgstr "" -#: mactelnet.c:575 +#: mactelnet.c:621 #, c-format msgid "done\n" msgstr "" -- cgit v1.2.3 From b3e038acf0a8303b943ebd06e2d067a0761a6edd Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Tue, 17 Jul 2012 22:25:21 +0200 Subject: New version 0.4.0. --- config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.h b/config.h index 1e7734f..c6c4148 100644 --- a/config.h +++ b/config.h @@ -21,7 +21,7 @@ #define DEBUG 0 -#define PROGRAM_VERSION "0.3.4" +#define PROGRAM_VERSION "0.4.0" #if defined(__APPLE__) && defined(__MACH__) #define PLATFORM_NAME "Mac OS X" -- cgit v1.2.3 From ca4bbc71364354ff6f45165673bee57c8d5d9b3b Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Wed, 18 Jul 2012 13:34:33 +0000 Subject: .pot file should exist in distclean --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a7f2abd..7bf4f1f 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,12 @@ clean: distclean distclean: rm -f mactelnet macping mactelnetd mndp - rm -f po/*.pot rm -f *.o -dist: distclean po +potclean: + rm -f po/*.pot + +dist: distclean potclean pot install: all install-docs install -d $(DESTDIR)/usr/bin @@ -28,7 +30,7 @@ install-docs: install -d $(DESTDIR)/usr/share/man/man1/ install docs/*.1 $(DESTDIR)/usr/share/man/man1/ -po: po/mactelnet.pot +pot: po/mactelnet.pot po/mactelnet.pot: *.c xgettext --package-name=mactelnet --msgid-bugs-address=haakon.nessjoen@gmail.com -d mactelnet -C -c_ -k_ -kgettext_noop *.c -o po/mactelnet.pot -- cgit v1.2.3 From 11b726cee17622304839279fdce47feb9b86f4f7 Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Sun, 23 Sep 2012 00:40:16 +0200 Subject: Added Norwegian l10n file. --- po/nb.po | 466 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 466 insertions(+) create mode 100644 po/nb.po diff --git a/po/nb.po b/po/nb.po new file mode 100644 index 0000000..cf7e19c --- /dev/null +++ b/po/nb.po @@ -0,0 +1,466 @@ +# 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 , YEAR. +# +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" +"Last-Translator: Håkon Nessjøen \n" +"Language-Team: Håkon Nessjøen \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" +"Language: nb\n" +"X-Poedit-SourceCharset: UTF-8\n" + +#: interfaces.c:287 +#, c-format +msgid "packet size too large\n" +msgstr "pakkestørrelse for stor\n" + +#: macping.c:89 +#, c-format +msgid "%d packets transmitted, %d packets received, %d%% packet loss\n" +msgstr "%d pakker sendt, %d pakker mottatt, %d%% pakketap\n" + +#: macping.c:90 +#, c-format +msgid "round-trip min/avg/max = %.2f/%.2f/%.2f ms\n" +msgstr "returtid min/gjennomsnitt/maks = %.2f/%.2f/%.2f ms\n" + +#: macping.c:149 +#, c-format +msgid "" +"Number of packets to send must be more than 0 and less than 100 in fast " +"mode.\n" +msgstr "Antall pakker må være mer enn 0 og mindre enn 100 i hurtig-modus.\n" + +#: macping.c:155 +#, c-format +msgid "Usage: %s [-h] [-f] [-c ] [-s ]\n" +msgstr "Bruksmåte: %s [-h] [-f] [-c ] [-s ]\n" + +#: macping.c:158 +#, c-format +msgid "" +"\n" +"Parameters:\n" +" MAC MAC-Address of the RouterOS/mactelnetd device.\n" +" -f Fast mode, do not wait before sending next ping request.\n" +" -s Specify size of ping packet.\n" +" -c Number of packets to send. (0 = unlimited)\n" +" -h This help.\n" +"\n" +msgstr "" +"\n" +"Parametere:\n" +" MAC MAC-Adressen til RouterOS/mactelnetd enheten.\n" +" -f Hurtig-modus, send ping forespørsler uten pause.\n" +" -s Spesifiser pakkestørrelsen.\n" +" -c Antall pakker som skal sendes. (0 = uendelig)\n" +" -h Denne hjelpen.\n" +"\n" + +#: macping.c:170 +#, c-format +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 +#, 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 +#, c-format +msgid "Error binding to %s:%d\n" +msgstr "Klarte ikke binde mot %s:%d\n" + +#: macping.c:266 +#, c-format +msgid "Error sending packet.\n" +msgstr "Klarte ikke sende pakke.\n" + +#: macping.c:284 +#, c-format +msgid "%s ping timeout\n" +msgstr "%s ping tidsavbrudd\n" + +#: macping.c:322 +#, c-format +msgid "%s %d byte, ping time %.2f ms%s\n" +msgstr "%s %d byte, ping tid %.2f ms%s\n" + +#: macping.c:324 +#, c-format +msgid "%s Reply of %d bytes of unequal data\n" +msgstr "%s Retur av %d byter med usammensvarende data\n" + +#: mactelnet.c:100 +#, c-format +msgid "" +"Failed dropping privileges. The user %s is not a valid username on local " +"system.\n" +msgstr "" +"Klarte ikke droppe privilegier. Brukernavnet %s er ikke gyldig på det lokale " +"systemet.\n" + +#: mactelnet.c:106 +#, c-format +msgid "setgid: Error dropping group privileges\n" +msgstr "setgid: Klarte ikke droppe gruppeprivilegier\n" + +#: mactelnet.c:110 +#, c-format +msgid "setuid: Error dropping user privileges\n" +msgstr "setud: Klarte ikke droppe brukerprivilegier\n" + +#: mactelnet.c:115 +#, c-format +msgid "Failed to drop privileges\n" +msgstr "Klarte ikke droppe privilegier\n" + +#: mactelnet.c:181 +#, c-format +msgid "" +"\n" +"Connection timed out\n" +msgstr "" +"\n" +"Tilkoblingen fikk tidsavbrudd\n" + +#: mactelnet.c:330 +#, c-format +msgid "Connection closed.\n" +msgstr "Tilkoblingen ble stengt.\n" + +#: mactelnet.c:336 +#, 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 +#, c-format +msgid "Error: No suitable devices found\n" +msgstr "Feil: Ingen brukbare enheter funnet\n" + +#: mactelnet.c:498 +#, c-format +msgid "" +"Usage: %s [-h] [-n] [-t ] [-u ] [-p " +"] [-U ] | -l\n" +msgstr "" +"Bruksmåte: %s [-h] [-n] [-t ] [-u " +"] [-p ] [-U ] | -l\n" + +#: mactelnet.c:501 +#, c-format +msgid "" +"\n" +"Parameters:\n" +" MAC MAC-Address of the RouterOS/mactelnetd device. Use mndp to\n" +" 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" +" -n Do not use broadcast packets. Less insecure but requires\n" +" root privileges.\n" +" -t Amount of seconds to wait for a response on each " +"interface.\n" +" -u Specify username on command line.\n" +" -p Specify password on command line.\n" +" -U Drop privileges to this user. Used in conjunction with -n\n" +" for security.\n" +" -q Quiet mode.\n" +" -h This help.\n" +"\n" +msgstr "" +"\n" +"Parametere:\n" +" MAC MAC-Adressen til RouterOS/mactelnetd enheten. Bruk mndb " +"for\n" +" å 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" +" -n Ikke bruk broadcast pakker. Mindre usikkert, men bruker\n" +" root privilegier.\n" +" -t Antall sekunder å vente for respons på hvert grensesnitt.\n" +" -u Spesifiser brukernavn på kommando-linjen.\n" +" -p Spesifiser passord på kommando-linjen.\n" +" -U Dropp privilegier til denne brukeren. Brukes i forbindelse\n" +" med -n for sikkerhet.\n" +" -q Stille-modus.\n" +" -h Denne hjelpen.\n" +"\n" + +#: mactelnet.c:531 +#, 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 +#, 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 +#, c-format +msgid "Login: " +msgstr "Bruker: " + +#: mactelnet.c:577 +msgid "Password: " +msgstr "Passord: " + +#: mactelnet.c:602 +#, c-format +msgid "Connecting to %s..." +msgstr "Kobler til %s…" + +#: mactelnet.c:612 mactelnetd.c:244 mactelnetd.c:981 +#, c-format +msgid "Error binding to %s:%d, %s\n" +msgstr "Problemer med å binde til %s:%d, %s\n" + +#: mactelnet.c:617 +#, c-format +msgid "Connection failed.\n" +msgstr "Tilkobling feilet.\n" + +#: mactelnet.c:621 +#, c-format +msgid "done\n" +msgstr "ferdig\n" + +#: mactelnetd.c:249 +#, c-format +msgid "Listening on %s for %s\n" +msgstr "Lytter på %s for %s\n" + +#: mactelnetd.c:409 +#, 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 +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 +msgid "Terminal error\r\n" +msgstr "Terminalfeil\r\n" + +#: mactelnetd.c:440 +#, 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 +msgid "Local user not accessible\r\n" +msgstr "Lokal bruker er ikke tilgjengelig\r\n" + +#: mactelnetd.c:451 +#, 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 +msgid "Error opening terminal\r\n" +msgstr "Klarer ikke åpne terminal\r\n" + +#: mactelnetd.c:464 +#, c-format +msgid "(%d) User %s logged in." +msgstr "(%d) Bruker %s logget inn." + +#: mactelnetd.c:502 +#, 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 +msgid "Internal error\r\n" +msgstr "Intern feil\r\n" + +#: mactelnetd.c:510 +#, c-format +msgid "(%d) User %s disconnected with " +msgstr "(%d) Bruker %s frakoblet med " + +#: mactelnetd.c:603 +#, c-format +msgid "(%d) Unhandeled control packet type: %d" +msgstr "(%d) Uhåndtert kontrollpakke-type: %d" + +#: mactelnetd.c:649 +#, c-format +msgid "(%d) New connection from %s." +msgstr "(%d) Ny tilkobling fra %s." + +#: mactelnetd.c:677 mactelnetd.c:1111 +#, c-format +msgid "(%d) Connection closed." +msgstr "(%d) Tilkobling lukket." + +#: mactelnetd.c:723 +#, 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 +msgid "" +"\r\n" +"\r\n" +"Daemon shutting down.\r\n" +msgstr "" +"\r\n" +"\r\n" +"Tjener avslutter.\r\n" + +#: mactelnetd.c:818 +msgid "Daemon shutting down" +msgstr "Tjener avslutter" + +#: mactelnetd.c:849 +msgid "SIGHUP: Reloading interfaces" +msgstr "SIGHUP: Laster grensesnitt på nytt" + +#: mactelnetd.c:860 +msgid "No devices found! Exiting.\n" +msgstr "Ingen enheter funnet! Avslutter.\n" + +#: mactelnetd.c:874 +#, 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 +#, c-format +msgid "Usage: %s [-f|-n|-h]\n" +msgstr "Bruksmåte: %s [-f|-n|-h]\n" + +#: mactelnetd.c:930 +#, c-format +msgid "" +"\n" +"Parameters:\n" +" -f Run process in foreground.\n" +" -n Do not use broadcast packets. Just a tad less insecure.\n" +" -h This help.\n" +"\n" +msgstr "" +"\n" +"Parametere:\n" +" -f Kjør prosessen i forgrunn.\n" +" -n Ikke bruk broadcast pakker. Bare såvidt litt mer usikkert.\n" +" -h Denne hjelpen.\n" +"\n" + +#: mactelnetd.c:1003 +#, c-format +msgid "MNDP: Error binding to %s:%d, %s\n" +msgstr "MNDP: Klarte ikke binde til %s:%d, %s\n" + +#: mactelnetd.c:1007 +#, c-format +msgid "Bound to %s:%d" +msgstr "Bundet to %s:%d" + +#: mactelnetd.c:1033 +msgid "Unable to find any valid network interfaces\n" +msgstr "Klarte ikke finne noen gyldige nettverksgrensesnitt\n" + +#: mactelnetd.c:1109 +#, c-format +msgid "(%d) Connection to user %s closed." +msgstr "(%d) Tilkobling til bruker %s lukket." + +#: mactelnetd.c:1119 +#, c-format +msgid "(%d) Waiting for ack\n" +msgstr "(%d) Venter på ack\n" + +#: mactelnetd.c:1135 +#, 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 +msgid "Timeout\r\n" +msgstr "Tidsavbrudd\r\n" + +#: mndp.c:73 +#, 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 +#, 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 +#, 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 +msgid "MAC-Address" +msgstr "MAC-Adresse" + +#: mndp.c:91 +msgid "Identity (platform version hardware) uptime" +msgstr "Identitet (plattform versjon maskinvare) oppetid" + +#: mndp.c:98 +#, c-format +msgid "An error occured. aborting\n" +msgstr "En feil oppstod. avbryter\n" + +#: mndp.c:112 +#, c-format +msgid " up %d days %d hours" +msgstr " oppe %d dager %d timer" + +#: protocol.c:84 protocol.c:148 +#, c-format +msgid "add_control_packet: ERROR, too large packet. Exceeds %d bytes\n" +msgstr "add_control_packet: FEIL, for stor pakke. Overstiger %d byter\n" + +#: protocol.c:280 +#, c-format +msgid "mndp_add_attribute: ERROR, too large packet. Exceeds %d bytes\n" +msgstr "mndp_add_attribute: FEIL, for stor pakke. Overstiger %d byter\n" + +#: protocol.c:444 +#, c-format +msgid "Unable to send broadcast packet: Router lookup will be slow\n" +msgstr "Klarer ikke sende broadcast pakke: Ruter søk vil være tregt\n" + +#: protocol.c:527 +#, c-format +msgid "Searching for '%s'..." +msgstr "Søker etter '%s'..." + +#: protocol.c:531 +#, c-format +msgid "not found\n" +msgstr "ikke funnet\n" + +#: protocol.c:538 +#, c-format +msgid "found\n" +msgstr "funnet\n" -- cgit v1.2.3