blob: 8069adf91bd615fd832aa28cb664945cf3d2f20e [file] [log] [blame]
Jian Li66f6e3c2019-01-25 10:24:44 +09001/*
2 * Copyright 2019-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 */
16package org.onosproject.k8snetworking.api;
17
18import org.onosproject.core.ApplicationId;
19import org.onosproject.net.DeviceId;
20import org.onosproject.net.flow.TrafficSelector;
21import org.onosproject.net.flow.TrafficTreatment;
22
23/**
24 * Service for setting flow rules.
25 */
26public interface K8sFlowRuleService {
27
28 /**
29 * Configure the flow rule.
30 *
31 * @param appId application ID
32 * @param deviceId device ID
33 * @param selector traffic selector used for match header fields
34 * @param treatment traffic treatment for take actions for matched packets
35 * @param priority rule priority
36 * @param tableType table number to install flow rules
37 * @param install true for rule addition, false for rule removal
38 */
39 void setRule(ApplicationId appId, DeviceId deviceId,
40 TrafficSelector selector, TrafficTreatment treatment,
41 int priority, int tableType, boolean install);
42
43 /**
44 * Installs table miss entry (drop rule) for the given flow table.
45 *
46 * @param deviceId device ID
47 * @param table table number
48 */
49 void setUpTableMissEntry(DeviceId deviceId, int table);
50
51 /**
52 * Installs a flow rule for transiting from table A to table B.
53 *
54 * @param deviceId device ID
55 * @param fromTable table number of table A
56 * @param toTable table number of table B
57 */
58 void connectTables(DeviceId deviceId, int fromTable, int toTable);
59}