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 | |
lishuai | 7547db4 | 2015-11-20 14:56:11 +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.core.ApplicationId; |
| 21 | import org.onosproject.net.DeviceId; |
| 22 | import org.onosproject.net.PortNumber; |
| 23 | import org.onosproject.net.flowobjective.Objective; |
| 24 | import org.onosproject.vtnrsc.SegmentationId; |
| 25 | |
| 26 | /** |
lishuai | 7547db4 | 2015-11-20 14:56:11 +0800 | [diff] [blame] | 27 | * Applies classifier flows to the device. Classifier table is Table(0). |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 28 | */ |
| 29 | public interface ClassifierService { |
| 30 | |
| 31 | /** |
| 32 | * The port rule that message from host matches Table(0) Match: host mac and |
lishuai | 7547db4 | 2015-11-20 14:56:11 +0800 | [diff] [blame] | 33 | * ingress port Action: set vnid and go to L2Forward Table(50). |
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 srcMac the mac of the host |
| 39 | * @param appId the application ID of the vtn |
| 40 | * @param type the operation of the flow |
| 41 | */ |
| 42 | void programLocalIn(DeviceId deviceId, SegmentationId segmentationId, |
| 43 | PortNumber inPort, MacAddress srcMac, |
| 44 | ApplicationId appId, Objective.Operation type); |
| 45 | |
| 46 | /** |
| 47 | * The port rule that message from tunnel Table(0) Match: tunnel port and |
lishuai | 7547db4 | 2015-11-20 14:56:11 +0800 | [diff] [blame] | 48 | * vnid Action: go to L2Forward Table(50). |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 49 | * |
| 50 | * @param deviceId Device Id |
| 51 | * @param segmentationId the vnid of the host belong to |
| 52 | * @param localTunnelPorts the tunnel pors of the device |
| 53 | * @param type the operation of the flow |
| 54 | */ |
| 55 | void programTunnelIn(DeviceId deviceId, SegmentationId segmentationId, |
| 56 | Iterable<PortNumber> localTunnelPorts, |
| 57 | Objective.Operation type); |
| 58 | |
lishuai | 7547db4 | 2015-11-20 14:56:11 +0800 | [diff] [blame] | 59 | /** |
| 60 | * Assemble the L3 Classifier table rules which are sended from external port. |
| 61 | * Match: ipv4 type, ingress port and destination ip. |
| 62 | * Action: go to DNAT Table(20). |
| 63 | * |
| 64 | * @param deviceId Device Id |
| 65 | * @param inPort external port |
| 66 | * @param dstIp floating ip |
| 67 | * @param type the operation type of the flow rules |
| 68 | */ |
| 69 | void programL3ExPortClassifierRules(DeviceId deviceId, PortNumber inPort, |
| 70 | IpAddress dstIp, |
| 71 | Objective.Operation type); |
| 72 | |
| 73 | /** |
| 74 | * Assemble the L3 Classifier table rules which are sended from internal port. |
| 75 | * Match: ingress port, source mac and destination mac. |
| 76 | * Action: set vnid and go to L3Forward Table(30). |
| 77 | * |
| 78 | * @param deviceId Device Id |
| 79 | * @param inPort the ingress port of the host |
| 80 | * @param srcMac source mac |
| 81 | * @param dstMac destination vm gateway mac |
| 82 | * @param actionVni the vni of L3 network |
| 83 | * @param type the operation type of the flow rules |
| 84 | */ |
| 85 | void programL3InPortClassifierRules(DeviceId deviceId, |
| 86 | PortNumber inPort, MacAddress srcMac, |
| 87 | MacAddress dstMac, |
| 88 | SegmentationId actionVni, |
| 89 | Objective.Operation type); |
| 90 | |
| 91 | /** |
| 92 | * Assemble the Arp Classifier table rules. |
| 93 | * Match: arp type and destination ip. |
| 94 | * Action: set vnid and go to ARP Table(10). |
| 95 | * |
| 96 | * @param deviceId Device Id |
| 97 | * @param dstIp source gateway ip |
| 98 | * @param actionVni the vni of the source network (l2vni) |
| 99 | * @param type the operation type of the flow rules |
| 100 | */ |
| 101 | void programArpClassifierRules(DeviceId deviceId, IpAddress dstIp, |
| 102 | SegmentationId actionVni, |
| 103 | Objective.Operation type); |
| 104 | |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 105 | } |