Newer
Older
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
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# 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.
from enum import IntEnum
class CapacityUnit(IntEnum):
TB = 0
TBPS = 1
GB = 2
GBPS = 3
MB = 4
MBPS = 5
KB = 6
KBPS = 7
GHZ = 8
MHZ = 9
CAPACITY_MULTIPLIER = {
CapacityUnit.TB : 1.e12,
CapacityUnit.TBPS : 1.e12,
CapacityUnit.GB : 1.e9,
CapacityUnit.GBPS : 1.e9,
CapacityUnit.MB : 1.e6,
CapacityUnit.MBPS : 1.e6,
CapacityUnit.KB : 1.e3,
CapacityUnit.KBPS : 1.e3,
CapacityUnit.GHZ : 1.e9,
CapacityUnit.MHZ : 1.e6,
}
class LinkPortDirection(IntEnum):
BIDIRECTIONAL = 0
INPUT = 1
OUTPUT = 2
UNKNOWN = 3
class TerminationDirection(IntEnum):
BIDIRECTIONAL = 0
SINK = 1
SOURCE = 2
UNKNOWN = 3
class TerminationState(IntEnum):
CAN_NEVER_TERMINATE = 0
NOT_TERMINATED = 1
TERMINATED_SERVER_TO_CLIENT = 2
TERMINATED_CLIENT_TO_SERVER = 3
TERMINATED_BIDIRECTIONAL = 4
PERMENANTLY_TERMINATED = 5
TERMINATION_STATE_UNKNOWN = 6
class LinkForwardingDirection(IntEnum):
BIDIRECTIONAL = 0
UNIDIRECTIONAL = 1
UNKNOWN = 2