diff options
author | Phil Blundell <philb@gnu.org> | 1998-11-15 18:20:24 +0000 |
---|---|---|
committer | Phil Blundell <philb@gnu.org> | 1998-11-15 18:20:24 +0000 |
commit | 6053a5c2dda0a2d62b1ae3115cedc7a10efd7bff (patch) | |
tree | 392321a89b57f57b06072a8fd929dbbb3c5ebc7d /statistics.c | |
parent | Fix the initialization of aftype_netrom. This was breaking everything (diff) | |
download | net-tools-6053a5c2dda0a2d62b1ae3115cedc7a10efd7bff.tar.gz net-tools-6053a5c2dda0a2d62b1ae3115cedc7a10efd7bff.tar.bz2 net-tools-6053a5c2dda0a2d62b1ae3115cedc7a10efd7bff.zip |
i18n fixes from Arnaldo Carvalho de Melo.
Diffstat (limited to 'statistics.c')
-rw-r--r-- | statistics.c | 143 |
1 files changed, 74 insertions, 69 deletions
diff --git a/statistics.c b/statistics.c index b02cae7..368594c 100644 --- a/statistics.c +++ b/statistics.c @@ -1,5 +1,6 @@ /* Copyright '97 by Andi Kleen. Subject to the GPL. */ /* 19980630 - i18n - Arnaldo Carvalho de Melo <acme@conectiva.com.br> */ +/* 19981113 - i18n fixes - Arnaldo Carvalho de Melo <acme@conectiva.com.br> */ #include <ctype.h> #include <stdio.h> @@ -42,79 +43,84 @@ char *titles[] = { /* for each state */ /* XXX check against the snmp mib rfc. */ + /* + Don't mark the first field as translatable! It's a snmp MIB standard. + + - acme + */ struct entry Iptab[] = { - { N_("Forwarding"), N_("Forwarding is %s"), i_forward|I_STATIC }, - { N_("DefaultTTL"), N_("Default TTL is %d"), number|I_STATIC }, - { N_("InReceives"), N_("%d total packets received"), number }, - { N_("InHdrErrors"), N_("%d with invalid headers"), number }, - { N_("InAddrErrors"), N_("%d with invalid addresses"), number }, - { N_("ForwDatagrams"), N_("%d forwarded"), number }, - { N_("InUnknownProtos"), N_("%d with unknown protocol"), number }, - { N_("InDiscards"), N_("%d incoming packets discarded"), number }, - { N_("InDelivers"), N_("%d incoming packets delivered"), number }, - { N_("OutRequests"), N_("%d requests sent out"), number }, /*?*/ - { N_("OutDiscards"), N_("%d outgoing packets dropped"), number }, - { N_("OutNoRoutes"), N_("%d dropped because of missing route"), number }, - { N_("ReasmTimeout"), N_("%d fragments dropped after timeout"), number }, - { N_("ReasmReqds"), N_("%d reassemblies required"), number }, /* ? */ - { N_("ReasmOKs"), N_("%d packets reassembled ok"), number }, - { N_("ReasmFails"), N_("%d packet reassembles failed"), number }, - { N_("FragOKs"), N_("%d fragments received ok"), number }, - { N_("FragFails"), N_("%d fragments failed"), number }, - { N_("FragCreates"), N_("%d fragments created"), number } + { "Forwarding", N_("Forwarding is %s"), i_forward|I_STATIC }, + { "DefaultTTL", N_("Default TTL is %d"), number|I_STATIC }, + { "InReceives", N_("%d total packets received"), number }, + { "InHdrErrors", N_("%d with invalid headers"), number }, + { "InAddrErrors", N_("%d with invalid addresses"), number }, + { "ForwDatagrams", N_("%d forwarded"), number }, + { "InUnknownProtos", N_("%d with unknown protocol"), number }, + { "InDiscards", N_("%d incoming packets discarded"), number }, + { "InDelivers", N_("%d incoming packets delivered"), number }, + { "OutRequests", N_("%d requests sent out"), number }, /*?*/ + { "OutDiscards", N_("%d outgoing packets dropped"), number }, + { "OutNoRoutes", N_("%d dropped because of missing route"), number }, + { "ReasmTimeout", N_("%d fragments dropped after timeout"), number }, + { "ReasmReqds", N_("%d reassemblies required"), number }, /* ? */ + { "ReasmOKs", N_("%d packets reassembled ok"), number }, + { "ReasmFails", N_("%d packet reassembles failed"), number }, + { "FragOKs", N_("%d fragments received ok"), number }, + { "FragFails", N_("%d fragments failed"), number }, + { "FragCreates", N_("%d fragments created"), number } }; struct entry Icmptab[] = { - { N_("InMsgs"), N_("%d ICMP messages received"), number }, - { N_("InErrors"), N_("%d input ICMP message failed."), number }, - { N_("InDestUnreachs"), N_("destination unreachable: %d"), i_inp_icmp|I_TITLE }, - { N_("InTimeExcds"), N_("timeout in transit: %d"), i_inp_icmp|I_TITLE }, - { N_("InParmProbs"), N_("wrong parameters: %d"), i_inp_icmp|I_TITLE }, /*?*/ - { N_("InSrcQuenchs"), N_("source quenchs: %d"), i_inp_icmp|I_TITLE }, - { N_("InRedirects"), N_("redirects: %d"), i_inp_icmp|I_TITLE }, - { N_("InEchos"), N_("echo requests: %d"), i_inp_icmp|I_TITLE }, - { N_("InEchoReps"), N_("echo replies: %d"), i_inp_icmp|I_TITLE }, - { N_("InTimestamps"), N_("timestamp request: %d"), i_inp_icmp|I_TITLE }, - { N_("InTimestampReps"), N_("timestamp reply: %d"), i_inp_icmp|I_TITLE }, - { N_("InAddrMasks"), N_("address mask request: %d"), i_inp_icmp|I_TITLE }, /*?*/ - { N_("InAddrMaskReps"), N_("address mask replies"), i_inp_icmp|I_TITLE }, /*?*/ - { N_("OutMsgs"), N_("%d ICMP messages sent"), number }, - { N_("OutErrors"), N_("%d ICMP messages failed"), number }, - { N_("OutDestUnreachs"), N_("destination unreachable: %d"), i_outp_icmp|I_TITLE }, - { N_("OutTimeExcds"), N_("time exceeded: %d"), i_outp_icmp|I_TITLE }, - { N_("OutParmProbs"), N_("wrong parameters: %d"), i_outp_icmp|I_TITLE }, /*?*/ - { N_("OutSrcQuenchs"), N_("source quench: %d"), i_outp_icmp|I_TITLE }, - { N_("OutRedirects"), N_("redirect: %d"), i_outp_icmp|I_TITLE }, - { N_("OutEchos"), N_("echo request: %d"), i_outp_icmp|I_TITLE }, - { N_("OutEchoReps"), N_("echo replies: %d"), i_outp_icmp|I_TITLE }, - { N_("OutTimestamps"), N_("timestamp requests: %d"), i_outp_icmp|I_TITLE }, - { N_("OutTimestampReps"), N_("timestamp replies: %d"), i_outp_icmp|I_TITLE }, - { N_("OutAddrMasks"), N_("address mask requests: %d"), i_outp_icmp|I_TITLE }, - { N_("OutAddrMaskReps"), N_("address mask replies: %d"), i_outp_icmp|I_TITLE }, + { "InMsgs", N_("%d ICMP messages received"), number }, + { "InErrors", N_("%d input ICMP message failed."), number }, + { "InDestUnreachs", N_("destination unreachable: %d"), i_inp_icmp|I_TITLE }, + { "InTimeExcds", N_("timeout in transit: %d"), i_inp_icmp|I_TITLE }, + { "InParmProbs", N_("wrong parameters: %d"), i_inp_icmp|I_TITLE }, /*?*/ + { "InSrcQuenchs", N_("source quenchs: %d"), i_inp_icmp|I_TITLE }, + { "InRedirects", N_("redirects: %d"), i_inp_icmp|I_TITLE }, + { "InEchos", N_("echo requests: %d"), i_inp_icmp|I_TITLE }, + { "InEchoReps", N_("echo replies: %d"), i_inp_icmp|I_TITLE }, + { "InTimestamps", N_("timestamp request: %d"), i_inp_icmp|I_TITLE }, + { "InTimestampReps", N_("timestamp reply: %d"), i_inp_icmp|I_TITLE }, + { "InAddrMasks", N_("address mask request: %d"), i_inp_icmp|I_TITLE }, /*?*/ + { "InAddrMaskReps", N_("address mask replies"), i_inp_icmp|I_TITLE }, /*?*/ + { "OutMsgs", N_("%d ICMP messages sent"), number }, + { "OutErrors", N_("%d ICMP messages failed"), number }, + { "OutDestUnreachs", N_("destination unreachable: %d"), i_outp_icmp|I_TITLE }, + { "OutTimeExcds", N_("time exceeded: %d"), i_outp_icmp|I_TITLE }, + { "OutParmProbs", N_("wrong parameters: %d"), i_outp_icmp|I_TITLE }, /*?*/ + { "OutSrcQuenchs", N_("source quench: %d"), i_outp_icmp|I_TITLE }, + { "OutRedirects", N_("redirect: %d"), i_outp_icmp|I_TITLE }, + { "OutEchos", N_("echo request: %d"), i_outp_icmp|I_TITLE }, + { "OutEchoReps", N_("echo replies: %d"), i_outp_icmp|I_TITLE }, + { "OutTimestamps", N_("timestamp requests: %d"), i_outp_icmp|I_TITLE }, + { "OutTimestampReps", N_("timestamp replies: %d"), i_outp_icmp|I_TITLE }, + { "OutAddrMasks", N_("address mask requests: %d"), i_outp_icmp|I_TITLE }, + { "OutAddrMaskReps", N_("address mask replies: %d"), i_outp_icmp|I_TITLE }, }; struct entry Tcptab[] = { - { N_("RtoAlgorithm"), N_("RTO algorithm is %s"), i_rto_alg|I_STATIC }, - { N_("RtoMin"), "", number }, - { N_("RtoMax"), "", number }, - { N_("MaxConn"), "", number }, - { N_("ActiveOpens"), N_("%d active opens"), number }, - { N_("PassiveOpens"), N_("%d passive opens"), number }, - { N_("AttemptFails"), N_("%d failed connection attempts"), number }, - { N_("EstabResets"), N_("%d connection resets received"), number }, - { N_("CurrEstab"), N_("%d connections established"), number }, - { N_("InSegs"), N_("%d segments received"), number }, - { N_("OutSegs"), N_("%d segments send out"), number }, - { N_("RetransSegs"), N_("%d segments retransmited"), number }, - { N_("InErrs"), N_("%d bad segments received."), number }, - { N_("OutRsts"), N_("%d resets sent"), number }, + { "RtoAlgorithm", N_("RTO algorithm is %s"), i_rto_alg|I_STATIC }, + { "RtoMin", "", number }, + { "RtoMax", "", number }, + { "MaxConn", "", number }, + { "ActiveOpens", N_("%d active opens"), number }, + { "PassiveOpens", N_("%d passive opens"), number }, + { "AttemptFails", N_("%d failed connection attempts"), number }, + { "EstabResets", N_("%d connection resets received"), number }, + { "CurrEstab", N_("%d connections established"), number }, + { "InSegs", N_("%d segments received"), number }, + { "OutSegs", N_("%d segments send out"), number }, + { "RetransSegs", N_("%d segments retransmited"), number }, + { "InErrs", N_("%d bad segments received."), number }, + { "OutRsts", N_("%d resets sent"), number }, }; struct entry Udptab[] = { - { N_("InDatagrams"), N_("%d packets received"), number }, - { N_("NoPorts"), N_("%d packets to unknown port received."), number }, - { N_("InErrors"), N_("%d packet receive errors"), number }, - { N_("OutDatagrams"), N_("%d packets send"), number }, + { "InDatagrams", N_("%d packets received"), number }, + { "NoPorts", N_("%d packets to unknown port received."), number }, + { "InErrors", N_("%d packet receive errors"), number }, + { "OutDatagrams", N_("%d packets send"), number }, }; struct tabtab { @@ -156,7 +162,7 @@ void printval(struct tabtab *tab, char *title, int val) ent = bsearch(&key, tab->tab, tab->size/sizeof(struct entry), sizeof(struct entry), cmpentries); if (!ent) { /* try our best */ - printf("%*s%s: %d\n", indent[state], "", _(title), val); + printf("%*s%s: %d\n", indent[state], "", title, val); return; } type = ent->type; @@ -177,17 +183,16 @@ void printval(struct tabtab *tab, char *title, int val) buf[0] = '\0'; switch (type) { case number: - sprintf(buf, _(ent->out), val); + snprintf(buf, sizeof(buf), _(ent->out), val); break; case i_forward: type = normal; - sprintf(buf, _(ent->out), val == 2 ? _("enabled") : _("disabled")); + snprintf(buf, sizeof(buf), _(ent->out), val == 2 ? _("enabled") : _("disabled")); break; case i_outp_icmp: case i_inp_icmp: - if (val > 0) { - sprintf(buf,_(ent->out), val); - } + if (val > 0) + snprintf(buf, sizeof(buf), _(ent->out), val); break; case i_rto_alg: /* XXXX */ break; |