diff --git a/bird/bird.go b/bird/bird.go index ab66e3e..a531663 100644 --- a/bird/bird.go +++ b/bird/bird.go @@ -189,6 +189,11 @@ func RoutesExport(protocol string) (Parsed, bool) { parseRoutes) } +func RoutesNoExport(protocol string) (Parsed, bool) { + return RunAndParse("route noexport '"+protocol+"' all", + parseRoutes) +} + func RoutesExportCount(protocol string) (Parsed, bool) { return RunAndParse("route export '"+protocol+"' count", parseRoutesCount) diff --git a/endpoints/routes.go b/endpoints/routes.go index 0ceff26..5039626 100644 --- a/endpoints/routes.go +++ b/endpoints/routes.go @@ -24,6 +24,14 @@ func RoutesFiltered(r *http.Request, ps httprouter.Params) (bird.Parsed, bool) { return bird.RoutesFiltered(protocol) } +func RoutesNoExport(r *http.Request, ps httprouter.Params) (bird.Parsed, bool) { + protocol, err := ValidateProtocolParam(ps.ByName("protocol")) + if err != nil { + return bird.Parsed{"error": fmt.Sprintf("%s", err)}, false + } + return bird.RoutesNoExport(protocol) +} + func RoutesPrefixed(r *http.Request, ps httprouter.Params) (bird.Parsed, bool) { qs := r.URL.Query() prefixl := qs["prefix"]