blob: e55c789c93ff8d87f460fc666f8b0fd1cf05ebcf [file] [log] [blame]
Matteo Scandoloaa2adde2021-09-13 12:45:32 -07001/*
2 * Copyright 2021-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 */
16
17package org.opencord.olt.impl;
18
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 */
55 void handleNniFlows(Device device, Port port, OltFlowService.FlowOperation action);
56
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 /**
73 * Checks if the subscriber 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 hasSubscriberFlows(Port port, UniTagInformation uti);
79
80 /**
81 * Removes all device flows.
82 * @param deviceId the olt.
83 */
84 void purgeDeviceFlows(DeviceId deviceId);
85
86 /**
87 * Return the status of installation on the connect points.
88 * @return the status map
89 */
90 Map<ServiceKey, OltPortStatus> getConnectPointStatus();
91
92 /**
93 * Returns all the programmed subscribers.
94 * @return the subscribers
95 */
96 Map<ServiceKey, UniTagInformation> getProgrammedSubscribers();
97
98 /**
99 * Returns the list of requested subscribers to be installed with status.
100 * @return the list
101 */
102 Map<ServiceKey, Boolean> getRequestedSubscribers();
103
104 /**
105 * Returns if a subscriber on a port is provisioned or not.
106 * @param cp the port
107 * @return true if any service on that port is provisioned, false otherwise
108 */
109 boolean isSubscriberServiceProvisioned(AccessDevicePort cp);
110
111 /**
112 * Returns if a subscriber on a port is provisioned or not.
113 * @param sk the SubscriberKey
114 * @return true if provisioned, false otherwise
115 */
116 boolean isSubscriberServiceProvisioned(ServiceKey sk);
117
118 /**
119 * Updates the subscriber provisioning status.
120 * @param sk the SubscriberKey
121 * @param status the next status
122 */
123 void updateProvisionedSubscriberStatus(ServiceKey sk, Boolean status);
124}