blob: 1634027d0ba8eca31e6aee82c9cfddad1c8c4460 [file] [log] [blame]
lishuai334890b2015-11-20 15:34:52 +08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
lishuai334890b2015-11-20 15:34:52 +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 * DnatService interface provides the rules in DNAT table which is Table(20) for ovs pipeline.
26 * DNAT means Destination Network Address Translation, it is acronym for network terminology.
27 * Handle the downward flows.
28 */
29public interface DnatService {
30
31 /**
32 * Assemble the DNAT table rules.
33 * Match: ipv4 type and destination ip.
34 * Action: set eth_src, set ip_dst, set vnid and goto L3Forward Table(30).
35 *
36 * @param deviceId Device Id
37 * @param dstIp floating ip
38 * @param ethSrc floating ip gateway mac
39 * @param ipDst destination vm ip
40 * @param actionVni the vni of L3 network
41 * @param type the operation type of the flow rules
42 */
43 void programRules(DeviceId deviceId, IpAddress dstIp,
44 MacAddress ethSrc, IpAddress ipDst,
45 SegmentationId actionVni, Objective.Operation type);
46}