blob: 7e2939b8f28d8e3b119bb796ef1a9a4059a6c045 [file] [log] [blame]
lishuai7e6b3172015-11-20 15:42:28 +08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
lishuai7e6b3172015-11-20 15:42:28 +08003 *
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 */
16package org.onosproject.vtn.table;
17
18import org.onlab.packet.IpAddress;
19import org.onlab.packet.MacAddress;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.flowobjective.Objective;
22import 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 */
29public 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}