From 7744c8d0570203846d29fdda31151077918819be Mon Sep 17 00:00:00 2001 From: yangshiping <43633727+yangshp1987@users.noreply.github.com> Date: Tue, 25 May 2021 01:22:01 +0800 Subject: [PATCH] [fdb]cli: fdb entries are cleared according to vlan or port or vlan&&port (#657) Fdb entries can be deleted with user specifying vlan or port or vlan&&port. --- scripts/fdbclear | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) mode change 100644 => 100755 scripts/fdbclear diff --git a/scripts/fdbclear b/scripts/fdbclear old mode 100644 new mode 100755 index ceb5f22b7e16..7b17459bab40 --- a/scripts/fdbclear +++ b/scripts/fdbclear @@ -42,10 +42,15 @@ def main(): try: fdb = FdbClear() - if args.vlan is not None: - print("command not supported yet.") + if args.vlan is not None and args.port is not None: + fdb.send_notification("PORTVLAN", args.port+'|'+args.vlan) + print("Port {} + Vlan{} FDB entries are cleared.".format(args.port, args.vlan)) + elif args.vlan is not None: + fdb.send_notification("VLAN", args.vlan) + print("Vlan{} FDB entries are cleared.".format(args.vlan)) elif args.port is not None: - print("command not supported yet.") + fdb.send_notification("PORT", args.port) + print("Port {} FDB entries are cleared.".format(args.port)) else: fdb.send_notification("ALL", "ALL") print("FDB entries are cleared.")