Pier Ventre | f5d7236 | 2016-07-17 12:02:14 +0200 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Pier Ventre | f5d7236 | 2016-07-17 12:02:14 +0200 | [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 | |
| 17 | package org.onosproject.net.behaviour; |
| 18 | |
| 19 | import com.google.common.annotations.Beta; |
| 20 | import org.onlab.packet.VlanId; |
| 21 | import org.onosproject.net.Annotated; |
| 22 | import org.onosproject.net.Description; |
| 23 | |
| 24 | import java.util.List; |
| 25 | import java.util.Optional; |
| 26 | |
| 27 | /** |
| 28 | * The abstraction of a mirroring. Port mirroring is a method of monitoring |
| 29 | * network traffic that forwards a copy of each incoming or outgoing packet from |
| 30 | * one port (Monitor port) on a network switch to another port (Mirror port) |
| 31 | * where the packet can be analyzed. |
| 32 | */ |
| 33 | @Beta |
| 34 | public interface MirroringDescription extends Description, Annotated { |
| 35 | |
| 36 | /** |
| 37 | * Returns mirroring name. |
| 38 | * |
| 39 | * @return mirroring name |
| 40 | */ |
| 41 | MirroringName name(); |
| 42 | |
| 43 | /** |
| 44 | * Returns src ports to monitor. |
| 45 | * If it is empty, then no src port has |
| 46 | * to be monitored. |
| 47 | * |
| 48 | * @return set of src ports to monitor |
| 49 | */ |
| 50 | List<String> monitorSrcPorts(); |
| 51 | |
| 52 | /** |
| 53 | * Returns dst ports to monitor. |
| 54 | * If it is empty, then no dst port has |
| 55 | * to be monitored. |
| 56 | * |
| 57 | * @return set of dst ports to monitor |
| 58 | */ |
| 59 | List<String> monitorDstPorts(); |
| 60 | |
| 61 | /** |
| 62 | * Returns vlans to monitor. |
| 63 | * If it is empty, then no vlan has |
| 64 | * to be monitored. |
| 65 | * |
| 66 | * @return monitored vlan |
| 67 | */ |
| 68 | List<VlanId> monitorVlans(); |
| 69 | |
| 70 | /** |
| 71 | * Returns mirror port. |
| 72 | * If it is not set, then no destination |
| 73 | * port for mirrored packets. |
| 74 | * |
| 75 | * @return mirror port |
| 76 | */ |
| 77 | Optional<String> mirrorPort(); |
| 78 | |
| 79 | /** |
| 80 | * Returns mirror vlan. |
| 81 | * If it is not set then no destination |
| 82 | * vlan for mirrored packets. |
| 83 | * |
| 84 | * @return mirror vlan |
| 85 | */ |
| 86 | Optional<VlanId> mirrorVlan(); |
| 87 | |
| 88 | } |