Hello community,

here is the log from the commit of package mtr for openSUSE:Factory checked in 
at 2011-12-21 17:00:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mtr (Old)
 and      /work/SRC/openSUSE:Factory/.mtr.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mtr", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/mtr/mtr.changes  2011-10-11 17:04:15.000000000 
+0200
+++ /work/SRC/openSUSE:Factory/.mtr.new/mtr.changes     2011-12-21 
17:00:20.000000000 +0100
@@ -1,0 +2,13 @@
+Thu Dec 15 10:36:54 UTC 2011 - [email protected]
+
+- update to mtr-0.82
+  * Enable decoding of ICMP extensions for MPLS for curses and 
+    report interfaces. Use the -e flag or press 'e' to enable it.
+- fix spec license to GPL-2 (bnc#735559)
+
+-------------------------------------------------------------------
+Fri Dec  2 15:51:13 UTC 2011 - [email protected]
+
+- add automake as buildrequire to avoid implicit dependency
+
+-------------------------------------------------------------------

Old:
----
  mtr-0.81.tar.bz2

New:
----
  mtr-0.82.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mtr.spec ++++++
--- /var/tmp/diff_new_pack.ygtzXx/_old  2011-12-21 17:00:21.000000000 +0100
+++ /var/tmp/diff_new_pack.ygtzXx/_new  2011-12-21 17:00:21.000000000 +0100
@@ -15,19 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-# norootforbuild
-
-
 Name:           mtr
+BuildRequires:  automake
 BuildRequires:  gtk2-devel
 BuildRequires:  ncurses-devel
 BuildRequires:  update-desktop-files
 BuildRequires:  xorg-x11-devel
 Summary:        Ping and Traceroute Network Diagnostic Tool
-Version:        0.81
-Release:        2
+License:        GPL-2.0
 Group:          Productivity/Networking/Diagnostic
-License:        GPLv2+
+Version:        0.82
+Release:        0
 Url:            http://www.BitWizard.nl/mtr
 Source:         %{name}-%{version}.tar.bz2
 Source1:        xmtr.desktop
@@ -48,9 +46,7 @@
 Find the graphical version in the mtr-gtk package.
 
 %package gtk
-License:        GPLv2+
 Summary:        Ping and Traceroute Network Diagnostic Tool
-Group:          Productivity/Networking/Diagnostic
 
 %description gtk
 Mtr is a network diagnostic tool which combines Ping and Traceroute

++++++ mtr-0.75-manxmtr.patch ++++++
--- /var/tmp/diff_new_pack.ygtzXx/_old  2011-12-21 17:00:21.000000000 +0100
+++ /var/tmp/diff_new_pack.ygtzXx/_new  2011-12-21 17:00:21.000000000 +0100
@@ -14,9 +14,9 @@
 -.B mtr 
 +.B xmtr 
  [\c
- .B \-hvrctglspniu46\c
+ .B \-hvrctglspeniu46\c
  ]
-@@ -54,7 +54,7 @@ mtr \- a network diagnostic tool
+@@ -57,7 +57,7 @@ mtr \- a network diagnostic tool
  
  .SH DESCRIPTION
  
@@ -25,7 +25,7 @@
  combines the functionality of the 
  .B traceroute
  and 
-@@ -63,9 +63,9 @@ programs in a single network diagnostic
+@@ -66,9 +66,9 @@ programs in a single network diagnostic
  
  .PP
  As 
@@ -37,7 +37,7 @@
  runs on and 
  .BR HOSTNAME . 
  by sending packets with purposly low TTLs. It continues to send
-@@ -92,7 +92,7 @@ Print the summary of command line argume
+@@ -95,7 +95,7 @@ Print the summary of command line argume
  .TP
  .B \-\-version
  .br
@@ -46,7 +46,7 @@
  
  .TP
  .B \-r
-@@ -100,11 +100,11 @@ Print the installed version of mtr.
+@@ -103,11 +103,11 @@ Print the installed version of mtr.
  .B \-\-report
  .br
  This option puts 
@@ -60,7 +60,7 @@
  will run for the number of cycles specified by the 
  .B \-c
  option, and then print statistics and exit.  
-@@ -112,9 +112,9 @@ option, and then print statistics and ex
+@@ -115,9 +115,9 @@ option, and then print statistics and ex
  \c
  This mode is useful for generating statistics about network quality.  
  Note that each running instance of 
@@ -72,7 +72,7 @@
  to measure the quality of your network may result in decreased
  network performance.  
  
-@@ -157,7 +157,7 @@ packetsize upto that number.
+@@ -160,7 +160,7 @@ packetsize upto that number.
  .B \-\-curses
  .br
  Use this option to force 
@@ -81,7 +81,7 @@
  to use the curses based terminal
  interface (if available).
  
-@@ -167,7 +167,7 @@ interface (if available).
+@@ -180,7 +180,7 @@ that are encoded in the response packets
  .B \-\-no-dns
  .br
  Use this option to force 
@@ -90,7 +90,7 @@
  to display numeric IP numbers and not try to resolve the
  host names. 
  
-@@ -187,10 +187,10 @@ Example:
+@@ -200,10 +200,10 @@ Example:
  .B \-\-gtk
  .br
  Use this option to force
@@ -103,7 +103,7 @@
  was built for this to work.  See the GTK+ web page at 
  .B http://www.gimp.org/gtk/
  for more information about GTK+.
-@@ -201,7 +201,7 @@ for more information about GTK+.
+@@ -214,7 +214,7 @@ for more information about GTK+.
  .B \-\-split
  .br
  Use this option to set
@@ -112,7 +112,7 @@
  to spit out a format that is suitable for a split-user interface.
  
  .TP
-@@ -210,7 +210,7 @@ to spit out a format that is suitable fo
+@@ -223,7 +223,7 @@ to spit out a format that is suitable fo
  .B \-\-raw
  .br
  Use this option to tell 
@@ -121,7 +121,7 @@
  to use the raw output format. This format is better suited for
  archival of the measurement results. It could be parsed to 
  be presented into any of the other display methods. 
-@@ -253,7 +253,7 @@ Use IPv6 only.
+@@ -266,7 +266,7 @@ Use IPv6 only.
  Some modern routers give a lower priority to ICMP ECHO packets than 
  to other network traffic.  Consequently, the reliability of these
  routers reported by 

++++++ mtr-0.81.tar.bz2 -> mtr-0.82.tar.bz2 ++++++
++++ 2507 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/.gitignore new/mtr-0.82/.gitignore
--- old/mtr-0.81/.gitignore     1970-01-01 01:00:00.000000000 +0100
+++ new/mtr-0.82/.gitignore     2011-12-02 14:13:42.000000000 +0100
@@ -0,0 +1,2 @@
+autom4te.cache
+.deps
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/.version new/mtr-0.82/.version
--- old/mtr-0.81/.version       1970-01-01 01:00:00.000000000 +0100
+++ new/mtr-0.82/.version       2011-11-07 12:04:50.000000000 +0100
@@ -0,0 +1 @@
+0.82
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/ChangeLog new/mtr-0.82/ChangeLog
--- old/mtr-0.81/ChangeLog      2008-08-19 18:55:47.000000000 +0200
+++ new/mtr-0.82/ChangeLog      1970-01-01 01:00:00.000000000 +0100
@@ -1,13 +0,0 @@
-2002-03-06  Cougar <[email protected]>
-       + If hop doesn't respond, draw its name in red (GTK) or bold (curses)
-
-2002-02-09  bodq  <[email protected]>
-       * Added --address option to bind to given IP addess
-
-2001-04-15  root  <[email protected]>
-
-       * Added this file so that automake won't complain.
-       * Commented out the test for res_init in configure.in;
-       it does not work for GLIBC2 systems (e.g., RedHat 7+).
-       * Fixed the subordinate CHECK_LIBS on the test for res_mkquery,
-       so that they test for res_mkquery, not res_init.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/Makefile new/mtr-0.82/Makefile
--- old/mtr-0.81/Makefile       1970-01-01 01:00:00.000000000 +0100
+++ new/mtr-0.82/Makefile       2011-12-02 14:11:20.000000000 +0100
@@ -0,0 +1,16 @@
+
+#
+# This is an attempt on simplifying the compilation of mtr to a simple "make". 
+#
+
+firstrule: 
+       ./configure 
+       $(MAKE)
+
+clean: 
+       rm -f *.o *~ core
+
+distclean: clean
+       rm -f mtr config.cache config.status config.log \
+                 stamp-h stamp-h[0-9]* TAGS ID
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/NEWS new/mtr-0.82/NEWS
--- old/mtr-0.81/NEWS   2011-10-07 00:55:02.000000000 +0200
+++ new/mtr-0.82/NEWS   2011-12-02 14:11:21.000000000 +0100
@@ -1,7 +1,10 @@
 WHAT'S NEW?
-  V0.81 Fix for https://bugs.launchpad.net/mtr/+bug/776211
-        don't have time right now to integrate some submitted patches. 
-        Sorry.
+  V0.82 Removed old Changelog file appended at the end as oldest
+        changes. 
+        2011-03-28  Mark Kamichoff <[email protected]>
+        Enable decoding of ICMP extensions for MPLS for curses and 
+       report interfaces.  Use the -e flag or press 'e' to enable it.
+  V0.81 Moved to git. Testing git...
   V0.80 Some compilation fixes for BSD by Jeremy Chadwick 
         <[email protected]>
   V0.78/0.79 some compilation fixes for BSD&others by 
@@ -273,3 +276,20 @@
        Both the build process and the networking code have
        been cleaned up and reorganized.  mtr now builds 
        cleanly with GTK+ 0.99.8.  
+
+--- Below is the contents of the old "Changelog file" that annoyed some
+people as it didn't contain any recent changes/news. 
+
+2002-03-06  Cougar <[email protected]>
+       + If hop doesn't respond, draw its name in red (GTK) or bold (curses)
+
+2002-02-09  bodq  <[email protected]>
+       * Added --address option to bind to given IP addess
+
+2001-04-15  root  <[email protected]>
+
+       * Added this file so that automake won't complain.
+       * Commented out the test for res_init in configure.in;
+       it does not work for GLIBC2 systems (e.g., RedHat 7+).
+       * Fixed the subordinate CHECK_LIBS on the test for res_mkquery,
+       so that they test for res_mkquery, not res_init.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/configure.in new/mtr-0.82/configure.in
--- old/mtr-0.81/configure.in   2010-07-13 08:33:48.000000000 +0200
+++ new/mtr-0.82/configure.in   2011-12-02 13:52:38.000000000 +0100
@@ -1,5 +1,5 @@
 AC_INIT(mtr.c)
-AM_INIT_AUTOMAKE(mtr, 0.81)
+AM_INIT_AUTOMAKE(mtr, 0.82)
 
 
 AC_SUBST(GTK_OBJ)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/curses.c new/mtr-0.82/curses.c
--- old/mtr-0.81/curses.c       2008-10-10 20:51:25.000000000 +0200
+++ new/mtr-0.82/curses.c       2011-12-02 14:11:21.000000000 +0100
@@ -111,6 +111,8 @@
     return ActionReset;
   if (tolower(c) == 'd')
     return ActionDisplay;
+  if (tolower(c) == 'e')
+    return ActionMPLS;
   if (tolower(c) == 'n')
     return ActionDNS;
   if (c == '+')
@@ -263,6 +265,7 @@
     mvprintw(2, 0, "Command:\n" );
     printw("  ?|h     help\n" );
     printw("  d       switching display mode\n" );
+    printw("  e       toggle MPLS information on/off\n" );
     printw("  n       toggle DNS on/off\n" );
     printw("  o str   set the columns to display, default str='LRS N BAWV'\n" 
);
     printw("  j       toggle latency(LS NABWV)/jitter(DR AGJMXI) stats\n" );
@@ -288,11 +291,12 @@
 {
   int max;
   int at;
+  struct mplslen *mpls, *mplss;
   ip_t *addr, *addrs;
   int y, x;
   char *name;
 
-  int i, j;
+  int i, j, k;
   int hd_len;
   char buf[1024];
 
@@ -301,6 +305,7 @@
   for(at = net_min () + display_offset; at < max; at++) {
     printw("%2d. ", at + 1);
     addr = net_addr(at);
+    mpls = net_mpls(at);
 
     if( addrcmp( (void *) addr, (void *) &unspec_addr, af ) != 0 ) {
       name = dns_lookup(addr);
@@ -339,9 +344,20 @@
       buf[hd_len] = 0;
       printw("%s", buf);
 
+      for (k=0; k < mpls->labels && enablempls; k++) {
+        if((k+1 < mpls->labels) || (mpls->labels == 1)) {
+           /* if we have more labels */
+           printw("\n    [MPLS: Lbl %lu Exp %u S %u TTL %u]", mpls->label[k], 
mpls->exp[k], mpls->s[k], mpls->ttl[k]);
+        } else {
+           /* bottom label */
+           printw("\n    [MPLS: Lbl %lu Exp %u S %u TTL %u]", mpls->label[k], 
mpls->exp[k], mpls->s[k], mpls->ttl[k]);
+        }
+      }
+
       /* Multi path by Min */
       for (i=0; i < MAXPATH; i++ ) {
         addrs = net_addrs(at, i);
+        mplss = net_mplss(at, i);
        if ( addrcmp( (void *) addrs, (void *) addr, af ) == 0 ) continue;
        if ( addrcmp( (void *) addrs, (void *) &unspec_addr, af ) == 0 ) break;
 
@@ -352,6 +368,9 @@
         } else {
          printw("\n    %s", strlongip( addrs ) );
         }
+        for (k=0; k < mplss->labels && enablempls; k++) {
+          printw("\n    [MPLS: Lbl %lu Exp %u S %u TTL %u]", mplss->label[k], 
mplss->exp[k], mplss->s[k], mplss->ttl[k]);
+        }
         attroff(A_BOLD);
       }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/display.h new/mtr-0.82/display.h
--- old/mtr-0.81/display.h      2008-10-10 20:48:24.000000000 +0200
+++ new/mtr-0.82/display.h      2011-12-02 14:11:21.000000000 +0100
@@ -21,7 +21,7 @@
 /* Don't put a trailing comma in enumeration lists. Some compilers 
    (notably the one on Irix 5.2) do not like that. -- REW */ 
 enum { ActionNone,  ActionQuit,  ActionReset,  ActionDisplay, 
-       ActionClear, ActionPause, ActionResume, ActionDNS, 
+       ActionClear, ActionPause, ActionResume, ActionMPLS, ActionDNS, 
        ActionScrollDown, ActionScrollUp  };
 enum { DisplayReport, DisplayCurses, DisplayGTK, DisplaySplit, 
        DisplayRaw,    DisplayXML,    DisplayCSV, DisplayTXT};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/mtr.8 new/mtr-0.82/mtr.8
--- old/mtr-0.81/mtr.8  2008-09-18 14:40:09.000000000 +0200
+++ new/mtr-0.82/mtr.8  2011-12-02 14:11:21.000000000 +0100
@@ -8,7 +8,7 @@
 .SH SYNOPSIS
 .B mtr 
 [\c
-.B \-hvrctglspniu46\c
+.B \-hvrctglspeniu46\c
 ]
 [\c
 .B \-\-help\c
@@ -35,6 +35,9 @@
 .B \-\-raw\c
 ]
 [\c
+.B \-\-mpls\c
+]
+[\c
 .B \-\-no-dns\c
 ]
 [\c
@@ -162,6 +165,16 @@
 interface (if available).
 
 .TP
+.B \-e
+.TP
+.B \-\-mpls
+.br
+Use this option to tell 
+.B mtr 
+to display information from ICMP extensions for MPLS (RFC 4950)
+that are encoded in the response packets.
+
+.TP
 .B \-n
 .TP
 .B \-\-no-dns
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/mtr.c new/mtr-0.82/mtr.c
--- old/mtr-0.81/mtr.c  2009-05-12 12:05:13.000000000 +0200
+++ new/mtr-0.82/mtr.c  2011-12-02 14:11:21.000000000 +0100
@@ -60,6 +60,7 @@
 char *InterfaceAddress = NULL;
 char  LocalHostname[128];
 int   dns = 1;
+int   enablempls = 0;
 int   cpacketsize = 64;          /* default packet size */
 int   bitpattern = 0;
 int   tos = 0;
@@ -141,6 +142,7 @@
                                   overload psize<0, ->rand(min,max) */
     { "bitpattern", 1, 0, 'b' },/* overload b>255, ->rand(0,255) */
     { "tos", 1, 0, 'Q' },      /* typeof service (0,255) */
+    { "mpls", 0, 0, 'e' },
     { "no-dns", 0, 0, 'n' },
     { "address", 1, 0, 'a' },
     { "first-ttl", 1, 0, 'f' },        /* -f & -m are borrowed from traceroute 
*/
@@ -155,7 +157,7 @@
   while(1) {
     /* added f:m:o: byMin */
     opt = getopt_long(argc, argv,
-                     "vhrwxtglpo:i:c:s:b:Q:na:f:m:u46", long_options, NULL);
+                     "vhrwxtglpo:i:c:s:b:Q:ena:f:m:u46", long_options, NULL);
     if(opt == -1)
       break;
 
@@ -199,6 +201,9 @@
     case 'a':
       InterfaceAddress = optarg;
       break;
+    case 'e':
+      enablempls = 1;
+      break;
     case 'n':
       dns = 0;
       break;
@@ -377,7 +382,7 @@
   if (PrintHelp) {
     printf("usage: %s [-hvrwctglspniu46] [--help] [--version] [--report]\n"
           "\t\t[--report-wide] [--report-cycles=COUNT] [--curses] [--gtk]\n"
-           "\t\t[--raw] [--split] [--no-dns] [--address interface]\n" /* BL */
+           "\t\t[--raw] [--split] [--mpls] [--no-dns] [--address interface]\n" 
/* BL */
            "\t\t[--psize=bytes/-s bytes]\n"            /* ok */
            "\t\t[--report-wide|-w] [-u]\n"            /* rew */
           "\t\t[--interval=SECONDS] HOSTNAME [PACKETSIZE]\n", argv[0]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/mtr.h new/mtr-0.82/mtr.h
--- old/mtr-0.81/mtr.h  2008-10-10 20:49:48.000000000 +0200
+++ new/mtr-0.82/mtr.h  2011-12-02 14:11:21.000000000 +0100
@@ -58,6 +58,7 @@
 typedef struct in_addr ip_t;
 #endif
 
+extern int enablempls;
 extern int dns;
 extern int use_dns;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/net.c new/mtr-0.82/net.c
--- old/mtr-0.81/net.c  2010-07-13 08:10:33.000000000 +0200
+++ new/mtr-0.82/net.c  2011-12-02 14:11:21.000000000 +0100
@@ -122,6 +122,8 @@
   int transit;
   int saved[SAVED_PINGS];
   int saved_seq_offset;
+  struct mplslen mpls;
+  struct mplslen mplss[MAXPATH];
 };
 
 
@@ -434,7 +436,7 @@
 
 /*   We got a return on something we sent out.  Record the address and
      time.  */
-void net_process_ping(int seq, void * addr, struct timeval now) 
+void net_process_ping(int seq, struct mplslen mpls, void * addr, struct 
timeval now) 
 {
   int index;
   int totusec;
@@ -467,10 +469,12 @@
                (void *) &unspec_addr, af ) == 0 ) {
     /* should be out of if as addr can change */
     addrcpy( (void *) &(host[index].addr), addrcopy, af );
+    host[index].mpls = mpls;
     display_rawhost(index, (void *) &(host[index].addr));
 
   /* multi paths by Min */
     addrcpy( (void *) &(host[index].addrs[0]), addrcopy, af );
+    host[index].mplss[0] = mpls;
   } else {
     for( i=0; i<MAXPATH; ) {
       if( addrcmp( (void *) &(host[index].addrs[i]), (void *) &addrcopy,
@@ -482,6 +486,7 @@
     if( addrcmp( (void *) &(host[index].addrs[i]), addrcopy, af ) != 0 && 
         i<MAXPATH ) {
       addrcpy( (void *) &(host[index].addrs[i]), addrcopy, af );
+      host[index].mplss[i] = mpls;
       
       /* rafaelmartins: multi path support to '--raw' */
       display_rawhost(index, (void *) &(host[index].addrs[i]));
@@ -565,6 +570,10 @@
   int echoreplytype = 0, timeexceededtype = 0, unreachabletype = 0;
   int sequence = 0;
 
+  /* MPLS decoding */
+  struct mplslen mpls;
+  mpls.labels = 0;
+
   gettimeofday(&now, NULL);
   switch ( af ) {
   case AF_INET:
@@ -623,6 +632,10 @@
         header = (struct ICMPHeader *)(packet + sizeof (struct IPHeader) + 
                                                 sizeof (struct ICMPHeader) + 
                                                 sizeof (struct IPHeader));
+
+        if(num > 160)
+          decodempls(num, packet, &mpls, 156);
+
       break;
 #ifdef ENABLE_IPV6
       case AF_INET6:
@@ -632,6 +645,10 @@
         header = (struct ICMPHeader *) ( packet + 
                                          sizeof (struct ICMPHeader) +
                                          sizeof (struct ip6_hdr) );
+
+        if(num > 140)
+          decodempls(num, packet, &mpls, 136);
+
         break;
 #endif
       }
@@ -656,6 +673,10 @@
         udpheader = (struct UDPHeader *)(packet + sizeof (struct IPHeader) +
                                                   sizeof (struct ICMPHeader) +
                                                   sizeof (struct IPHeader));
+
+        if(num > 160)
+          decodempls(num, packet, &mpls, 156);
+
       break;
 #ifdef ENABLE_IPV6
       case AF_INET6:
@@ -665,6 +686,10 @@
         udpheader = (struct UDPHeader *) ( packet +
                                            sizeof (struct ICMPHeader) +
                                            sizeof (struct ip6_hdr) );
+
+        if(num > 140)
+          decodempls(num, packet, &mpls, 136);
+
         break;
 #endif
       }
@@ -674,7 +699,7 @@
   }
 
   if (sequence)
-    net_process_ping(sequence, (void *)fromaddress, now);
+    net_process_ping (sequence, mpls, (void *) fromaddress, now);
 }
 
 
@@ -689,6 +714,15 @@
   return (ip_t *)&(host[at].addrs[i]);
 }
 
+void *net_mpls(int at)
+{
+  return (struct mplslen *)&(host[at].mplss);
+}
+
+void *net_mplss(int at, int i)
+{
+  return (struct mplslen *)&(host[at].mplss[i]);
+}
 
 int net_loss(int at) 
 {
@@ -1261,3 +1295,42 @@
 #endif
   }
 }
+
+/* Decode MPLS */
+void decodempls(int num, char *packet, struct mplslen *mpls, int offset) {
+
+  int i;
+  unsigned int ext_ver, ext_res, ext_chk, obj_hdr_len;
+  u_char obj_hdr_class, obj_hdr_type;
+
+  /* loosely derived from the traceroute-nanog.c
+   * decoding by Jorge Boncompte */
+  ext_ver = packet[offset]>>4;
+  ext_res = (packet[offset]&15)+ packet[offset+1];
+  ext_chk = ((unsigned int)packet[offset+2]<<8)+packet[offset+3];
+
+  /* Check for ICMP extension header */
+  if (ext_ver == 2 && ext_res == 0 && ext_chk != 0 && num >= (offset+6)) {
+    obj_hdr_len = ((int)packet[offset+4]<<8)+packet[offset+5];
+    obj_hdr_class = packet[offset+6];
+    obj_hdr_type = packet[offset+7];
+
+    /* make sure we have an MPLS extension */
+    if (obj_hdr_len >= 8 && obj_hdr_class == 1 && obj_hdr_type == 1) {
+      /* how many labels do we have?  will be at least 1 */
+      mpls->labels = (obj_hdr_len-4)/4;
+
+      /* save all label objects */
+      for(i=0; (i<mpls->labels) && (i < MAXLABELS) && (num >= 
(offset+8)+(i*4)); i++) {
+
+        /* piece together the 20 byte label value */
+        mpls->label[i] = ((unsigned long) (packet[(offset+8)+(i*4)] << 12 & 
0xff000) +
+            (unsigned int) (packet[(offset+9)+(i*4)] << 4 & 0xff0) +
+            (packet[(offset+10)+(i*4)] >> 4 & 0xf));
+        mpls->exp[i] = (packet[(offset+10)+(i*4)] >> 1) & 0x7;
+        mpls->s[i] = (packet[(offset+10)+(i*4)] & 0x1); /* should be 1 if only 
one label */
+        mpls->ttl[i] = packet[(offset+11)+(i*4)];
+      }
+    }
+  }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/net.h new/mtr-0.82/net.h
--- old/mtr-0.81/net.h  2008-10-10 20:50:04.000000000 +0200
+++ new/mtr-0.82/net.h  2011-12-02 14:11:21.000000000 +0100
@@ -40,6 +40,8 @@
 int net_min(void);
 int net_last(int at);
 ip_t * net_addr(int at);
+void * net_mpls(int at);
+void * net_mplss(int, int);
 int net_loss(int at);
 int net_drop(int at);
 int net_last(int at);
@@ -86,6 +88,7 @@
 
 #define MAXPACKET 4470         /* largest test packet size */
 #define MINPACKET 28           /* 20 bytes IP header and 8 bytes ICMP or UDP */
+#define MAXLABELS 8            /* http://kb.juniper.net/KB2190 (+ 3 just in 
case) */
 
 /* stuff used by display such as report, curses... --Min */
 #define MAXFLD 20              /* max stats fields to display */
@@ -119,3 +122,14 @@
 extern char available_options[];
 
 ip_t unspec_addr;
+
+/* MPLS label object */
+struct mplslen {
+  unsigned long label[MAXLABELS]; /* label value */
+  uint8 exp[MAXLABELS]; /* experimental bits */
+  uint8 ttl[MAXLABELS]; /* MPLS TTL */
+  char s[MAXLABELS]; /* bottom of stack */
+  char labels; /* how many labels did we get? */
+};
+
+void decodempls(int, char *, struct mplslen *, int);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/report.c new/mtr-0.82/report.c
--- old/mtr-0.81/report.c       2010-05-31 17:53:21.000000000 +0200
+++ new/mtr-0.82/report.c       2011-12-02 14:11:21.000000000 +0100
@@ -52,7 +52,8 @@
 
 void report_close(void) 
 {
-  int i, j, at, max, z, w;
+  int i, j, k, at, max, z, w;
+  struct mplslen *mpls, *mplss;
   ip_t *addr;
   ip_t *addr2 = NULL;  
   char name[81];
@@ -102,6 +103,7 @@
   at  = net_min();
   for(; at < max; at++) {
     addr = net_addr(at);
+    mpls = net_mpls(at);
     if( addrcmp( (void *) addr, (void *) &unspec_addr, af ) == 0 ) {
       sprintf(name, "???");
     } else {
@@ -138,24 +140,47 @@
      * This feature show 'loadbalances' on routes 
      */
     
-   /* z is starting at 1 because addrs[0] is the same that addr */
+    /* z is starting at 1 because addrs[0] is the same that addr */
     for (z = 1; z < MAXPATH ; z++) {
-       addr2 = net_addrs(at, z);
-       int found = 0;
-       if ((addrcmp ((void *) &unspec_addr, (void *) addr2, af)) == 0)
-          break;
+      addr2 = net_addrs(at, z);
+      mplss = net_mplss(at, z);
+      int found = 0;
+      if ((addrcmp ((void *) &unspec_addr, (void *) addr2, af)) == 0)
+        break;
       for (w = 0; w < z; w++)
         /* Thales -- Ok... checking if there are ips repeated on same hop */
-           if ((addrcmp ((void *) addr2, (void *) net_addrs (at,w), af)) == 0) 
{
-              found = 1;
-              break;
-           }   
-       if (!found) {
-        if (z == 1)  
+        if ((addrcmp ((void *) addr2, (void *) net_addrs (at,w), af)) == 0) {
+           found = 1;
+           break;
+        }   
+
+      if (!found) {
+  
+        if (mpls->labels && z == 1 && enablempls) {
+          for (k=0; k < mpls->labels; k++) {
+            printf("    |  |+-- [MPLS: Lbl %lu Exp %u S %u TTL %u]\n", 
mpls->label[k], mpls->exp[k], mpls->s[k], mpls->ttl[k]);
+          }
+        }
+
+        if (z == 1) {
           printf ("    |  `|-- %s\n", strlongip(addr2));
-        else 
+          for (k=0; k < mplss->labels && enablempls; k++) {
+            printf("    |   +-- [MPLS: Lbl %lu Exp %u S %u TTL %u]\n", 
mplss->label[k], mplss->exp[k], mplss->s[k], mplss->ttl[k]);
+          }
+        } else {
           printf ("    |   |-- %s\n", strlongip(addr2));
-       }
+          for (k=0; k < mplss->labels && enablempls; k++) {
+            printf("    |   +-- [MPLS: Lbl %lu Exp %u S %u TTL %u]\n", 
mplss->label[k], mplss->exp[k], mplss->s[k], mplss->ttl[k]);
+          }
+        }
+      }
+    }
+
+    /* No multipath */
+    if(mpls->labels && z == 1 && enablempls) {
+      for (k=0; k < mpls->labels; k++) {
+        printf("    |   +-- [MPLS: Lbl %lu Exp %u S %u TTL %u]\n", 
mpls->label[k], mpls->exp[k], mpls->s[k], mpls->ttl[k]);
+      }
     }
   }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mtr-0.81/select.c new/mtr-0.82/select.c
--- old/mtr-0.81/select.c       2011-06-27 18:11:17.000000000 +0200
+++ new/mtr-0.82/select.c       2011-12-02 14:11:21.000000000 +0100
@@ -43,8 +43,6 @@
 int display_offset = 0;
 
 
-#define GRACETIME (5 * 1000*1000)
-
 void select_loop(void) {
   fd_set readfd;
   int anyset = 0;
@@ -53,11 +51,8 @@
   int NumPing = 0;
   int paused = 0;
   struct timeval lasttime, thistime, selecttime;
-  struct timeval startgrace, stopgrace;
   int dt;
   int rv; 
-  int graceperiod = 0;
-
 
   gettimeofday(&lasttime, NULL);
 
@@ -92,6 +87,7 @@
        selecttime.tv_usec = 0;
       
        rv = select(maxfd, (void *)&readfd, NULL, NULL, &selecttime);
+
       } else {
        if(Interactive) display_redraw();
 
@@ -101,21 +97,10 @@
           (thistime.tv_sec == lasttime.tv_sec + intervaltime.tv_sec &&
            thistime.tv_usec >= lasttime.tv_usec + intervaltime.tv_usec)) {
          lasttime = thistime;
-         if (!graceperiod) {
-           if(NumPing >= MaxPing && (!Interactive || ForceMaxPing)) {
-             graceperiod=1;
-              startgrace=thistime;
-             //gettimeofday (&startgrace, NULL);
-           }
-           if (net_send_batch())
-             NumPing++;
-          }
-       }
-       if (graceperiod) {
-        // gettimeofday(&thistime, NULL);
-         dt =        (thistime.tv_usec - startgrace.tv_usec) + 
-           1000000 * (thistime.tv_sec - startgrace.tv_sec);
-         if (dt > GRACETIME) return;
+         if(NumPing >= MaxPing && (!Interactive || ForceMaxPing))
+           return;
+         if (net_send_batch())
+           NumPing++;
        }
 
        selecttime.tv_usec = (thistime.tv_usec - lasttime.tv_usec);
@@ -189,6 +174,10 @@
       case  ActionResume:
        paused=0;
        break;
+      case ActionMPLS:
+          enablempls = !enablempls;
+          display_clear();
+       break;
       case ActionDNS:
        if (dns) {
          use_dns = !use_dns;


-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to