blob: 8be5d4d2134c65a42508d9ff9843549fec85235e [file] [log] [blame]
tony-liuaff59a72016-10-21 15:41:46 +08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
tony-liuaff59a72016-10-21 15:41:46 +08003 *
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.tetunnel.api.tunnel;
18
19import org.onosproject.tetopology.management.api.node.TeNodeKey;
20import org.onosproject.tetopology.management.api.node.TtpKey;
21import org.onosproject.tetunnel.api.tunnel.path.TePath;
22
23import java.util.List;
24
25/**
26 * Representation of a TE tunnel attributes.
27 */
28public interface TeTunnel {
29
30 /**
31 * TE tunnel types.
32 */
33 enum Type {
34 /**
35 * Designates TE point-to-point tunnel.
36 */
37 P2P,
38 /**
39 * Designates TE point-to-multipoint tunnel.
40 */
41 P2MP,
42 /**
43 * Designates RSVP-TE path signaling tunnel.
44 */
45 PATH_SIGNALING_RSVPTE,
46 /**
47 * Designates Segment-routing path signaling tunnel.
48 */
49 PATH_SIGNALING_SR
50 }
51
52 /**
53 * LSP protection types.
54 */
55 enum LspProtectionType {
56 /**
57 * Designates LSP protection "Unprotected".
58 */
59 LSP_PROT_UNPROTECTED,
60 /**
61 * Designates LSP protection "Rerouting without Extra-Traffic".
62 */
63 LSP_PROT_REROUTE,
64 /**
65 * Designates LSP protection "(Full) Rerouting".
66 */
67 LSP_PROT_REROUTE_EXTRA,
68 /**
69 * Designates LSP protection "1+1 Unidirectional Protection".
70 */
71 LSP_PROT_UNIDIR_1_TO_1,
72 /**
73 * Designates LSP protection "1+1 Bidirectional Protection".
74 */
75 LSP_PROT_BIDIR_1_TO_1,
76 /**
77 * Designates LSP protection "1:N Protection with Extra-Traffic".
78 */
79 LSP_PROT_1_FOR_N
80 }
81
82 /**
83 * TE Tunnel state.
84 */
85 enum State {
86 /**
87 * Designates the tunnel is down (non-operational).
88 */
89 DOWN,
90 /**
91 * Designates the tunnel is up.
92 */
93 UP
94 }
95
96 /**
97 * Returns the TE tunnel key.
98 *
99 * @return TE tunnel key
100 */
101 TeTunnelKey teTunnelKey();
102
103 /**
104 * Returns the name of the TE tunnel.
105 *
106 * @return name of the TE tunnel
107 */
108 String name();
109
110 /**
111 * Returns the type of the TE tunnel.
112 *
113 * @return type of the TE tunnel
114 */
115 Type type();
116
117 /**
118 * Returns the key of source TE node of this TE tunnel.
119 *
120 * @return key of the source TE node
121 */
122 TeNodeKey srcNode();
123
124 /**
125 * Returns key of the source TE termination point of this tunnel.
126 *
127 * @return key of the source TE termination point
128 */
129 TtpKey srcTp();
130
131 /**
132 * Returns key of the destination TE node of this TE tunnel.
133 *
134 * @return key of the destination TE node
135 */
136 TeNodeKey dstNode();
137
138 /**
139 * Returns key of the destination TE termination point of this TE tunnel.
140 *
141 * @return key of the destination TE termination point
142 */
143 TtpKey dstTp();
144
145 /**
146 * Returns the TE LSP protection type of the TE tunnel.
147 *
148 * @return TE LSP protection type of the TE tunnel
149 */
150 LspProtectionType lspProtectionType();
151
152 /**
153 * Returns the TE tunnel administrative state.
154 *
155 * @return TE tunnel administrative state
156 */
157 State adminStatus();
158
159 /**
160 * Returns primary paths of this TE tunnel.
161 *
162 * @return a list of TE paths
163 */
164 List<TePath> primaryPaths();
165
166 /**
167 * Returns segment tunnels of this (E2E cross-domain) tunnel.
168 *
169 * @return a list of keys of the segment tunnels
170 */
171 List<TeTunnelKey> segmentTunnels();
172
173 /**
174 * Sets segment tunnels of this (E2E cross-domain) tunnel.
175 *
176 * @param segmentTunnels a list of keys of segment tunnels
177 */
178 void segmentTunnels(List<TeTunnelKey> segmentTunnels);
179
180 /**
181 * Returns key of the E2E tunnel of this (segment) tunnel.
182 *
183 * @return key of the corresponding E2E TE tunnel
184 */
tony-liuf7d2a262016-10-17 16:32:24 +0800185 TeTunnelKey e2eTunnelKey();
tony-liuaff59a72016-10-21 15:41:46 +0800186
187 /**
188 * Sets the E2E tunnel of this (segment) tunnel.
189 *
tony-liuf7d2a262016-10-17 16:32:24 +0800190 * @param e2eTunnelKey key of the corresponding E2E tunnel
tony-liuaff59a72016-10-21 15:41:46 +0800191 */
tony-liuf7d2a262016-10-17 16:32:24 +0800192 void e2eTunnelKey(TeTunnelKey e2eTunnelKey);
tony-liuaff59a72016-10-21 15:41:46 +0800193
194 //TODO: add more required TE attributes
195}