blob: 69e951a266459438bb24040aaf8daf5707142f31 [file] [log] [blame]
lishuai6c56f5e2015-11-17 16:38:19 +08001/*
2 * Copyright 2015 Open Networking Laboratory
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 */
16package org.onosproject.vtn.table;
17
lishuai7547db42015-11-20 14:56:11 +080018import org.onlab.packet.IpAddress;
lishuai6c56f5e2015-11-17 16:38:19 +080019import org.onlab.packet.MacAddress;
20import org.onosproject.core.ApplicationId;
21import org.onosproject.net.DeviceId;
22import org.onosproject.net.PortNumber;
23import org.onosproject.net.flowobjective.Objective;
24import org.onosproject.vtnrsc.SegmentationId;
25
26/**
lishuai7547db42015-11-20 14:56:11 +080027 * Applies classifier flows to the device. Classifier table is Table(0).
lishuai6c56f5e2015-11-17 16:38:19 +080028 */
29public interface ClassifierService {
30
31 /**
32 * The port rule that message from host matches Table(0) Match: host mac and
lishuai7547db42015-11-20 14:56:11 +080033 * ingress port Action: set vnid and go to L2Forward Table(50).
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 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
lishuai7547db42015-11-20 14:56:11 +080048 * vnid Action: go to L2Forward Table(50).
lishuai6c56f5e2015-11-17 16:38:19 +080049 *
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
lishuai7547db42015-11-20 14:56:11 +080059 /**
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
lishuai6c56f5e2015-11-17 16:38:19 +0800105}