~ubuntu-branches/debian/sid/mtr/sid

« back to all changes in this revision

Viewing changes to report.c

  • Committer: Package Import Robot
  • Author(s): Robert Woodcock
  • Date: 2011-12-25 09:40:19 UTC
  • mfrom: (1.2.5)
  • Revision ID: package-import@ubuntu.com-20111225094019-l9uruiviemyqs861
Tags: 0.82-1
New upstream version fixes FTBFS, closes: #650535

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
 
53
53
void report_close(void) 
54
54
{
55
 
  int i, j, at, max, z, w;
 
55
  int i, j, k, at, max, z, w;
 
56
  struct mplslen *mpls, *mplss;
56
57
  ip_t *addr;
57
58
  ip_t *addr2 = NULL;  
58
59
  char name[81];
102
103
  at  = net_min();
103
104
  for(; at < max; at++) {
104
105
    addr = net_addr(at);
 
106
    mpls = net_mpls(at);
105
107
    if( addrcmp( (void *) addr, (void *) &unspec_addr, af ) == 0 ) {
106
108
      sprintf(name, "???");
107
109
    } else {
138
140
     * This feature show 'loadbalances' on routes 
139
141
     */
140
142
    
141
 
   /* z is starting at 1 because addrs[0] is the same that addr */
 
143
    /* z is starting at 1 because addrs[0] is the same that addr */
142
144
    for (z = 1; z < MAXPATH ; z++) {
143
 
       addr2 = net_addrs(at, z);
144
 
       int found = 0;
145
 
       if ((addrcmp ((void *) &unspec_addr, (void *) addr2, af)) == 0)
146
 
          break;
 
145
      addr2 = net_addrs(at, z);
 
146
      mplss = net_mplss(at, z);
 
147
      int found = 0;
 
148
      if ((addrcmp ((void *) &unspec_addr, (void *) addr2, af)) == 0)
 
149
        break;
147
150
      for (w = 0; w < z; w++)
148
151
        /* Thales -- Ok... checking if there are ips repeated on same hop */
149
 
           if ((addrcmp ((void *) addr2, (void *) net_addrs (at,w), af)) == 0) {
150
 
              found = 1;
151
 
              break;
152
 
           }   
153
 
       if (!found) {
154
 
        if (z == 1)  
 
152
        if ((addrcmp ((void *) addr2, (void *) net_addrs (at,w), af)) == 0) {
 
153
           found = 1;
 
154
           break;
 
155
        }   
 
156
 
 
157
      if (!found) {
 
158
  
 
159
        if (mpls->labels && z == 1 && enablempls) {
 
160
          for (k=0; k < mpls->labels; k++) {
 
161
            printf("    |  |+-- [MPLS: Lbl %lu Exp %u S %u TTL %u]\n", mpls->label[k], mpls->exp[k], mpls->s[k], mpls->ttl[k]);
 
162
          }
 
163
        }
 
164
 
 
165
        if (z == 1) {
155
166
          printf ("    |  `|-- %s\n", strlongip(addr2));
156
 
        else 
 
167
          for (k=0; k < mplss->labels && enablempls; k++) {
 
168
            printf("    |   +-- [MPLS: Lbl %lu Exp %u S %u TTL %u]\n", mplss->label[k], mplss->exp[k], mplss->s[k], mplss->ttl[k]);
 
169
          }
 
170
        } else {
157
171
          printf ("    |   |-- %s\n", strlongip(addr2));
158
 
       }
 
172
          for (k=0; k < mplss->labels && enablempls; k++) {
 
173
            printf("    |   +-- [MPLS: Lbl %lu Exp %u S %u TTL %u]\n", mplss->label[k], mplss->exp[k], mplss->s[k], mplss->ttl[k]);
 
174
          }
 
175
        }
 
176
      }
 
177
    }
 
178
 
 
179
    /* No multipath */
 
180
    if(mpls->labels && z == 1 && enablempls) {
 
181
      for (k=0; k < mpls->labels; k++) {
 
182
        printf("    |   +-- [MPLS: Lbl %lu Exp %u S %u TTL %u]\n", mpls->label[k], mpls->exp[k], mpls->s[k], mpls->ttl[k]);
 
183
      }
159
184
    }
160
185
  }
161
186
}