This repository was archived by the owner on Jul 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathprovider_kernel.py
More file actions
77 lines (62 loc) · 3.04 KB
/
provider_kernel.py
File metadata and controls
77 lines (62 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Copyright(c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import flow_pb2 as pb
#????
from comm_struct import QosError
def Create(request, context):
print("kerenl implement: Create: ip link set...")
return pb.ResponseFlowCreate(error_info=pb.rte_flow_error(
type=-1, mesg='Create now not supported by kernel, wait implement.'))
def Destroy(request, context):
print("kerenl implement: Destroy: ip link set...")
return pb.ResponseFlow(error_info=pb.rte_flow_error(
type=-1, mesg='Destroy now not supported by kernel, wait implement.'))
def Validate(request, context):
print("kerenl implement: Validate: ip link set...")
return pb.ResponseFlow(error_info=pb.rte_flow_error(
type=-1, mesg='Validate now not supported by kernel, wait implement.'))
def Flush(request, context):
print("kerenl implement: Flush: ip link set...")
return pb.ResponseFlow(error_info=pb.rte_flow_error(
type=-1, mesg='Flush now not supported by kernel, wait implement.'))
def Query(request, context):
print("kerenl implement: Query: ip link set...")
return pb.ResponseFlowQuery(error_info=pb.rte_flow_error(
type=-1, mesg='Query now not supported by kernel, wait implement.'))
def List(request, context):
print("kerenl implement: List: ip link set...")
return pb.ResponseFlowList()
def Isolate(request, context):
print("kerenl implement: Isolate: ip link set...")
return pb.ResponseFlow(error_info=pb.rte_flow_error(
type=-1, mesg='Isolate now not supported by kernel, wait implement.'))
def Qos_shaper_profile_add(port_id, profile_id, cbw, pbw):
print("kerenl implement: shaper_profile_add")
raise QosError(-1, "shaper_profile_add not supported.")
def Qos_shaper_profile_del(port_id, profile_id):
print("kerenl implement: shaper_profile_del.")
def Qos_node_add(port_id, node_id, parent_node_id, level_id, profile_id):
print("kerenl implement: QoS_node_add")
raise QosError(-1, "Qos_node_add not supported.")
def Qos_node_delete(port_id, node_id):
print("kerenl implement: Qos_node_delete.")
def Qos_commit(port_id):
print("kerenl implement: schedual tree commit")
raise QosError(-1, "schedual tree commit not supported.")
def init_ports(ports_config, server_config):
print("kerenl implement: Initalize: ip link set...")
return None
def handle_exit(port_config):
print("kerenl implement: handle exit...")
return True