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 | |
| 18 | import org.onlab.packet.VlanId; |
| 19 | import org.onosproject.net.DeviceId; |
| 20 | import org.onosproject.net.PortNumber; |
| 21 | import org.onosproject.net.flowobjective.ForwardingObjective; |
| 22 | import org.onosproject.net.flowobjective.ObjectiveError; |
| 23 | import org.onosproject.net.meter.MeterId; |
| 24 | import org.opencord.sadis.UniTagInformation; |
| 25 | |
| 26 | import java.util.concurrent.CompletableFuture; |
| 27 | |
| 28 | /** |
| 29 | * Olt service for flow operations. |
| 30 | */ |
| 31 | public interface AccessDeviceFlowService { |
| 32 | |
| 33 | /** |
| 34 | * Provisions or removes trap-to-controller DHCP packets. |
| 35 | * |
| 36 | * @param devId the target device identifier |
| 37 | * @param port the uni port for which this trap flow is designated |
| 38 | * @param upstreamMeterId the upstream meter id that includes the upstream |
| 39 | * bandwidth profile values such as PIR,CIR. If no meter id needs to be referenced, |
| 40 | * null can be sent |
| 41 | * @param tagInformation the uni tag (ctag, stag) information |
| 42 | * @param install true to install the flow, false to remove the flow |
| 43 | * @param upstream true if trapped packets are flowing upstream towards |
| 44 | * server, false if packets are flowing downstream towards client |
| 45 | */ |
| 46 | void processDhcpFilteringObjectives(DeviceId devId, PortNumber port, |
| 47 | MeterId upstreamMeterId, |
| 48 | UniTagInformation tagInformation, |
| 49 | boolean install, |
| 50 | boolean upstream); |
| 51 | |
| 52 | /** |
| 53 | * Trap igmp packets to the controller. |
| 54 | * |
| 55 | * @param devId Device identifier to send the flow |
| 56 | * @param port Uni Port number |
| 57 | * @param upstreamMeterId upstream meter id that represents the upstream bandwidth profile |
| 58 | * @param tagInformation the uni tag information of the subscriber |
| 59 | * @param install the indicator to install or to remove the flow |
| 60 | * @param upstream determines the direction of the flow |
| 61 | */ |
| 62 | void processIgmpFilteringObjectives(DeviceId devId, PortNumber port, |
| 63 | MeterId upstreamMeterId, |
| 64 | UniTagInformation tagInformation, |
| 65 | boolean install, |
| 66 | boolean upstream); |
| 67 | |
| 68 | /** |
| 69 | * Trap eapol authentication packets to the controller. |
| 70 | * |
| 71 | * @param devId the device identifier |
| 72 | * @param portNumber the port for which this trap flow is designated |
| 73 | * @param bpId bandwidth profile id to add the related meter to the flow |
| 74 | * @param filterFuture completable future for this filtering objective operation |
| 75 | * @param vlanId the default or customer tag for a subscriber |
| 76 | * @param install true to install the flow, false to remove the flow |
| 77 | */ |
| 78 | void processEapolFilteringObjectives(DeviceId devId, PortNumber portNumber, String bpId, |
| 79 | CompletableFuture<ObjectiveError> filterFuture, |
| 80 | VlanId vlanId, boolean install); |
| 81 | |
| 82 | /** |
| 83 | * Trap lldp packets to the controller. |
| 84 | * |
| 85 | * @param devId the device identifier |
| 86 | * @param port the port for which this trap flow is designated |
| 87 | * @param install true to install the flow, false to remove the flow |
| 88 | */ |
| 89 | void processLldpFilteringObjective(DeviceId devId, PortNumber port, boolean install); |
| 90 | |
| 91 | /** |
| 92 | * Installs trap filtering objectives for particular traffic types (LLDP, IGMP and DHCP) on an |
| 93 | * NNI port. |
| 94 | * |
| 95 | * @param devId device ID |
| 96 | * @param port port number |
| 97 | * @param install true to install, false to remove |
| 98 | */ |
| 99 | void processNniFilteringObjectives(DeviceId devId, PortNumber port, boolean install); |
| 100 | |
| 101 | /** |
| 102 | * Creates a ForwardingObjective builder with double-tag match criteria and output |
| 103 | * action. The treatment will not contain pop or push actions. |
| 104 | * If the last parameter is true, use the upstream meter id and vice versa. |
| 105 | * |
| 106 | * @param uplinkPort the nni port |
| 107 | * @param subscriberPort the uni port |
| 108 | * @param meterId the meter id that is assigned to upstream or downstream flows |
| 109 | * @param tagInfo the uni tag information |
| 110 | * @param upstream true to create upstream, false to create downstream builder |
| 111 | * @return ForwardingObjective.Builder |
| 112 | */ |
| 113 | ForwardingObjective.Builder createTransparentBuilder(PortNumber uplinkPort, |
| 114 | PortNumber subscriberPort, |
| 115 | MeterId meterId, |
| 116 | UniTagInformation tagInfo, |
| 117 | boolean upstream); |
| 118 | |
| 119 | /** |
| 120 | * Creates a ForwardingObjective builder for the upstream flows. |
| 121 | * The treatment will contain push action |
| 122 | * |
| 123 | * @param uplinkPort the nni port |
| 124 | * @param subscriberPort the uni port |
| 125 | * @param upstreamMeterId the meter id that is assigned to upstream flows |
| 126 | * @param uniTagInformation the uni tag information |
| 127 | * @return ForwardingObjective.Builder |
| 128 | */ |
| 129 | ForwardingObjective.Builder createUpBuilder(PortNumber uplinkPort, |
| 130 | PortNumber subscriberPort, |
| 131 | MeterId upstreamMeterId, |
| 132 | UniTagInformation uniTagInformation); |
| 133 | |
| 134 | /** |
| 135 | * Creates a ForwardingObjective builder for the downstream flows. |
| 136 | * The treatment will contain pop action |
| 137 | * |
| 138 | * @param uplinkPort the nni port |
| 139 | * @param subscriberPort the uni port |
| 140 | * @param downstreamMeterId the meter id that is assigned to downstream flows |
| 141 | * @param tagInformation the uni tag information |
| 142 | * @return ForwardingObjective.Builder |
| 143 | */ |
| 144 | ForwardingObjective.Builder createDownBuilder(PortNumber uplinkPort, |
| 145 | PortNumber subscriberPort, |
| 146 | MeterId downstreamMeterId, |
| 147 | UniTagInformation tagInformation); |
| 148 | } |