diff options
Diffstat (limited to '6/bgp.pl')
-rw-r--r-- | 6/bgp.pl | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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). |