alshabib | eff0054 | 2015-09-23 13:22:33 -0700 | [diff] [blame] | 1 | /* |
Rusty Eddy | c0e3fea | 2015-09-28 21:20:41 +0000 | [diff] [blame^] | 2 | * Copyright 2015 Open Networking Laboratory |
alshabib | eff0054 | 2015-09-23 13:22:33 -0700 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.mfwd.cli; |
| 17 | |
| 18 | import org.apache.karaf.shell.commands.Argument; |
| 19 | import org.apache.karaf.shell.commands.Command; |
| 20 | import org.onosproject.cli.AbstractShellCommand; |
alshabib | eff0054 | 2015-09-23 13:22:33 -0700 | [diff] [blame] | 21 | import org.onosproject.mfwd.impl.McastRouteTable; |
| 22 | |
| 23 | /** |
Rusty Eddy | c0e3fea | 2015-09-28 21:20:41 +0000 | [diff] [blame^] | 24 | * Deletes a multicast route. |
alshabib | eff0054 | 2015-09-23 13:22:33 -0700 | [diff] [blame] | 25 | */ |
| 26 | @Command(scope = "onos", name = "mcast-delete", |
| 27 | description = "Delete a multicast route flow") |
| 28 | public class McastDeleteCommand extends AbstractShellCommand { |
| 29 | |
| 30 | @Argument(index = 0, name = "sAddr", |
| 31 | description = "IP Address of the multicast source. '*' can be used for any source (*, G) entry", |
| 32 | required = true, multiValued = false) |
| 33 | String sAddr = null; |
| 34 | |
| 35 | @Argument(index = 1, name = "gAddr", |
| 36 | description = "IP Address of the multicast group", |
| 37 | required = true, multiValued = false) |
| 38 | String gAddr = null; |
| 39 | |
| 40 | @Override |
| 41 | protected void execute() { |
| 42 | McastRouteTable mrib = McastRouteTable.getInstance(); |
| 43 | mrib.removeRoute(sAddr, gAddr); |
| 44 | } |
Rusty Eddy | c0e3fea | 2015-09-28 21:20:41 +0000 | [diff] [blame^] | 45 | } |