blob: 0012e288b64e0f9fbd87169a504f153929641bca [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 *
Andrea Campanellacbbb7952019-11-25 06:38:41 +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 tagInformation the uni tag (ctag, stag) information
43 * @param install true to install the flow, false to remove the flow
44 * @param upstream true if trapped packets are flowing upstream towards
45 * server, false if packets are flowing downstream towards client
Tunahan Sezena07fe962021-02-24 08:24:24 +000046 * @param dhcpFuture gets result of dhcp objective when complete
Andrea Campanellacbbb7952019-11-25 06:38:41 +000047 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +000048 void processDhcpFilteringObjectives(AccessDevicePort port,
Andrea Campanellacbbb7952019-11-25 06:38:41 +000049 MeterId upstreamMeterId,
50 UniTagInformation tagInformation,
51 boolean install,
Tunahan Sezena07fe962021-02-24 08:24:24 +000052 boolean upstream,
53 Optional<CompletableFuture<ObjectiveError>> dhcpFuture);
Andrea Campanellacbbb7952019-11-25 06:38:41 +000054
55 /**
56 * Trap igmp packets to the controller.
57 *
Andrea Campanellacbbb7952019-11-25 06:38:41 +000058 * @param port Uni Port number
59 * @param upstreamMeterId upstream meter id that represents the upstream bandwidth profile
60 * @param tagInformation the uni tag information of the subscriber
61 * @param install the indicator to install or to remove the flow
62 * @param upstream determines the direction of the flow
63 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +000064 void processIgmpFilteringObjectives(AccessDevicePort port,
Andrea Campanellacbbb7952019-11-25 06:38:41 +000065 MeterId upstreamMeterId,
66 UniTagInformation tagInformation,
67 boolean install,
68 boolean upstream);
69
70 /**
71 * Trap eapol authentication packets to the controller.
72 *
Tunahan Sezenf0843b92021-04-30 07:13:16 +000073 * @param port the port for which this trap flow is designated
Andrea Campanellacbbb7952019-11-25 06:38:41 +000074 * @param bpId bandwidth profile id to add the related meter to the flow
75 * @param filterFuture completable future for this filtering objective operation
76 * @param vlanId the default or customer tag for a subscriber
77 * @param install true to install the flow, false to remove the flow
78 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +000079 void processEapolFilteringObjectives(AccessDevicePort port, String bpId,
Andrea Campanellacbbb7952019-11-25 06:38:41 +000080 CompletableFuture<ObjectiveError> filterFuture,
81 VlanId vlanId, boolean install);
82
83 /**
Gustavo Silva5c492dd2021-02-12 10:21:11 -030084 * Trap PPPoE discovery packets to the controller.
85 *
Tunahan Sezenf0843b92021-04-30 07:13:16 +000086 * @param port the uni port for which this trap flow is designated
Gustavo Silva5c492dd2021-02-12 10:21:11 -030087 * @param upstreamMeterId the upstream meter id that includes the upstream
88 * bandwidth profile values such as PIR,CIR. If no meter id needs to be referenced,
89 * null can be sent
90 * @param tagInformation the uni tag (ctag, stag) information
91 * @param install true to install the flow, false to remove the flow
92 * @param upstream true if trapped packets are flowing upstream towards
93 * server, false if packets are flowing downstream towards client
94 **/
Tunahan Sezenf0843b92021-04-30 07:13:16 +000095 void processPPPoEDFilteringObjectives(AccessDevicePort port,
Gustavo Silva5c492dd2021-02-12 10:21:11 -030096 MeterId upstreamMeterId, UniTagInformation tagInformation,
97 boolean install, boolean upstream);
98
99 /**
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000100 * Trap lldp packets to the controller.
101 *
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000102 * @param port the port for which this trap flow is designated
103 * @param install true to install the flow, false to remove the flow
104 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +0000105 void processLldpFilteringObjective(AccessDevicePort port, boolean install);
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000106
107 /**
108 * Installs trap filtering objectives for particular traffic types (LLDP, IGMP and DHCP) on an
109 * NNI port.
110 *
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000111 * @param port port number
112 * @param install true to install, false to remove
113 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +0000114 void processNniFilteringObjectives(AccessDevicePort port, boolean install);
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000115
116 /**
117 * Creates a ForwardingObjective builder with double-tag match criteria and output
118 * action. The treatment will not contain pop or push actions.
119 * If the last parameter is true, use the upstream meter id and vice versa.
120 *
121 * @param uplinkPort the nni port
122 * @param subscriberPort the uni port
123 * @param meterId the meter id that is assigned to upstream or downstream flows
124 * @param tagInfo the uni tag information
125 * @param upstream true to create upstream, false to create downstream builder
126 * @return ForwardingObjective.Builder
127 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +0000128 ForwardingObjective.Builder createTransparentBuilder(AccessDevicePort uplinkPort,
129 AccessDevicePort subscriberPort,
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000130 MeterId meterId,
131 UniTagInformation tagInfo,
132 boolean upstream);
133
134 /**
135 * Creates a ForwardingObjective builder for the upstream flows.
136 * The treatment will contain push action
137 *
138 * @param uplinkPort the nni port
139 * @param subscriberPort the uni port
140 * @param upstreamMeterId the meter id that is assigned to upstream flows
141 * @param uniTagInformation the uni tag information
142 * @return ForwardingObjective.Builder
143 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +0000144 ForwardingObjective.Builder createUpBuilder(AccessDevicePort uplinkPort,
145 AccessDevicePort subscriberPort,
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000146 MeterId upstreamMeterId,
147 UniTagInformation uniTagInformation);
148
149 /**
150 * Creates a ForwardingObjective builder for the downstream flows.
151 * The treatment will contain pop action
152 *
153 * @param uplinkPort the nni port
154 * @param subscriberPort the uni port
155 * @param downstreamMeterId the meter id that is assigned to downstream flows
156 * @param tagInformation the uni tag information
Tunahan Sezena07fe962021-02-24 08:24:24 +0000157 * @param macAddress the mac address
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000158 * @return ForwardingObjective.Builder
159 */
Tunahan Sezenf0843b92021-04-30 07:13:16 +0000160 ForwardingObjective.Builder createDownBuilder(AccessDevicePort uplinkPort,
161 AccessDevicePort subscriberPort,
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000162 MeterId downstreamMeterId,
Tunahan Sezena07fe962021-02-24 08:24:24 +0000163 UniTagInformation tagInformation,
164 Optional<MacAddress> macAddress);
Andrea Campanella600d2e22020-06-22 11:00:31 +0200165
166 /**
167 * Clears pending mappings and state for device.
168 * @param deviceId the device id
169 */
170 void clearDeviceState(DeviceId deviceId);
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000171}