blob: 9e467821e7b33fdeacd4bb78408d6e6908790a18 [file] [log] [blame]
Andrea Campanellacbbb7952019-11-25 06:38:41 +00001/*
2 * Copyright 2016-present Open Networking Foundation
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.opencord.olt.internalapi;
17
Tunahan Sezena07fe962021-02-24 08:24:24 +000018import org.onlab.packet.MacAddress;
Andrea Campanellacbbb7952019-11-25 06:38:41 +000019import org.onlab.packet.VlanId;
20import org.onosproject.net.DeviceId;
Andrea Campanellacbbb7952019-11-25 06:38:41 +000021import org.onosproject.net.flowobjective.ForwardingObjective;
22import org.onosproject.net.flowobjective.ObjectiveError;
23import org.onosproject.net.meter.MeterId;
Tunahan Sezenf0843b92021-04-30 07:13:16 +000024import org.opencord.olt.AccessDevicePort;
Andrea Campanellacbbb7952019-11-25 06:38:41 +000025import org.opencord.sadis.UniTagInformation;
26
Tunahan Sezena07fe962021-02-24 08:24:24 +000027import java.util.Optional;
Andrea Campanellacbbb7952019-11-25 06:38:41 +000028import java.util.concurrent.CompletableFuture;
29
30/**
31 * Olt service for flow operations.
32 */
33public interface AccessDeviceFlowService {
34
35 /**
36 * Provisions or removes trap-to-controller DHCP packets.
37 *
yasin saplib4b8ee12021-06-13 18:25:20 +000038 * @param port the uni port for which this trap flow is designated
39 * @param upstreamMeterId the upstream meter id that includes the upstream
40 * bandwidth profile values such as PIR,CIR. If no meter id needs to be referenced,
41 * null can be sent
42 * @param upstreamOltMeterId the upstream meter id of OLT device that includes the upstream
43 * bandwidth profile values such as PIR,CIR. If no meter id needs to be referenced,
44 * null can be sent
45 * @param tagInformation the uni tag (ctag, stag) information
46 * @param install true to install the flow, false to remove the flow
47 * @param upstream true if trapped packets are flowing upstream towards
48 * server, false if packets are flowing downstream towards client
49 * @param dhcpFuture gets result of dhcp objective when complete
Andrea Campanellacbbb7952019-11-25 06:38:41 +000050 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +000051 void processDhcpFilteringObjectives(AccessDevicePort port,
Andrea Campanellacbbb7952019-11-25 06:38:41 +000052 MeterId upstreamMeterId,
yasin saplib4b8ee12021-06-13 18:25:20 +000053 MeterId upstreamOltMeterId,
Andrea Campanellacbbb7952019-11-25 06:38:41 +000054 UniTagInformation tagInformation,
55 boolean install,
Tunahan Sezena07fe962021-02-24 08:24:24 +000056 boolean upstream,
57 Optional<CompletableFuture<ObjectiveError>> dhcpFuture);
Andrea Campanellacbbb7952019-11-25 06:38:41 +000058
59 /**
60 * Trap igmp packets to the controller.
61 *
yasin saplib4b8ee12021-06-13 18:25:20 +000062 * @param port Uni Port number
63 * @param upstreamMeterId upstream meter id that represents the upstream bandwidth profile
64 * @param upstreamOltMeterId upstream meter id of OLT device that represents the upstream bandwidth profile
65 * @param tagInformation the uni tag information of the subscriber
66 * @param install the indicator to install or to remove the flow
67 * @param upstream determines the direction of the flow
Andrea Campanellacbbb7952019-11-25 06:38:41 +000068 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +000069 void processIgmpFilteringObjectives(AccessDevicePort port,
Andrea Campanellacbbb7952019-11-25 06:38:41 +000070 MeterId upstreamMeterId,
yasin saplib4b8ee12021-06-13 18:25:20 +000071 MeterId upstreamOltMeterId,
Andrea Campanellacbbb7952019-11-25 06:38:41 +000072 UniTagInformation tagInformation,
73 boolean install,
74 boolean upstream);
75
76 /**
77 * Trap eapol authentication packets to the controller.
78 *
Tunahan Sezenf0843b92021-04-30 07:13:16 +000079 * @param port the port for which this trap flow is designated
Andrea Campanellacbbb7952019-11-25 06:38:41 +000080 * @param bpId bandwidth profile id to add the related meter to the flow
yasin saplib4b8ee12021-06-13 18:25:20 +000081 * @param oltBpId bandwidth profile id of OLT device to add the related meter to the flow
Andrea Campanellacbbb7952019-11-25 06:38:41 +000082 * @param filterFuture completable future for this filtering objective operation
83 * @param vlanId the default or customer tag for a subscriber
84 * @param install true to install the flow, false to remove the flow
85 */
yasin saplib4b8ee12021-06-13 18:25:20 +000086 void processEapolFilteringObjectives(AccessDevicePort port,
87 String bpId,
88 Optional<String> oltBpId,
Andrea Campanellacbbb7952019-11-25 06:38:41 +000089 CompletableFuture<ObjectiveError> filterFuture,
yasin saplib4b8ee12021-06-13 18:25:20 +000090 VlanId vlanId,
91 boolean install);
Andrea Campanellacbbb7952019-11-25 06:38:41 +000092
93 /**
Gustavo Silva5c492dd2021-02-12 10:21:11 -030094 * Trap PPPoE discovery packets to the controller.
95 *
yasin saplib4b8ee12021-06-13 18:25:20 +000096 * @param port the uni port for which this trap flow is designated
97 * @param upstreamMeterId the upstream meter id that includes the upstream
98 * bandwidth profile values such as PIR,CIR. If no meter id needs to be referenced,
99 * null can be sent
100 * @param upstreamOltMeterId the upstream meter id of OLT device that includes the upstream
101 * bandwidth profile values such as PIR,CIR. If no meter id needs to be referenced,
102 * null can be sent
103 * @param tagInformation the uni tag (ctag, stag) information
104 * @param install true to install the flow, false to remove the flow
105 * @param upstream true if trapped packets are flowing upstream towards
106 * server, false if packets are flowing downstream towards client
Gustavo Silva5c492dd2021-02-12 10:21:11 -0300107 **/
Tunahan Sezenf0843b92021-04-30 07:13:16 +0000108 void processPPPoEDFilteringObjectives(AccessDevicePort port,
yasin saplib4b8ee12021-06-13 18:25:20 +0000109 MeterId upstreamMeterId,
110 MeterId upstreamOltMeterId,
111 UniTagInformation tagInformation,
112 boolean install,
113 boolean upstream);
Gustavo Silva5c492dd2021-02-12 10:21:11 -0300114
115 /**
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000116 * Trap lldp packets to the controller.
117 *
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000118 * @param port the port for which this trap flow is designated
119 * @param install true to install the flow, false to remove the flow
120 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +0000121 void processLldpFilteringObjective(AccessDevicePort port, boolean install);
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000122
123 /**
124 * Installs trap filtering objectives for particular traffic types (LLDP, IGMP and DHCP) on an
125 * NNI port.
126 *
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000127 * @param port port number
128 * @param install true to install, false to remove
129 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +0000130 void processNniFilteringObjectives(AccessDevicePort port, boolean install);
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000131
132 /**
133 * Creates a ForwardingObjective builder with double-tag match criteria and output
134 * action. The treatment will not contain pop or push actions.
135 * If the last parameter is true, use the upstream meter id and vice versa.
136 *
137 * @param uplinkPort the nni port
138 * @param subscriberPort the uni port
139 * @param meterId the meter id that is assigned to upstream or downstream flows
140 * @param tagInfo the uni tag information
141 * @param upstream true to create upstream, false to create downstream builder
142 * @return ForwardingObjective.Builder
143 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +0000144 ForwardingObjective.Builder createTransparentBuilder(AccessDevicePort uplinkPort,
145 AccessDevicePort subscriberPort,
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000146 MeterId meterId,
147 UniTagInformation tagInfo,
148 boolean upstream);
149
150 /**
151 * Creates a ForwardingObjective builder for the upstream flows.
152 * The treatment will contain push action
153 *
yasin saplib4b8ee12021-06-13 18:25:20 +0000154 * @param uplinkPort the nni port
155 * @param subscriberPort the uni port
156 * @param upstreamMeterId the meter id that is assigned to upstream flows
157 * @param upstreamOltMeterId the meter id that is assigned to upstream flows for OLT device
158 * @param uniTagInformation the uni tag information
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000159 * @return ForwardingObjective.Builder
160 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +0000161 ForwardingObjective.Builder createUpBuilder(AccessDevicePort uplinkPort,
162 AccessDevicePort subscriberPort,
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000163 MeterId upstreamMeterId,
yasin saplib4b8ee12021-06-13 18:25:20 +0000164 MeterId upstreamOltMeterId,
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000165 UniTagInformation uniTagInformation);
166
167 /**
168 * Creates a ForwardingObjective builder for the downstream flows.
169 * The treatment will contain pop action
170 *
yasin saplib4b8ee12021-06-13 18:25:20 +0000171 * @param uplinkPort the nni port
172 * @param subscriberPort the uni port
173 * @param downstreamMeterId the meter id that is assigned to downstream flows
174 * @param downstreamOltMeterId the meter id that is assigned to downstream flows
175 * @param tagInformation the uni tag information
176 * @param macAddress the mac address
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000177 * @return ForwardingObjective.Builder
178 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +0000179 ForwardingObjective.Builder createDownBuilder(AccessDevicePort uplinkPort,
180 AccessDevicePort subscriberPort,
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000181 MeterId downstreamMeterId,
yasin saplib4b8ee12021-06-13 18:25:20 +0000182 MeterId downstreamOltMeterId,
Tunahan Sezena07fe962021-02-24 08:24:24 +0000183 UniTagInformation tagInformation,
184 Optional<MacAddress> macAddress);
Andrea Campanella600d2e22020-06-22 11:00:31 +0200185
186 /**
187 * Clears pending mappings and state for device.
188 * @param deviceId the device id
189 */
190 void clearDeviceState(DeviceId deviceId);
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000191}