lishuai | 7e6b317 | 2015-11-20 15:42:28 +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 | 7e6b317 | 2015-11-20 15:42:28 +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 | |
| 18 | import org.onlab.packet.IpAddress; |
| 19 | import org.onlab.packet.MacAddress; |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | import org.onosproject.net.flowobjective.Objective; |
| 22 | import org.onosproject.vtnrsc.SegmentationId; |
| 23 | |
| 24 | /** |
| 25 | * SnatService interface provides the rules in SNAT table which is Table(40) for ovs pipeline. |
| 26 | * SNAT means Source Network Address Translation, it is acronym for network terminology. |
| 27 | * Handle the upward flows. |
| 28 | */ |
| 29 | public interface SnatService { |
| 30 | |
| 31 | /** |
| 32 | * Assemble the SNAT table rules. |
| 33 | * Match: ipv4 type, vnid and source ip. |
| 34 | * Action: set eth_src, set eth_dst, set ip_src, set vnid and goto L2Forward Table(50). |
| 35 | * |
| 36 | * @param deviceId Device Id |
| 37 | * @param matchVni the vni of L3 network |
| 38 | * @param srcIP source ip |
| 39 | * @param ethDst external gateway mac |
| 40 | * @param ethSrc external port mac |
| 41 | * @param ipSrc floating ip |
| 42 | * @param actionVni external network VNI |
| 43 | * @param type the operation type of the flow rules |
| 44 | */ |
| 45 | void programRules(DeviceId deviceId, SegmentationId matchVni, |
| 46 | IpAddress srcIP, MacAddress ethDst, |
| 47 | MacAddress ethSrc, IpAddress ipSrc, |
| 48 | SegmentationId actionVni, Objective.Operation type); |
| 49 | } |