-
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 support for neighbor * in the API
- Loading branch information
1 parent
3f867af
commit 66d08fb
Showing
5 changed files
with
51 additions
and
0 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,20 @@ | ||
process add-remove { | ||
run ./run/api-announce-star.run; | ||
encoder json; | ||
} | ||
|
||
neighbor 127.0.0.1 { | ||
router-id 1.2.3.4; | ||
local-address 127.0.0.1; | ||
local-as 1; | ||
peer-as 1; | ||
group-updates false; | ||
|
||
capability { | ||
graceful-restart; | ||
} | ||
|
||
api { | ||
processes [ add-remove ]; | ||
} | ||
} |
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 * announce route 1.1.0.0/24 next-hop 101.1.101.1', | ||
'neighbor * announce route 1.2.0.0/25 next-hop 101.1.101.1', | ||
] | ||
|
||
while messages: | ||
message = messages.pop(0) | ||
sys.stdout.write(message + '\n') | ||
sys.stdout.flush() | ||
time.sleep(0.1) | ||
|
||
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
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-announce-star.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,2 @@ | ||
1:announce:1.1.0.0/24 | ||
1:announce:1.2.0.0/25 |