alshabib | eff0054 | 2015-09-23 13:22:33 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2014-2015 Open Networking Laboratory |
| 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; |
| 21 | |
| 22 | import org.onosproject.mfwd.impl.McastRouteTable; |
| 23 | |
| 24 | /** |
| 25 | * Delete a multicast route. |
| 26 | */ |
| 27 | @Command(scope = "onos", name = "mcast-delete", |
| 28 | description = "Delete a multicast route flow") |
| 29 | public class McastDeleteCommand extends AbstractShellCommand { |
| 30 | |
| 31 | @Argument(index = 0, name = "sAddr", |
| 32 | description = "IP Address of the multicast source. '*' can be used for any source (*, G) entry", |
| 33 | required = true, multiValued = false) |
| 34 | String sAddr = null; |
| 35 | |
| 36 | @Argument(index = 1, name = "gAddr", |
| 37 | description = "IP Address of the multicast group", |
| 38 | required = true, multiValued = false) |
| 39 | String gAddr = null; |
| 40 | |
| 41 | @Override |
| 42 | protected void execute() { |
| 43 | McastRouteTable mrib = McastRouteTable.getInstance(); |
| 44 | mrib.removeRoute(sAddr, gAddr); |
| 45 | } |
| 46 | } |
| 47 | |