blob: b2c9875ed059a257ad8a49d87511da46bedff829 [file] [log] [blame]
Matteo Scandoloaa2adde2021-09-13 12:45:32 -07001/*
Joey Armstrong7f6d6d22023-01-09 17:09:50 -05002 * Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
Matteo Scandoloaa2adde2021-09-13 12:45:32 -07003 *
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 */
16
Gustavo Silva29fb20e2022-05-26 09:59:54 -030017package org.opencord.olt;
Matteo Scandoloaa2adde2021-09-13 12:45:32 -070018
19import org.onosproject.net.Device;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.Port;
22import org.opencord.sadis.UniTagInformation;
23
24import java.util.Map;
25
26/**
27 * Interface for flow installation/removal methods for different types of traffic.
28 */
29public interface OltFlowServiceInterface {
30 /**
31 * Installs or removes default flows for the port to trap to controller.
32 * @param sub the information about the port
33 * @param defaultBpId the default bandwidth profile
34 * @param oltBandwidthProfile the olt bandwidth profile.
35 * @return true if successful
36 */
37 boolean handleBasicPortFlows(
38 DiscoveredSubscriber sub, String defaultBpId, String oltBandwidthProfile);
39
40 /**
41 * Installs or removes subscriber specific flows.
42 * @param sub the information about the subscriber
43 * @param defaultBpId the default bandwidth profile
44 * @param multicastServiceName the multicast service name.
45 * @return true if successful
46 */
47 boolean handleSubscriberFlows(DiscoveredSubscriber sub, String defaultBpId, String multicastServiceName);
48
49 /**
50 * Installs or removes flows on the NNI port.
51 * @param device the OLT
52 * @param port the NNI port
53 * @param action the operatio, ADD or REMOVE.
54 */
Gustavo Silva29fb20e2022-05-26 09:59:54 -030055 void handleNniFlows(Device device, Port port, FlowOperation action);
Matteo Scandoloaa2adde2021-09-13 12:45:32 -070056
57 /**
58 * Checks if the default eapol flow is already installed.
59 * @param port the port
60 * @return true if installed, false otherwise.
61 */
62 boolean hasDefaultEapol(Port port);
63
64 /**
65 * Checks if the dhcp flows are installed.
66 * @param port the port
67 * @param uti the UniTagInformation to check for
68 * @return true if installed, false otherwise.
69 */
70 boolean hasDhcpFlows(Port port, UniTagInformation uti);
71
72 /**
yasin sapli0823c932022-01-26 11:26:09 +000073 * Checks if the pppoe flows are installed.
74 * @param port the port
75 * @param uti the UniTagInformation to check for
76 * @return true if installed, false otherwise.
77 */
78 boolean hasPppoeFlows(Port port, UniTagInformation uti);
79
80 /**
Matteo Scandoloaa2adde2021-09-13 12:45:32 -070081 * Checks if the subscriber flows are installed.
82 * @param port the port
83 * @param uti the UniTagInformation to check for
84 * @return true if installed, false otherwise.
85 */
86 boolean hasSubscriberFlows(Port port, UniTagInformation uti);
87
88 /**
89 * Removes all device flows.
90 * @param deviceId the olt.
91 */
92 void purgeDeviceFlows(DeviceId deviceId);
93
94 /**
95 * Return the status of installation on the connect points.
96 * @return the status map
97 */
98 Map<ServiceKey, OltPortStatus> getConnectPointStatus();
99
100 /**
101 * Returns all the programmed subscribers.
102 * @return the subscribers
103 */
104 Map<ServiceKey, UniTagInformation> getProgrammedSubscribers();
105
106 /**
107 * Returns the list of requested subscribers to be installed with status.
108 * @return the list
109 */
110 Map<ServiceKey, Boolean> getRequestedSubscribers();
111
112 /**
113 * Returns if a subscriber on a port is provisioned or not.
114 * @param cp the port
115 * @return true if any service on that port is provisioned, false otherwise
116 */
117 boolean isSubscriberServiceProvisioned(AccessDevicePort cp);
118
119 /**
120 * Returns if a subscriber on a port is provisioned or not.
121 * @param sk the SubscriberKey
122 * @return true if provisioned, false otherwise
123 */
124 boolean isSubscriberServiceProvisioned(ServiceKey sk);
125
126 /**
127 * Updates the subscriber provisioning status.
128 * @param sk the SubscriberKey
129 * @param status the next status
130 */
131 void updateProvisionedSubscriberStatus(ServiceKey sk, Boolean status);
132}