blob: c78ab5761041656ba99bef320a2bf1d349b29309 [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 /**
53 * Signifies that this is a L1 OTN tunnel.
54 */
55 ODUK,
56 /**
57 * Signifies that this is a L0 OCH tunnel.
58 */
59 OCH
60 }
61
62 /**
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070063 * Returns the identifier of the device where the interface is.
samuel8d6b0a92015-07-11 13:22:57 +080064 *
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070065 * @return device identifier
samuel8d6b0a92015-07-11 13:22:57 +080066 */
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070067 Optional<String> deviceId();
samuel8d6b0a92015-07-11 13:22:57 +080068
69 /**
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070070 * Return the name of the tunnel interface.
samuel8d6b0a92015-07-11 13:22:57 +080071 *
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070072 * @return tunnel interface name
samuel8d6b0a92015-07-11 13:22:57 +080073 */
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070074 String ifaceName();
samuel8d6b0a92015-07-11 13:22:57 +080075
76 /**
77 * Returns the tunnel type.
78 *
79 * @return tunnel type
80 */
81 Type type();
82
83 /**
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070084 * Returns the local connection point.
85 *
86 * @return tunnel source ConnectionPoint
87 */
88 Optional<TunnelEndPoint> local();
89
90 /**
91 * Returns the remote connection point.
92 *
93 * @return tunnel destination
94 */
95 Optional<TunnelEndPoint> remote();
96
97 /**
98 * Returns the tunnel key.
99 *
100 * @return tunnel key
101 */
102 Optional<TunnelKey> key();
103
104 /**
Hyunsun Moondd14e8e2016-06-09 16:17:32 -0700105 * Builder of tunnel interface description entities.
106 */
107 interface Builder {
108
109 /**
110 * Returns new tunnel interface description.
111 *
112 * @return tunnel description
113 */
114 TunnelDescription build();
115
116 /**
117 * Returns tunnel interface description biulder with supplied device ID.
118 *
119 * @param deviceId device identifier
120 * @return tunnel description builder
121 */
122 Builder deviceId(String deviceId);
123
124 /**
125 * Returns tunnel interface description builder with a given interface name.
126 *
127 * @param name tunnel interface name
128 * @return tunnel description builder
129 */
130 Builder ifaceName(String name);
131
132 /**
133 * Returns tunnel interface description builder with a given tunnel type.
134 *
135 * @param type tunnel type
136 * @return tunnel description builder
137 */
138 Builder type(Type type);
139
140 /**
141 * Returns tunnel interface description builder with a given local
142 * tunnel endpoint.
143 *
144 * @param endpoint tunnel endpoint
145 * @return tunnel description builder
146 */
147 Builder local(TunnelEndPoint endpoint);
148
149 /**
150 * Returns tunnel interface description builder with a given remote
151 * tunnel endpoint.
152 *
153 * @param endpoint tunnel endpoint
154 * @return tunnel description builder
155 */
156 Builder remote(TunnelEndPoint endpoint);
157
158 /**
159 * Returns tunnel interface description builder with a tunnel key.
160 *
Ray Milkeybb23e0b2016-08-02 17:00:21 -0700161 * @param tunnelKey tunnel key
Hyunsun Moondd14e8e2016-06-09 16:17:32 -0700162 * @return tunnel description builder
163 */
164 Builder key(TunnelKey tunnelKey);
165
166 /**
167 * Returns tunnel interface descriptions builder with other configurations.
168 *
169 * @param configs configurations
170 * @return tunnel description builder
171 */
172 Builder otherConfigs(SparseAnnotations configs);
173 }
samuel8d6b0a92015-07-11 13:22:57 +0800174}