Showing
3 changed files
with
40 additions
and
4 deletions
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | package org.onlab.onos.net; | 16 | package org.onlab.onos.net; |
17 | 17 | ||
18 | /** | 18 | /** |
19 | - * Representation of a network resource. | 19 | + * Representation of a network resource, e.g. a link, lambda, MPLS tag. |
20 | */ | 20 | */ |
21 | public interface NetworkResource { | 21 | public interface NetworkResource { |
22 | } | 22 | } | ... | ... |
1 | +/* | ||
2 | + * Copyright 2014 Open Networking Laboratory | ||
3 | + * | ||
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 | +package org.onlab.onos.net; | ||
17 | + | ||
18 | +/** | ||
19 | + * Abstraction of a generalized network tunnel. | ||
20 | + */ | ||
21 | +public interface Tunnel extends Link { | ||
22 | + | ||
23 | + /** | ||
24 | + * Tunnel technology type. | ||
25 | + */ | ||
26 | + enum Type { | ||
27 | + MPLS, VLAN, VXLAN, GRE, OPTICAL | ||
28 | + } | ||
29 | + | ||
30 | + /** | ||
31 | + * Network resource backing the tunnel, e.g. lambda, VLAN id, MPLS tag. | ||
32 | + * | ||
33 | + * @return backing resource | ||
34 | + */ | ||
35 | + NetworkResource resource(); | ||
36 | + | ||
37 | +} |
... | @@ -15,14 +15,13 @@ | ... | @@ -15,14 +15,13 @@ |
15 | */ | 15 | */ |
16 | package org.onlab.packet; | 16 | package org.onlab.packet; |
17 | 17 | ||
18 | -import java.net.InetAddress; | ||
19 | - | ||
20 | import com.google.common.net.InetAddresses; | 18 | import com.google.common.net.InetAddresses; |
21 | import com.google.common.testing.EqualsTester; | 19 | import com.google.common.testing.EqualsTester; |
22 | import org.junit.Test; | 20 | import org.junit.Test; |
23 | 21 | ||
22 | +import java.net.InetAddress; | ||
23 | + | ||
24 | import static org.hamcrest.Matchers.is; | 24 | import static org.hamcrest.Matchers.is; |
25 | -import static org.hamcrest.Matchers.not; | ||
26 | import static org.junit.Assert.assertThat; | 25 | import static org.junit.Assert.assertThat; |
27 | import static org.junit.Assert.assertTrue; | 26 | import static org.junit.Assert.assertTrue; |
28 | import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable; | 27 | import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable; | ... | ... |
-
Please register or login to post a comment