diff options
author | Jeffrey C. Ollie <jeff@ocjtech.us> | 2007-04-09 15:36:33 -0500 |
---|---|---|
committer | Jeffrey C. Ollie <jeff@ocjtech.us> | 2007-04-09 15:36:33 -0500 |
commit | 37e11172f8ed157340783b73d56595bb02d0a2d2 (patch) | |
tree | 65163a9cdb8ded9c55c94da92e8a6327bda9067c /bgpd/bgp_aspath.c | |
parent | 8d3e3ccfd0d0cb82b253f937339d1c6189a2bf54 (diff) | |
parent | 43cd33a44e010f818633b7f144b5a0be352b41e7 (diff) | |
download | quagga-37e11172f8ed157340783b73d56595bb02d0a2d2.tar.bz2 quagga-37e11172f8ed157340783b73d56595bb02d0a2d2.tar.xz |
Merge commit 'quagga_0_99_6_release' into linux-realmsquagga-0.99.6-realms.patch
Diffstat (limited to 'bgpd/bgp_aspath.c')
-rw-r--r-- | bgpd/bgp_aspath.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c index 317e9f8d..327406fa 100644 --- a/bgpd/bgp_aspath.c +++ b/bgpd/bgp_aspath.c @@ -434,6 +434,26 @@ aspath_size (struct aspath *aspath) return size; } +/* Return highest public ASN in path */ +as_t +aspath_highest (struct aspath *aspath) +{ + struct assegment *seg = aspath->segments; + as_t highest = 0; + unsigned int i; + + while (seg) + { + for (i = 0; i < seg->length; i++) + if (seg->as[i] > highest + && (seg->as[i] < BGP_PRIVATE_AS_MIN + || seg->as[i] > BGP_PRIVATE_AS_MAX)) + highest = seg->as[i]; + seg = seg->next; + } + return highest; +} + /* Convert aspath structure to string expression. */ static char * aspath_make_str_count (struct aspath *as) |