-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add path-info parsing to announce attributes #1147
- Loading branch information
1 parent
ad4f72f
commit fb49031
Showing
6 changed files
with
81 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
process announce-routes { | ||
run ./run/api-attributes-path.run; | ||
encoder text; | ||
} | ||
|
||
neighbor 127.0.0.1 { | ||
router-id 1.2.3.4; | ||
local-address 127.0.0.1; | ||
local-as 300; | ||
peer-as 300; | ||
|
||
family { | ||
ipv4 unicast; | ||
ipv6 unicast; | ||
} | ||
|
||
capability { | ||
add-path send/receive; | ||
route-refresh; | ||
} | ||
|
||
api { | ||
processes [ announce-routes ]; | ||
neighbor-changes; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
import time | ||
|
||
messages = [ | ||
'neighbor 127.0.0.1 announce attributes path-information 1.2.3.4 next-hop 10.11.12.13 community [14:15] local-preference 16 nlri 16.17.18.19/32 20.21.22.23/32', | ||
'neighbor 127.0.0.1 announce attributes path-information 4.3.2.1 next-hop 10.11.12.13 community [14:15] local-preference 16 nlri 16.17.18.19/32 20.21.22.23/32', | ||
] | ||
|
||
while messages: | ||
message = messages.pop(0) | ||
sys.stdout.write(message + '\n') | ||
sys.stdout.flush() | ||
time.sleep(0.3) | ||
|
||
try: | ||
now = time.time() | ||
while os.getppid() != 1 and time.time() < now + 5: | ||
line = sys.stdin.readline().strip() | ||
if not line or 'shutdown' in line: | ||
break | ||
time.sleep(1) | ||
except IOError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
api-attributes-path.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
1:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:001702:00000000 | ||
1:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:001E:02:00000007900F0003000201 | ||
1:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:0045:02:0000001C400101004002004003040A0B0C0D40050400000010C00804000E000F010203042010111213010203042014151617 | ||
1:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:0045:02:0000001C400101004002004003040A0B0C0D40050400000010C00804000E000F040302012010111213040302012014151617 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters