summaryrefslogtreecommitdiff
path: root/6/bgp.pl
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2023-11-14 14:19:55 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2023-11-14 14:19:55 +0100
commit4d471f0b706733624a845143cafb6dd8add90eed (patch)
tree417efc58964f8b43007dcbecf77e6b05a0bd6fa3 /6/bgp.pl
parent6dca28918be80a3ef0c2959a99067337f59f5972 (diff)
downloadprolog-firewall-4d471f0b706733624a845143cafb6dd8add90eed.tar.gz
prolog-firewall-4d471f0b706733624a845143cafb6dd8add90eed.tar.bz2
prolog-firewall-4d471f0b706733624a845143cafb6dd8add90eed.tar.xz
prolog-firewall-4d471f0b706733624a845143cafb6dd8add90eed.zip
wip
Diffstat (limited to '6/bgp.pl')
-rw-r--r--6/bgp.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/6/bgp.pl b/6/bgp.pl
index 6d16500..d398c4c 100644
--- a/6/bgp.pl
+++ b/6/bgp.pl
@@ -72,9 +72,9 @@ router_path(X, Y, V) :- \+ member(X, V), router_link(X, _, Z), router_path(Z, Y,
to_dict(router(R), Dict) :-
neighbors(R, Neighbors),
maplist(to_dict(), Neighbors, NeighborDicts),
- Dict = _{
- host: R,
- neighbors: NeighborDicts}.
+ Dict = R-_{
+ neighbors: NeighborDicts
+ }.
to_dict(neighbor(_, Remote), Dict) :- host_config(Remote, RC),
Dict = neighbor{
@@ -84,6 +84,7 @@ to_dict(neighbor(_, Remote), Dict) :- host_config(Remote, RC),
}
}.
-bird_config(RouterDicts) :-
+bird_config(BirdConfig) :-
routers(Routers),
- maplist(to_dict(), Routers, RouterDicts).
+ maplist(to_dict(), Routers, RouterDicts),
+ dict_pairs(BirdConfig, bird_config, RouterDicts).