lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame^] | 2 | * Copyright 2015-present Open Networking Laboratory |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [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.vtn.table; |
| 17 | |
jiangrui | c69a7fd | 2015-11-19 15:40:01 +0800 | [diff] [blame] | 18 | import org.onlab.packet.IpAddress; |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 19 | import org.onlab.packet.MacAddress; |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | import org.onosproject.net.PortNumber; |
| 22 | import org.onosproject.net.flowobjective.Objective; |
| 23 | import org.onosproject.vtnrsc.SegmentationId; |
| 24 | |
| 25 | /** |
jiangrui | c69a7fd | 2015-11-19 15:40:01 +0800 | [diff] [blame] | 26 | * Applies L2 flows to the device. L2Forward table is Table(50). |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 27 | */ |
| 28 | public interface L2ForwardService { |
| 29 | |
| 30 | /** |
jiangrui | c69a7fd | 2015-11-19 15:40:01 +0800 | [diff] [blame] | 31 | * The local broadcast rule that message matches Table(50). |
| 32 | * Match: broadcast mac and vnid. |
| 33 | * Action: set output port. |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 34 | * |
| 35 | * @param deviceId Device Id |
| 36 | * @param segmentationId the vnid of the host belong to |
| 37 | * @param inPort the ingress port of the host |
| 38 | * @param localVmPorts the local ports of the network which connect host |
| 39 | * @param localTunnelPorts the tunnel pors of the device |
| 40 | * @param type the operation of the flow |
| 41 | */ |
| 42 | void programLocalBcastRules(DeviceId deviceId, |
| 43 | SegmentationId segmentationId, |
| 44 | PortNumber inPort, |
| 45 | Iterable<PortNumber> localVmPorts, |
| 46 | Iterable<PortNumber> localTunnelPorts, |
| 47 | Objective.Operation type); |
| 48 | |
| 49 | /** |
jiangrui | c69a7fd | 2015-11-19 15:40:01 +0800 | [diff] [blame] | 50 | * The tunnel broadcast rule that message matches Table(50). |
| 51 | * Match: broadcast mac and vnid. |
| 52 | * Action: output port. |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 53 | * |
| 54 | * @param deviceId Device Id |
| 55 | * @param segmentationId the vnid of the host belong to |
| 56 | * @param localVmPorts the local ports of the network which connect host |
| 57 | * @param localTunnelPorts the tunnel pors of the device |
| 58 | * @param type the operation of the flow |
| 59 | */ |
| 60 | void programTunnelBcastRules(DeviceId deviceId, |
| 61 | SegmentationId segmentationId, |
| 62 | Iterable<PortNumber> localVmPorts, |
| 63 | Iterable<PortNumber> localTunnelPorts, |
| 64 | Objective.Operation type); |
| 65 | |
| 66 | /** |
jiangrui | c69a7fd | 2015-11-19 15:40:01 +0800 | [diff] [blame] | 67 | * The local out rule that message matches Table(50). |
| 68 | * Match: local host mac and vnid. |
| 69 | * Action: output local host port. |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 70 | * |
| 71 | * @param deviceId Device Id |
| 72 | * @param segmentationId the vnid of the host belong to |
| 73 | * @param outPort the ingress port of the host |
| 74 | * @param sourceMac the mac of the host |
| 75 | * @param type the operation of the flow |
| 76 | */ |
| 77 | void programLocalOut(DeviceId deviceId, SegmentationId segmentationId, |
| 78 | PortNumber outPort, MacAddress sourceMac, |
| 79 | Objective.Operation type); |
| 80 | |
| 81 | /** |
jiangrui | c69a7fd | 2015-11-19 15:40:01 +0800 | [diff] [blame] | 82 | * The tunnel out rule that message matches Table(50). |
| 83 | * Match: host mac and vnid. |
| 84 | * Action: output tunnel port. |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 85 | * |
| 86 | * @param deviceId Device Id |
| 87 | * @param segmentationId the vnid of the host belong to |
| 88 | * @param tunnelOutPort the port of the tunnel |
| 89 | * @param dstMac the mac of the host |
| 90 | * @param type the operation of the flow |
jiangrui | c69a7fd | 2015-11-19 15:40:01 +0800 | [diff] [blame] | 91 | * @param ipAddress the ipAddress of the node |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 92 | */ |
| 93 | void programTunnelOut(DeviceId deviceId, SegmentationId segmentationId, |
| 94 | PortNumber tunnelOutPort, MacAddress dstMac, |
jiangrui | c69a7fd | 2015-11-19 15:40:01 +0800 | [diff] [blame] | 95 | Objective.Operation type, IpAddress ipAddress); |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 96 | |
| 97 | } |