blob: e3a612c0e053678fae67f2ccc6c7173da2c49105 [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;
21import org.onosproject.net.PortNumber;
22import org.onosproject.net.flowobjective.ForwardingObjective;
23import org.onosproject.net.flowobjective.ObjectiveError;
24import org.onosproject.net.meter.MeterId;
25import 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 *
38 * @param devId the target device identifier
39 * @param port the uni port for which this trap flow is designated
40 * @param upstreamMeterId the upstream meter id that includes the upstream
41 * bandwidth profile values such as PIR,CIR. If no meter id needs to be referenced,
42 * null can be sent
43 * @param tagInformation the uni tag (ctag, stag) information
44 * @param install true to install the flow, false to remove the flow
45 * @param upstream true if trapped packets are flowing upstream towards
46 * server, false if packets are flowing downstream towards client
Tunahan Sezena07fe962021-02-24 08:24:24 +000047 * @param dhcpFuture gets result of dhcp objective when complete
Andrea Campanellacbbb7952019-11-25 06:38:41 +000048 */
49 void processDhcpFilteringObjectives(DeviceId devId, PortNumber port,
50 MeterId upstreamMeterId,
51 UniTagInformation tagInformation,
52 boolean install,
Tunahan Sezena07fe962021-02-24 08:24:24 +000053 boolean upstream,
54 Optional<CompletableFuture<ObjectiveError>> dhcpFuture);
Andrea Campanellacbbb7952019-11-25 06:38:41 +000055
56 /**
57 * Trap igmp packets to the controller.
58 *
59 * @param devId Device identifier to send the flow
60 * @param port Uni Port number
61 * @param upstreamMeterId upstream meter id that represents the upstream bandwidth profile
62 * @param tagInformation the uni tag information of the subscriber
63 * @param install the indicator to install or to remove the flow
64 * @param upstream determines the direction of the flow
65 */
66 void processIgmpFilteringObjectives(DeviceId devId, PortNumber port,
67 MeterId upstreamMeterId,
68 UniTagInformation tagInformation,
69 boolean install,
70 boolean upstream);
71
72 /**
73 * Trap eapol authentication packets to the controller.
74 *
75 * @param devId the device identifier
76 * @param portNumber the port for which this trap flow is designated
77 * @param bpId bandwidth profile id to add the related meter to the flow
78 * @param filterFuture completable future for this filtering objective operation
79 * @param vlanId the default or customer tag for a subscriber
80 * @param install true to install the flow, false to remove the flow
81 */
82 void processEapolFilteringObjectives(DeviceId devId, PortNumber portNumber, String bpId,
83 CompletableFuture<ObjectiveError> filterFuture,
84 VlanId vlanId, boolean install);
85
86 /**
Gustavo Silva5c492dd2021-02-12 10:21:11 -030087 * Trap PPPoE discovery packets to the controller.
88 *
89 * @param devId the target device identifier
90 * @param portNumber the uni port for which this trap flow is designated
91 * @param upstreamMeterId the upstream meter id that includes the upstream
92 * bandwidth profile values such as PIR,CIR. If no meter id needs to be referenced,
93 * null can be sent
94 * @param tagInformation the uni tag (ctag, stag) information
95 * @param install true to install the flow, false to remove the flow
96 * @param upstream true if trapped packets are flowing upstream towards
97 * server, false if packets are flowing downstream towards client
98 **/
99 void processPPPoEDFilteringObjectives(DeviceId devId, PortNumber portNumber,
100 MeterId upstreamMeterId, UniTagInformation tagInformation,
101 boolean install, boolean upstream);
102
103 /**
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000104 * Trap lldp packets to the controller.
105 *
106 * @param devId the device identifier
107 * @param port the port for which this trap flow is designated
108 * @param install true to install the flow, false to remove the flow
109 */
110 void processLldpFilteringObjective(DeviceId devId, PortNumber port, boolean install);
111
112 /**
113 * Installs trap filtering objectives for particular traffic types (LLDP, IGMP and DHCP) on an
114 * NNI port.
115 *
116 * @param devId device ID
117 * @param port port number
118 * @param install true to install, false to remove
119 */
120 void processNniFilteringObjectives(DeviceId devId, PortNumber port, boolean install);
121
122 /**
123 * Creates a ForwardingObjective builder with double-tag match criteria and output
124 * action. The treatment will not contain pop or push actions.
125 * If the last parameter is true, use the upstream meter id and vice versa.
126 *
127 * @param uplinkPort the nni port
128 * @param subscriberPort the uni port
129 * @param meterId the meter id that is assigned to upstream or downstream flows
130 * @param tagInfo the uni tag information
131 * @param upstream true to create upstream, false to create downstream builder
132 * @return ForwardingObjective.Builder
133 */
134 ForwardingObjective.Builder createTransparentBuilder(PortNumber uplinkPort,
135 PortNumber subscriberPort,
136 MeterId meterId,
137 UniTagInformation tagInfo,
138 boolean upstream);
139
140 /**
141 * Creates a ForwardingObjective builder for the upstream flows.
142 * The treatment will contain push action
143 *
144 * @param uplinkPort the nni port
145 * @param subscriberPort the uni port
146 * @param upstreamMeterId the meter id that is assigned to upstream flows
147 * @param uniTagInformation the uni tag information
148 * @return ForwardingObjective.Builder
149 */
150 ForwardingObjective.Builder createUpBuilder(PortNumber uplinkPort,
151 PortNumber subscriberPort,
152 MeterId upstreamMeterId,
153 UniTagInformation uniTagInformation);
154
155 /**
156 * Creates a ForwardingObjective builder for the downstream flows.
157 * The treatment will contain pop action
158 *
159 * @param uplinkPort the nni port
160 * @param subscriberPort the uni port
161 * @param downstreamMeterId the meter id that is assigned to downstream flows
162 * @param tagInformation the uni tag information
Tunahan Sezena07fe962021-02-24 08:24:24 +0000163 * @param macAddress the mac address
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000164 * @return ForwardingObjective.Builder
165 */
166 ForwardingObjective.Builder createDownBuilder(PortNumber uplinkPort,
167 PortNumber subscriberPort,
168 MeterId downstreamMeterId,
Tunahan Sezena07fe962021-02-24 08:24:24 +0000169 UniTagInformation tagInformation,
170 Optional<MacAddress> macAddress);
Andrea Campanella600d2e22020-06-22 11:00:31 +0200171
172 /**
173 * Clears pending mappings and state for device.
174 * @param deviceId the device id
175 */
176 void clearDeviceState(DeviceId deviceId);
Andrea Campanellacbbb7952019-11-25 06:38:41 +0000177}