Daniele Moro | 5e66f98 | 2021-06-11 16:41:48 +0200 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package org.onosproject.net.behaviour.upf; |
| 18 | |
| 19 | import com.google.common.annotations.Beta; |
| 20 | import org.onosproject.net.driver.HandlerBehaviour; |
Daniele Moro | 668b3d9 | 2021-07-05 23:37:36 +0200 | [diff] [blame] | 21 | import org.onosproject.net.flow.FlowRule; |
Daniele Moro | 909b958 | 2022-01-26 15:47:29 +0100 | [diff] [blame^] | 22 | import org.onosproject.net.meter.Meter; |
Daniele Moro | 5e66f98 | 2021-06-11 16:41:48 +0200 | [diff] [blame] | 23 | |
Daniele Moro | 5e66f98 | 2021-06-11 16:41:48 +0200 | [diff] [blame] | 24 | /** |
| 25 | * Provides means to update the device forwarding state to implement a 3GPP |
| 26 | * User Plane Function. An implementation of this API should not write state |
| 27 | * directly to the device, but instead, always rely on core ONOS subsystems |
| 28 | * (e.g., FlowRuleService, GroupService, etc). |
| 29 | */ |
| 30 | @Beta |
| 31 | public interface UpfProgrammable extends HandlerBehaviour, UpfDevice { |
| 32 | /** |
| 33 | * Apps are expected to call this method as the first one when they are ready |
tosinski | 36ba33a | 2021-11-22 16:53:00 +0100 | [diff] [blame] | 34 | * to install any UPF entity. |
Daniele Moro | 5e66f98 | 2021-06-11 16:41:48 +0200 | [diff] [blame] | 35 | * |
| 36 | * @return True if initialized, false otherwise. |
| 37 | */ |
| 38 | boolean init(); |
Daniele Moro | 668b3d9 | 2021-07-05 23:37:36 +0200 | [diff] [blame] | 39 | |
Daniele Moro | 668b3d9 | 2021-07-05 23:37:36 +0200 | [diff] [blame] | 40 | /** |
| 41 | * Checks if the given flow rule has been generated by this UPF behaviour. |
| 42 | * |
| 43 | * @param flowRule the flow rule to check |
| 44 | * @return True if the given flow rule has been created by this UPF behaviour, False otherwise. |
| 45 | */ |
| 46 | boolean fromThisUpf(FlowRule flowRule); |
Daniele Moro | 909b958 | 2022-01-26 15:47:29 +0100 | [diff] [blame^] | 47 | |
| 48 | /** |
| 49 | * Checks if the given meter has been generated by this UPF behaviour. |
| 50 | * |
| 51 | * @param meter the meter to check |
| 52 | * @return True if the given meter has been created by this UPF behaviour, False otherwise. |
| 53 | */ |
| 54 | boolean fromThisUpf(Meter meter); |
Daniele Moro | 5e66f98 | 2021-06-11 16:41:48 +0200 | [diff] [blame] | 55 | } |