~ubuntu-branches/ubuntu/saucy/quagga/saucy

« back to all changes in this revision

Viewing changes to bgpd/bgp_aspath.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2006-12-20 14:38:36 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20061220143836-bmbwdczd352ebz1d
Tags: 0.99.6-2ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/patches/81_32bit_u64.dpatch: Define __u64 as uint64_t
    before including the netlink headers, since that symbol does not exist
    by default on 32 bit arches. Fixes i386/powerpc FTBFS.
  - debian/patches/83_ifaddr_defs.dpatch:
    zebra/rt_netlink.c: #include <linux/if_addr.h> and define IF[L]A_RTA
    macros, so that the file compiles again with our kernel headers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
434
434
  return size;
435
435
}
436
436
 
 
437
/* Return highest public ASN in path */
 
438
as_t
 
439
aspath_highest (struct aspath *aspath)
 
440
{
 
441
  struct assegment *seg = aspath->segments;
 
442
  as_t highest = 0;
 
443
  unsigned int i;
 
444
  
 
445
  while (seg)
 
446
    {
 
447
      for (i = 0; i < seg->length; i++)
 
448
        if (seg->as[i] > highest
 
449
            && (seg->as[i] < BGP_PRIVATE_AS_MIN
 
450
                || seg->as[i] > BGP_PRIVATE_AS_MAX))
 
451
          highest = seg->as[i];
 
452
      seg = seg->next;
 
453
    }
 
454
  return highest;
 
455
}
 
456
 
437
457
/* Convert aspath structure to string expression. */
438
458
static char *
439
459
aspath_make_str_count (struct aspath *as)