summaryrefslogtreecommitdiff
path: root/6/bgp.pl
diff options
context:
space:
mode:
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).