Signed-off-by: ISHIDA Wataru <ishida.wat...@lab.ntt.co.jp> --- .../bgp/operator/commands/show/neighbor.py | 31 +++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/ryu/services/protocols/bgp/operator/commands/show/neighbor.py b/ryu/services/protocols/bgp/operator/commands/show/neighbor.py index 9f3f5ed..3b48f35 100644 --- a/ryu/services/protocols/bgp/operator/commands/show/neighbor.py +++ b/ryu/services/protocols/bgp/operator/commands/show/neighbor.py @@ -125,13 +125,42 @@ class ReceivedRoutes(SentRoutes): return paths +class Filter(Command): + help_msg = 'show neighbor filter information' + command = 'filter' + param_help_msg = '<ip_addr> <filter_family>{in, out, all}' + + def action(self, params): + if len(params) != 2: + return WrongParamResp() + + ip_addr, filter_family = params + + if filter_family not in ['in', 'out', 'all']: + return WrongParamResp('wrong filter_family name') + + core = self.api.get_core_service() + peer = core.peer_manager.get_by_addr(ip_addr) + if not peer: + return WrongParamResp('no peer found') + + ret = {} + if filter_family != 'in': + ret['out'] = peer.out_filters + if filter_family != 'out': + ret['in'] = peer.in_filters + + return CommandsResponse(STATUS_OK, ret) + + class Neighbor(Command): help_msg = 'show neighbor information' command = 'neighbor' subcommands = { 'summary': NeighborSummary, 'sent-routes': SentRoutes, - 'received-routes': ReceivedRoutes + 'received-routes': ReceivedRoutes, + 'filter': Filter } fmtstr = ' {0:<12s} {1:<12s} {2:<}\n' -- 1.7.10.4 ------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel