blob: 9b5d853d4edd452c70fb512853a5b8f4bc7835ec [file] [log] [blame]
Daniele Moro8d630f12021-06-15 20:53:22 +02001/*
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
17package org.onosproject.pipelines.fabric.impl.behaviour.upf;
18
Daniele Moro8d630f12021-06-15 20:53:22 +020019import org.onlab.util.ImmutableByteSequence;
Daniele Moro8d630f12021-06-15 20:53:22 +020020
21import java.util.Map;
Daniele Moro8d630f12021-06-15 20:53:22 +020022
23/**
24 * Stores state required for translation of UPF entities to pipeline-specific ones.
25 */
26public interface FabricUpfStore {
27 /**
28 * Clear all state associated with translation.
29 */
30 void reset();
31
32 /**
33 * Returns the farIdMap.
34 *
35 * @return the farIdMap.
36 */
37 Map<UpfRuleIdentifier, Integer> getFarIdMap();
38
39 /**
40 * Get a globally unique integer identifier for the FAR identified by the given (Session ID, Far
41 * ID) pair.
42 *
43 * @param farIdPair a RuleIdentifier instance uniquely identifying the FAR
44 * @return A globally unique integer identifier
45 */
46 int globalFarIdOf(UpfRuleIdentifier farIdPair);
47
48 /**
49 * Get a globally unique integer identifier for the FAR identified by the given (Session ID, Far
50 * ID) pair.
51 *
52 * @param pfcpSessionId The ID of the PFCP session that produced the FAR ID.
53 * @param sessionLocalFarId The FAR ID.
54 * @return A globally unique integer identifier
55 */
56 int globalFarIdOf(ImmutableByteSequence pfcpSessionId, int sessionLocalFarId);
57
58 /**
59 * Get the corresponding PFCP session ID and session-local FAR ID from a globally unique FAR ID,
60 * or return null if no such mapping is found.
61 *
62 * @param globalFarId globally unique FAR ID
63 * @return the corresponding PFCP session ID and session-local FAR ID, as a RuleIdentifier
64 */
65 UpfRuleIdentifier localFarIdOf(int globalFarId);
66
67 /**
68 * Get the corresponding queue Id from scheduling priority.
69 *
70 * @param schedulingPriority QCI scheduling priority
71 * @return the corresponding queue ID
72 */
73 String queueIdOf(int schedulingPriority);
74
75 /**
76 * Get the corresponding queue Id from scheduling priority.
77 *
78 * @param queueId Tofino queue Id
79 * @return the corresponding scheduling priroity
Daniele Morof8517ca2021-06-23 18:09:39 +020080 */
Daniele Moro8d630f12021-06-15 20:53:22 +020081 String schedulingPriorityOf(int queueId);
Daniele Moro8d630f12021-06-15 20:53:22 +020082}