Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.opencord.olt.internalapi; |
| 17 | |
Tunahan Sezen | a07fe96 | 2021-02-24 08:24:24 +0000 | [diff] [blame] | 18 | import org.onlab.packet.MacAddress; |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 19 | import org.onlab.packet.VlanId; |
| 20 | import org.onosproject.net.DeviceId; |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 21 | import org.onosproject.net.flowobjective.ForwardingObjective; |
| 22 | import org.onosproject.net.flowobjective.ObjectiveError; |
| 23 | import org.onosproject.net.meter.MeterId; |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 24 | import org.opencord.olt.AccessDevicePort; |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 25 | import org.opencord.sadis.UniTagInformation; |
| 26 | |
Tunahan Sezen | a07fe96 | 2021-02-24 08:24:24 +0000 | [diff] [blame] | 27 | import java.util.Optional; |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 28 | import java.util.concurrent.CompletableFuture; |
| 29 | |
| 30 | /** |
| 31 | * Olt service for flow operations. |
| 32 | */ |
| 33 | public interface AccessDeviceFlowService { |
| 34 | |
| 35 | /** |
| 36 | * Provisions or removes trap-to-controller DHCP packets. |
| 37 | * |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 38 | * @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 upstreamOltMeterId the upstream meter id of OLT device that includes the upstream |
| 43 | * bandwidth profile values such as PIR,CIR. If no meter id needs to be referenced, |
| 44 | * null can be sent |
| 45 | * @param tagInformation the uni tag (ctag, stag) information |
| 46 | * @param install true to install the flow, false to remove the flow |
| 47 | * @param upstream true if trapped packets are flowing upstream towards |
| 48 | * server, false if packets are flowing downstream towards client |
| 49 | * @param dhcpFuture gets result of dhcp objective when complete |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 50 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 51 | void processDhcpFilteringObjectives(AccessDevicePort port, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 52 | MeterId upstreamMeterId, |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 53 | MeterId upstreamOltMeterId, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 54 | UniTagInformation tagInformation, |
| 55 | boolean install, |
Tunahan Sezen | a07fe96 | 2021-02-24 08:24:24 +0000 | [diff] [blame] | 56 | boolean upstream, |
| 57 | Optional<CompletableFuture<ObjectiveError>> dhcpFuture); |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 58 | |
| 59 | /** |
| 60 | * Trap igmp packets to the controller. |
| 61 | * |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 62 | * @param port Uni Port number |
| 63 | * @param upstreamMeterId upstream meter id that represents the upstream bandwidth profile |
| 64 | * @param upstreamOltMeterId upstream meter id of OLT device that represents the upstream bandwidth profile |
| 65 | * @param tagInformation the uni tag information of the subscriber |
| 66 | * @param install the indicator to install or to remove the flow |
| 67 | * @param upstream determines the direction of the flow |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 68 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 69 | void processIgmpFilteringObjectives(AccessDevicePort port, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 70 | MeterId upstreamMeterId, |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 71 | MeterId upstreamOltMeterId, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 72 | UniTagInformation tagInformation, |
| 73 | boolean install, |
| 74 | boolean upstream); |
| 75 | |
| 76 | /** |
| 77 | * Trap eapol authentication packets to the controller. |
| 78 | * |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 79 | * @param port the port for which this trap flow is designated |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 80 | * @param bpId bandwidth profile id to add the related meter to the flow |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 81 | * @param oltBpId bandwidth profile id of OLT device to add the related meter to the flow |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 82 | * @param filterFuture completable future for this filtering objective operation |
| 83 | * @param vlanId the default or customer tag for a subscriber |
| 84 | * @param install true to install the flow, false to remove the flow |
| 85 | */ |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 86 | void processEapolFilteringObjectives(AccessDevicePort port, |
| 87 | String bpId, |
| 88 | Optional<String> oltBpId, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 89 | CompletableFuture<ObjectiveError> filterFuture, |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 90 | VlanId vlanId, |
| 91 | boolean install); |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 92 | |
| 93 | /** |
Gustavo Silva | 5c492dd | 2021-02-12 10:21:11 -0300 | [diff] [blame] | 94 | * Trap PPPoE discovery packets to the controller. |
| 95 | * |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 96 | * @param port the uni port for which this trap flow is designated |
| 97 | * @param upstreamMeterId the upstream meter id that includes the upstream |
| 98 | * bandwidth profile values such as PIR,CIR. If no meter id needs to be referenced, |
| 99 | * null can be sent |
| 100 | * @param upstreamOltMeterId the upstream meter id of OLT device that includes the upstream |
| 101 | * bandwidth profile values such as PIR,CIR. If no meter id needs to be referenced, |
| 102 | * null can be sent |
| 103 | * @param tagInformation the uni tag (ctag, stag) information |
| 104 | * @param install true to install the flow, false to remove the flow |
| 105 | * @param upstream true if trapped packets are flowing upstream towards |
| 106 | * server, false if packets are flowing downstream towards client |
Gustavo Silva | 5c492dd | 2021-02-12 10:21:11 -0300 | [diff] [blame] | 107 | **/ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 108 | void processPPPoEDFilteringObjectives(AccessDevicePort port, |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 109 | MeterId upstreamMeterId, |
| 110 | MeterId upstreamOltMeterId, |
| 111 | UniTagInformation tagInformation, |
| 112 | boolean install, |
| 113 | boolean upstream); |
Gustavo Silva | 5c492dd | 2021-02-12 10:21:11 -0300 | [diff] [blame] | 114 | |
| 115 | /** |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 116 | * Trap lldp packets to the controller. |
| 117 | * |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 118 | * @param port the port for which this trap flow is designated |
| 119 | * @param install true to install the flow, false to remove the flow |
| 120 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 121 | void processLldpFilteringObjective(AccessDevicePort port, boolean install); |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 122 | |
| 123 | /** |
| 124 | * Installs trap filtering objectives for particular traffic types (LLDP, IGMP and DHCP) on an |
| 125 | * NNI port. |
| 126 | * |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 127 | * @param port port number |
| 128 | * @param install true to install, false to remove |
| 129 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 130 | void processNniFilteringObjectives(AccessDevicePort port, boolean install); |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 131 | |
| 132 | /** |
| 133 | * Creates a ForwardingObjective builder with double-tag match criteria and output |
| 134 | * action. The treatment will not contain pop or push actions. |
| 135 | * If the last parameter is true, use the upstream meter id and vice versa. |
| 136 | * |
| 137 | * @param uplinkPort the nni port |
| 138 | * @param subscriberPort the uni port |
| 139 | * @param meterId the meter id that is assigned to upstream or downstream flows |
| 140 | * @param tagInfo the uni tag information |
| 141 | * @param upstream true to create upstream, false to create downstream builder |
| 142 | * @return ForwardingObjective.Builder |
| 143 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 144 | ForwardingObjective.Builder createTransparentBuilder(AccessDevicePort uplinkPort, |
| 145 | AccessDevicePort subscriberPort, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 146 | MeterId meterId, |
| 147 | UniTagInformation tagInfo, |
| 148 | boolean upstream); |
| 149 | |
| 150 | /** |
| 151 | * Creates a ForwardingObjective builder for the upstream flows. |
| 152 | * The treatment will contain push action |
| 153 | * |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 154 | * @param uplinkPort the nni port |
| 155 | * @param subscriberPort the uni port |
| 156 | * @param upstreamMeterId the meter id that is assigned to upstream flows |
| 157 | * @param upstreamOltMeterId the meter id that is assigned to upstream flows for OLT device |
| 158 | * @param uniTagInformation the uni tag information |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 159 | * @return ForwardingObjective.Builder |
| 160 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 161 | ForwardingObjective.Builder createUpBuilder(AccessDevicePort uplinkPort, |
| 162 | AccessDevicePort subscriberPort, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 163 | MeterId upstreamMeterId, |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 164 | MeterId upstreamOltMeterId, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 165 | UniTagInformation uniTagInformation); |
| 166 | |
| 167 | /** |
| 168 | * Creates a ForwardingObjective builder for the downstream flows. |
| 169 | * The treatment will contain pop action |
| 170 | * |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 171 | * @param uplinkPort the nni port |
| 172 | * @param subscriberPort the uni port |
| 173 | * @param downstreamMeterId the meter id that is assigned to downstream flows |
| 174 | * @param downstreamOltMeterId the meter id that is assigned to downstream flows |
| 175 | * @param tagInformation the uni tag information |
| 176 | * @param macAddress the mac address |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 177 | * @return ForwardingObjective.Builder |
| 178 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 179 | ForwardingObjective.Builder createDownBuilder(AccessDevicePort uplinkPort, |
| 180 | AccessDevicePort subscriberPort, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 181 | MeterId downstreamMeterId, |
yasin sapli | b4b8ee1 | 2021-06-13 18:25:20 +0000 | [diff] [blame] | 182 | MeterId downstreamOltMeterId, |
Tunahan Sezen | a07fe96 | 2021-02-24 08:24:24 +0000 | [diff] [blame] | 183 | UniTagInformation tagInformation, |
| 184 | Optional<MacAddress> macAddress); |
Andrea Campanella | 600d2e2 | 2020-06-22 11:00:31 +0200 | [diff] [blame] | 185 | |
| 186 | /** |
| 187 | * Clears pending mappings and state for device. |
| 188 | * @param deviceId the device id |
| 189 | */ |
| 190 | void clearDeviceState(DeviceId deviceId); |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 191 | } |