blob: d53ab93777143d7b2ad4cefc32cb494311e9400c [file] [log] [blame]
samuel8d6b0a92015-07-11 13:22:57 +08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
samuel8d6b0a92015-07-11 13:22:57 +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 */
16package org.onosproject.net.behaviour;
17
18import org.onosproject.net.Annotated;
19import org.onosproject.net.Description;
20
21import com.google.common.annotations.Beta;
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070022import org.onosproject.net.SparseAnnotations;
23
24import java.util.Optional;
samuel8d6b0a92015-07-11 13:22:57 +080025
26/**
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070027 * Describes a tunnel interface.
samuel8d6b0a92015-07-11 13:22:57 +080028 */
29@Beta
30public interface TunnelDescription extends Description, Annotated {
31
32 /**
33 * Tunnel technology type.
34 */
35 enum Type {
36 /**
37 * Signifies that this is a MPLS tunnel.
38 */
39 MPLS,
40 /**
41 * Signifies that this is a L2 tunnel.
42 */
43 VLAN,
44 /**
45 * Signifies that this is a DC L2 extension tunnel.
46 */
47 VXLAN,
48 /**
49 * Signifies that this is a L3 tunnel.
50 */
51 GRE,
52 /**
Jian Li654204c2018-12-16 01:56:31 +090053 * Signifies that this is a L3 tunnel.
54 */
55 GENEVE,
56 /**
Jian Li4b3436a2022-03-23 13:07:19 +090057 * Signifies that this is a L3 tunnel.
58 */
59 STT,
60 /**
samuel8d6b0a92015-07-11 13:22:57 +080061 * Signifies that this is a L1 OTN tunnel.
62 */
63 ODUK,
64 /**
65 * Signifies that this is a L0 OCH tunnel.
66 */
67 OCH
68 }
69
70 /**
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070071 * Returns the identifier of the device where the interface is.
samuel8d6b0a92015-07-11 13:22:57 +080072 *
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070073 * @return device identifier
samuel8d6b0a92015-07-11 13:22:57 +080074 */
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070075 Optional<String> deviceId();
samuel8d6b0a92015-07-11 13:22:57 +080076
77 /**
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070078 * Return the name of the tunnel interface.
samuel8d6b0a92015-07-11 13:22:57 +080079 *
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070080 * @return tunnel interface name
samuel8d6b0a92015-07-11 13:22:57 +080081 */
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070082 String ifaceName();
samuel8d6b0a92015-07-11 13:22:57 +080083
84 /**
85 * Returns the tunnel type.
86 *
87 * @return tunnel type
88 */
89 Type type();
90
91 /**
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070092 * Returns the local connection point.
93 *
94 * @return tunnel source ConnectionPoint
95 */
96 Optional<TunnelEndPoint> local();
97
98 /**
99 * Returns the remote connection point.
100 *
101 * @return tunnel destination
102 */
103 Optional<TunnelEndPoint> remote();
104
105 /**
106 * Returns the tunnel key.
107 *
108 * @return tunnel key
109 */
110 Optional<TunnelKey> key();
111
112 /**
Hyunsun Moondd14e8e2016-06-09 16:17:32 -0700113 * Builder of tunnel interface description entities.
114 */
115 interface Builder {
116
117 /**
118 * Returns new tunnel interface description.
119 *
120 * @return tunnel description
121 */
122 TunnelDescription build();
123
124 /**
125 * Returns tunnel interface description biulder with supplied device ID.
126 *
127 * @param deviceId device identifier
128 * @return tunnel description builder
129 */
130 Builder deviceId(String deviceId);
131
132 /**
133 * Returns tunnel interface description builder with a given interface name.
134 *
135 * @param name tunnel interface name
136 * @return tunnel description builder
137 */
138 Builder ifaceName(String name);
139
140 /**
141 * Returns tunnel interface description builder with a given tunnel type.
142 *
143 * @param type tunnel type
144 * @return tunnel description builder
145 */
146 Builder type(Type type);
147
148 /**
149 * Returns tunnel interface description builder with a given local
150 * tunnel endpoint.
151 *
152 * @param endpoint tunnel endpoint
153 * @return tunnel description builder
154 */
155 Builder local(TunnelEndPoint endpoint);
156
157 /**
158 * Returns tunnel interface description builder with a given remote
159 * tunnel endpoint.
160 *
161 * @param endpoint tunnel endpoint
162 * @return tunnel description builder
163 */
164 Builder remote(TunnelEndPoint endpoint);
165
166 /**
167 * Returns tunnel interface description builder with a tunnel key.
168 *
Ray Milkeybb23e0b2016-08-02 17:00:21 -0700169 * @param tunnelKey tunnel key
Hyunsun Moondd14e8e2016-06-09 16:17:32 -0700170 * @return tunnel description builder
171 */
172 Builder key(TunnelKey tunnelKey);
173
174 /**
175 * Returns tunnel interface descriptions builder with other configurations.
176 *
177 * @param configs configurations
178 * @return tunnel description builder
179 */
180 Builder otherConfigs(SparseAnnotations configs);
181 }
samuel8d6b0a92015-07-11 13:22:57 +0800182}