From 6dca28918be80a3ef0c2959a99067337f59f5972 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 14 Nov 2023 14:14:44 +0100 Subject: wip --- 6/bgp.pl | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to '6/bgp.pl') diff --git a/6/bgp.pl b/6/bgp.pl index d9b448b..6d16500 100644 --- a/6/bgp.pl +++ b/6/bgp.pl @@ -84,15 +84,6 @@ to_dict(neighbor(_, Remote), Dict) :- host_config(Remote, RC), } }. -routers_entry(router(R), Dict) :- - D = to_dict(router(R)), - pairs_keys_values(Data, [R], [D]), - dict_create(Dict, _, Data). - -bird_config(Dict) :- +bird_config(RouterDicts) :- routers(Routers), - maplist(to_dict(), Routers, RouterDicts), -% maplist(routers_entry(), Routers, RouterDicts), - Dict = _{routers:RouterDicts}. -% findall(neighbor(H, R), (host(H), host(R), neighbor(H, R)), Routers), -% yaml_write(current_output, _{neighbors:BgpConnectionDicts}). + maplist(to_dict(), Routers, RouterDicts). -- cgit v1.2.3