tony-liu | aff59a7 | 2016-10-21 15:41:46 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-present 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 | |
| 17 | package org.onosproject.tetunnel.api.tunnel; |
| 18 | |
| 19 | import org.onosproject.tetopology.management.api.node.TeNodeKey; |
| 20 | import org.onosproject.tetopology.management.api.node.TtpKey; |
| 21 | import org.onosproject.tetunnel.api.tunnel.path.TePath; |
| 22 | |
| 23 | import java.util.List; |
| 24 | |
| 25 | /** |
| 26 | * Representation of a TE tunnel attributes. |
| 27 | */ |
| 28 | public 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 | */ |
| 185 | TeTunnelKey e2eTunnel(); |
| 186 | |
| 187 | /** |
| 188 | * Sets the E2E tunnel of this (segment) tunnel. |
| 189 | * |
| 190 | * @param e2eTunnel key of the corresponding E2E tunnel |
| 191 | */ |
| 192 | void e2eTunnel(TeTunnelKey e2eTunnel); |
| 193 | |
| 194 | //TODO: add more required TE attributes |
| 195 | } |