blob: 7de5b1ae57a4e3c206b408d67af2088aa1624438 [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
18import org.onlab.packet.VlanId;
19import org.onosproject.net.DeviceId;
20import org.onosproject.net.PortNumber;
21import org.onosproject.net.flowobjective.ForwardingObjective;
22import org.onosproject.net.flowobjective.ObjectiveError;
23import org.onosproject.net.meter.MeterId;
24import org.opencord.sadis.UniTagInformation;
25
26import java.util.concurrent.CompletableFuture;
27
28/**
29 * Olt service for flow operations.
30 */
31public interface AccessDeviceFlowService {
32
33 /**
34 * Provisions or removes trap-to-controller DHCP packets.
35 *
36 * @param devId the target device identifier
37 * @param port the uni port for which this trap flow is designated
38 * @param upstreamMeterId the upstream meter id that includes the upstream
39 * bandwidth profile values such as PIR,CIR. If no meter id needs to be referenced,
40 * null can be sent
41 * @param tagInformation the uni tag (ctag, stag) information
42 * @param install true to install the flow, false to remove the flow
43 * @param upstream true if trapped packets are flowing upstream towards
44 * server, false if packets are flowing downstream towards client
45 */
46 void processDhcpFilteringObjectives(DeviceId devId, PortNumber port,
47 MeterId upstreamMeterId,
48 UniTagInformation tagInformation,
49 boolean install,
50 boolean upstream);
51
52 /**
53 * Trap igmp packets to the controller.
54 *
55 * @param devId Device identifier to send the flow
56 * @param port Uni Port number
57 * @param upstreamMeterId upstream meter id that represents the upstream bandwidth profile
58 * @param tagInformation the uni tag information of the subscriber
59 * @param install the indicator to install or to remove the flow
60 * @param upstream determines the direction of the flow
61 */
62 void processIgmpFilteringObjectives(DeviceId devId, PortNumber port,
63 MeterId upstreamMeterId,
64 UniTagInformation tagInformation,
65 boolean install,
66 boolean upstream);
67
68 /**
69 * Trap eapol authentication packets to the controller.
70 *
71 * @param devId the device identifier
72 * @param portNumber the port for which this trap flow is designated
73 * @param bpId bandwidth profile id to add the related meter to the flow
74 * @param filterFuture completable future for this filtering objective operation
75 * @param vlanId the default or customer tag for a subscriber
76 * @param install true to install the flow, false to remove the flow
77 */
78 void processEapolFilteringObjectives(DeviceId devId, PortNumber portNumber, String bpId,
79 CompletableFuture<ObjectiveError> filterFuture,
80 VlanId vlanId, boolean install);
81
82 /**
Gustavo Silva5c492dd2021-02-12 10:21:11 -030083 * Trap PPPoE discovery packets to the controller.
84 *
85 * @param devId the target device identifier
86 * @param portNumber the uni port for which this trap flow is designated
87 * @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 **/
95 void processPPPoEDFilteringObjectives(DeviceId devId, PortNumber portNumber,
96 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 *
102 * @param devId the device identifier
103 * @param port the port for which this trap flow is designated
104 * @param install true to install the flow, false to remove the flow
105 */
106 void processLldpFilteringObjective(DeviceId devId, PortNumber port, boolean install);
107
108 /**
109 * Installs trap filtering objectives for particular traffic types (LLDP, IGMP and DHCP) on an
110 * NNI port.
111 *
112 * @param devId device ID
113 * @param port port number
114 * @param install true to install, false to remove
115 */
116 void processNniFilteringObjectives(DeviceId devId, PortNumber port, boolean install);
117
118 /**
119 * Creates a ForwardingObjective builder with double-tag match criteria and output
120 * action. The treatment will not contain pop or push actions.
121 * If the last parameter is true, use the upstream meter id and vice versa.
122 *
123 * @param uplinkPort the nni port
124 * @param subscriberPort the uni port
125 * @param meterId the meter id that is assigned to upstream or downstream flows
126 * @param tagInfo the uni tag information
127 * @param upstream true to create upstream, false to create downstream builder
128 * @return ForwardingObjective.Builder
129 */
130 ForwardingObjective.Builder createTransparentBuilder(PortNumber uplinkPort,
131 PortNumber subscriberPort,
132 MeterId meterId,
133 UniTagInformation tagInfo,
134 boolean upstream);
135
136 /**
137 * Creates a ForwardingObjective builder for the upstream flows.
138 * The treatment will contain push action
139 *
140 * @param uplinkPort the nni port
141 * @param subscriberPort the uni port
142 * @param upstreamMeterId the meter id that is assigned to upstream flows
143 * @param uniTagInformation the uni tag information
144 * @return ForwardingObjective.Builder
145 */
146 ForwardingObjective.Builder createUpBuilder(PortNumber uplinkPort,
147 PortNumber subscriberPort,
148 MeterId upstreamMeterId,
149 UniTagInformation uniTagInformation);
150
151 /**
152 * Creates a ForwardingObjective builder for the downstream flows.
153 * The treatment will contain pop action
154 *
155 * @param uplinkPort the nni port
156 * @param subscriberPort the uni port
157 * @param downstreamMeterId the meter id that is assigned to downstream flows
158 * @param tagInformation the uni tag information
159 * @return ForwardingObjective.Builder
160 */
161 ForwardingObjective.Builder createDownBuilder(PortNumber uplinkPort,
162 PortNumber subscriberPort,
163 MeterId downstreamMeterId,
164 UniTagInformation tagInformation);
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}