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 | * |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +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 tagInformation the uni tag (ctag, stag) information |
| 43 | * @param install true to install the flow, false to remove the flow |
| 44 | * @param upstream true if trapped packets are flowing upstream towards |
| 45 | * server, false if packets are flowing downstream towards client |
Tunahan Sezen | a07fe96 | 2021-02-24 08:24:24 +0000 | [diff] [blame] | 46 | * @param dhcpFuture gets result of dhcp objective when complete |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 47 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 48 | void processDhcpFilteringObjectives(AccessDevicePort port, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 49 | MeterId upstreamMeterId, |
| 50 | UniTagInformation tagInformation, |
| 51 | boolean install, |
Tunahan Sezen | a07fe96 | 2021-02-24 08:24:24 +0000 | [diff] [blame] | 52 | boolean upstream, |
| 53 | Optional<CompletableFuture<ObjectiveError>> dhcpFuture); |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 54 | |
| 55 | /** |
| 56 | * Trap igmp packets to the controller. |
| 57 | * |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 58 | * @param port Uni Port number |
| 59 | * @param upstreamMeterId upstream meter id that represents the upstream bandwidth profile |
| 60 | * @param tagInformation the uni tag information of the subscriber |
| 61 | * @param install the indicator to install or to remove the flow |
| 62 | * @param upstream determines the direction of the flow |
| 63 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 64 | void processIgmpFilteringObjectives(AccessDevicePort port, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 65 | MeterId upstreamMeterId, |
| 66 | UniTagInformation tagInformation, |
| 67 | boolean install, |
| 68 | boolean upstream); |
| 69 | |
| 70 | /** |
| 71 | * Trap eapol authentication packets to the controller. |
| 72 | * |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 73 | * @param port the port for which this trap flow is designated |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 74 | * @param bpId bandwidth profile id to add the related meter to the flow |
| 75 | * @param filterFuture completable future for this filtering objective operation |
| 76 | * @param vlanId the default or customer tag for a subscriber |
| 77 | * @param install true to install the flow, false to remove the flow |
| 78 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 79 | void processEapolFilteringObjectives(AccessDevicePort port, String bpId, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 80 | CompletableFuture<ObjectiveError> filterFuture, |
| 81 | VlanId vlanId, boolean install); |
| 82 | |
| 83 | /** |
Gustavo Silva | 5c492dd | 2021-02-12 10:21:11 -0300 | [diff] [blame] | 84 | * Trap PPPoE discovery packets to the controller. |
| 85 | * |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 86 | * @param port the uni port for which this trap flow is designated |
Gustavo Silva | 5c492dd | 2021-02-12 10:21:11 -0300 | [diff] [blame] | 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 | **/ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 95 | void processPPPoEDFilteringObjectives(AccessDevicePort port, |
Gustavo Silva | 5c492dd | 2021-02-12 10:21:11 -0300 | [diff] [blame] | 96 | MeterId upstreamMeterId, UniTagInformation tagInformation, |
| 97 | boolean install, boolean upstream); |
| 98 | |
| 99 | /** |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 100 | * Trap lldp packets to the controller. |
| 101 | * |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 102 | * @param port the port for which this trap flow is designated |
| 103 | * @param install true to install the flow, false to remove the flow |
| 104 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 105 | void processLldpFilteringObjective(AccessDevicePort port, boolean install); |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 106 | |
| 107 | /** |
| 108 | * Installs trap filtering objectives for particular traffic types (LLDP, IGMP and DHCP) on an |
| 109 | * NNI port. |
| 110 | * |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 111 | * @param port port number |
| 112 | * @param install true to install, false to remove |
| 113 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 114 | void processNniFilteringObjectives(AccessDevicePort port, boolean install); |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 115 | |
| 116 | /** |
| 117 | * Creates a ForwardingObjective builder with double-tag match criteria and output |
| 118 | * action. The treatment will not contain pop or push actions. |
| 119 | * If the last parameter is true, use the upstream meter id and vice versa. |
| 120 | * |
| 121 | * @param uplinkPort the nni port |
| 122 | * @param subscriberPort the uni port |
| 123 | * @param meterId the meter id that is assigned to upstream or downstream flows |
| 124 | * @param tagInfo the uni tag information |
| 125 | * @param upstream true to create upstream, false to create downstream builder |
| 126 | * @return ForwardingObjective.Builder |
| 127 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 128 | ForwardingObjective.Builder createTransparentBuilder(AccessDevicePort uplinkPort, |
| 129 | AccessDevicePort subscriberPort, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 130 | MeterId meterId, |
| 131 | UniTagInformation tagInfo, |
| 132 | boolean upstream); |
| 133 | |
| 134 | /** |
| 135 | * Creates a ForwardingObjective builder for the upstream flows. |
| 136 | * The treatment will contain push action |
| 137 | * |
| 138 | * @param uplinkPort the nni port |
| 139 | * @param subscriberPort the uni port |
| 140 | * @param upstreamMeterId the meter id that is assigned to upstream flows |
| 141 | * @param uniTagInformation the uni tag information |
| 142 | * @return ForwardingObjective.Builder |
| 143 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 144 | ForwardingObjective.Builder createUpBuilder(AccessDevicePort uplinkPort, |
| 145 | AccessDevicePort subscriberPort, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 146 | MeterId upstreamMeterId, |
| 147 | UniTagInformation uniTagInformation); |
| 148 | |
| 149 | /** |
| 150 | * Creates a ForwardingObjective builder for the downstream flows. |
| 151 | * The treatment will contain pop action |
| 152 | * |
| 153 | * @param uplinkPort the nni port |
| 154 | * @param subscriberPort the uni port |
| 155 | * @param downstreamMeterId the meter id that is assigned to downstream flows |
| 156 | * @param tagInformation the uni tag information |
Tunahan Sezen | a07fe96 | 2021-02-24 08:24:24 +0000 | [diff] [blame] | 157 | * @param macAddress the mac address |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 158 | * @return ForwardingObjective.Builder |
| 159 | */ |
Tunahan Sezen | f0843b9 | 2021-04-30 07:13:16 +0000 | [diff] [blame] | 160 | ForwardingObjective.Builder createDownBuilder(AccessDevicePort uplinkPort, |
| 161 | AccessDevicePort subscriberPort, |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 162 | MeterId downstreamMeterId, |
Tunahan Sezen | a07fe96 | 2021-02-24 08:24:24 +0000 | [diff] [blame] | 163 | UniTagInformation tagInformation, |
| 164 | Optional<MacAddress> macAddress); |
Andrea Campanella | 600d2e2 | 2020-06-22 11:00:31 +0200 | [diff] [blame] | 165 | |
| 166 | /** |
| 167 | * Clears pending mappings and state for device. |
| 168 | * @param deviceId the device id |
| 169 | */ |
| 170 | void clearDeviceState(DeviceId deviceId); |
Andrea Campanella | cbbb795 | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 171 | } |