-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53a17f5
commit bece14a
Showing
4 changed files
with
89 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,43 @@ | ||
process announce-routes { | ||
run ./run/api-flow-merge.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; | ||
|
||
family { | ||
ipv4 flow; | ||
} | ||
api { | ||
processes [ announce-routes ]; | ||
} | ||
flow { | ||
route one { | ||
match { | ||
source 202.255.238.1/32; | ||
} | ||
scope { | ||
interface-set [ non-transitive:input:3405770241:1 ]; | ||
} | ||
then { | ||
discard; | ||
} | ||
} | ||
route two { | ||
match { | ||
source 202.255.238.1/32; | ||
} | ||
scope { | ||
interface-set [ non-transitive:input:3405770241:1 transitive:output:254:254 ]; | ||
} | ||
then { | ||
discard; | ||
} | ||
} | ||
} | ||
} |
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,35 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
import time | ||
|
||
time.sleep(2) # let the EOR pass | ||
|
||
|
||
messages = [ | ||
'announce flow route { match { source 0.0.0.0/32; } then { rate-limit 0; } }', | ||
'announce flow route { match { source 1.1.1.1/32; } then { discard; } }', | ||
'announce flow route { match { source 2.2.2.2/32; } scope { interface-set [ non-transitive:input:3405770241:1 ]; } then { discard; } }', | ||
'announce flow route { match { source 2.2.2.2/32; } scope { interface-set [ non-transitive:input:3405770241:1 transitive:output:254:254 ]; } then { discard; } }', | ||
] | ||
|
||
while messages: | ||
message = messages.pop(0) | ||
try: | ||
sys.stdout.write(message + '\n') | ||
sys.stdout.flush() | ||
except IOError: | ||
sys.stderr.write('IOError - ExaBGP exited ? ') | ||
sys.stderr.write('Could not write message: %s\n' % message) | ||
sys.stderr.flush() | ||
|
||
try: | ||
now = time.time() | ||
while os.getppid() != 1 and time.time() < now + 1: | ||
line = sys.stdin.readline().strip() | ||
if not line or 'shutdown' in line: | ||
break | ||
time.sleep(0.5) | ||
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-flow-merge.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,10 @@ | ||
|
||
1:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:0047:02:000000304001010040020040050400000064C010104702CAFFEE0140018006000000000000800E0C0001850000060220CAFFEE01 | ||
1:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:004F:02:000000384001010040020040050400000064C010184702CAFFEE0140010702000000FE80FE8006000000000000800E0C0001850000060220CAFFEE01 | ||
|
||
1:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:001E:02:00000007900F0003000185 | ||
|
||
2:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:003F:02:000000284001010040020040050400000064C010088006000000000000800E0C000185000006022000000000 | ||
3:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:003F:02:000000284001010040020040050400000064C010088006000000000000800E0C000185000006022001010101 | ||
4:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:0047:02:000000304001010040020040050400000064C010104702CAFFEE0140018006000000000000800E0C000185000006022002020202 | ||
5:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:004F:02:000000384001010040020040050400000064C010184702CAFFEE0140010702000000FE80FE8006000000000000800E0C000185000006022002020202 |