blob: 68af8bbbe35c0e87b37f4e84d0db28e194ecaf65 [file] [log] [blame]
lishuai6c56f5e2015-11-17 16:38:19 +08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
lishuai6c56f5e2015-11-17 16:38:19 +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
jiangruic69a7fd2015-11-19 15:40:01 +080018import org.onlab.packet.IpAddress;
lishuai6c56f5e2015-11-17 16:38:19 +080019import org.onlab.packet.MacAddress;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.PortNumber;
22import org.onosproject.net.flowobjective.Objective;
23import org.onosproject.vtnrsc.SegmentationId;
24
25/**
jiangruic69a7fd2015-11-19 15:40:01 +080026 * Applies L2 flows to the device. L2Forward table is Table(50).
lishuai6c56f5e2015-11-17 16:38:19 +080027 */
28public interface L2ForwardService {
29
30 /**
jiangruic69a7fd2015-11-19 15:40:01 +080031 * The local broadcast rule that message matches Table(50).
32 * Match: broadcast mac and vnid.
33 * Action: set output port.
lishuai6c56f5e2015-11-17 16:38:19 +080034 *
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 /**
jiangruic69a7fd2015-11-19 15:40:01 +080050 * The tunnel broadcast rule that message matches Table(50).
51 * Match: broadcast mac and vnid.
52 * Action: output port.
lishuai6c56f5e2015-11-17 16:38:19 +080053 *
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 /**
jiangruic69a7fd2015-11-19 15:40:01 +080067 * The local out rule that message matches Table(50).
68 * Match: local host mac and vnid.
69 * Action: output local host port.
lishuai6c56f5e2015-11-17 16:38:19 +080070 *
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 /**
Bob zhou59a21062016-05-12 19:40:05 +080082 * The external out rule that message matches Table(50).
83 * Match: external port mac and vnid.
84 * Action: output external port.
85 *
86 * @param deviceId Device Id
87 * @param segmentationId the vnid of the host belong to
88 * @param outPort the ingress port of the external port
89 * @param sourceMac the mac of the external port
90 * @param type the operation of the flow
91 */
92 void programExternalOut(DeviceId deviceId, SegmentationId segmentationId,
93 PortNumber outPort, MacAddress sourceMac,
94 Objective.Operation type);
95
96 /**
jiangruic69a7fd2015-11-19 15:40:01 +080097 * The tunnel out rule that message matches Table(50).
98 * Match: host mac and vnid.
99 * Action: output tunnel port.
lishuai6c56f5e2015-11-17 16:38:19 +0800100 *
101 * @param deviceId Device Id
102 * @param segmentationId the vnid of the host belong to
103 * @param tunnelOutPort the port of the tunnel
104 * @param dstMac the mac of the host
105 * @param type the operation of the flow
jiangruic69a7fd2015-11-19 15:40:01 +0800106 * @param ipAddress the ipAddress of the node
lishuai6c56f5e2015-11-17 16:38:19 +0800107 */
108 void programTunnelOut(DeviceId deviceId, SegmentationId segmentationId,
109 PortNumber tunnelOutPort, MacAddress dstMac,
jiangruic69a7fd2015-11-19 15:40:01 +0800110 Objective.Operation type, IpAddress ipAddress);
lishuai6c56f5e2015-11-17 16:38:19 +0800111
112}