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; |
| 21 | import org.onosproject.net.PortNumber; |
| 22 | import org.onosproject.net.flowobjective.ForwardingObjective; |
| 23 | import org.onosproject.net.flowobjective.ObjectiveError; |
| 24 | import org.onosproject.net.meter.MeterId; |
| 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 | * |
| 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 Sezen | a07fe96 | 2021-02-24 08:24:24 +0000 | [diff] [blame^] | 47 | * @param dhcpFuture gets result of dhcp objective when complete |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 48 | */ |
| 49 | void processDhcpFilteringObjectives(DeviceId devId, PortNumber port, |
| 50 | MeterId upstreamMeterId, |
| 51 | UniTagInformation tagInformation, |
| 52 | boolean install, |
Tunahan Sezen | a07fe96 | 2021-02-24 08:24:24 +0000 | [diff] [blame^] | 53 | boolean upstream, |
| 54 | Optional<CompletableFuture<ObjectiveError>> dhcpFuture); |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 55 | |
| 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 Silva | 5c492dd | 2021-02-12 10:21:11 -0300 | [diff] [blame] | 87 | * 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 Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 104 | * 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 Sezen | a07fe96 | 2021-02-24 08:24:24 +0000 | [diff] [blame^] | 163 | * @param macAddress the mac address |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 164 | * @return ForwardingObjective.Builder |
| 165 | */ |
| 166 | ForwardingObjective.Builder createDownBuilder(PortNumber uplinkPort, |
| 167 | PortNumber subscriberPort, |
| 168 | MeterId downstreamMeterId, |
Tunahan Sezen | a07fe96 | 2021-02-24 08:24:24 +0000 | [diff] [blame^] | 169 | UniTagInformation tagInformation, |
| 170 | Optional<MacAddress> macAddress); |
Andrea Campanella | 600d2e2 | 2020-06-22 11:00:31 +0200 | [diff] [blame] | 171 | |
| 172 | /** |
| 173 | * Clears pending mappings and state for device. |
| 174 | * @param deviceId the device id |
| 175 | */ |
| 176 | void clearDeviceState(DeviceId deviceId); |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 177 | } |