blob: 2aa90b5d517aea41be8a4c556a2ee33b81700f9e [file] [log] [blame]
Dhruv Dhody4d8943a2016-02-17 16:36:08 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Dhruv Dhody4d8943a2016-02-17 16:36:08 +05303 *
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.ospf.controller.impl;
17
18import org.onlab.packet.Ip4Address;
19import org.onlab.packet.Ip6Address;
20import org.onlab.util.Bandwidth;
21import org.onosproject.ospf.controller.OspfLinkTed;
22
23import java.util.ArrayList;
24import java.util.List;
25
26/**
27 * Implements OSPF Link Traffic engineering details.
28 */
29public class OspfLinkTedImpl implements OspfLinkTed {
30
31
32 Bandwidth maximumLink;
33 List<Bandwidth> maxUnResBandwidth = new ArrayList<>();
34 Bandwidth maxReserved;
35 Integer teMetric;
36 List<Ip4Address> ipv4LocRouterId = new ArrayList<>();
37 List<Ip6Address> ipv6LocRouterId = new ArrayList<>();
38 List<Ip4Address> ipv4RemRouterId = new ArrayList<>();
39 List<Ip6Address> ipv6RemRouterId = new ArrayList<>();
40
41
42 /**
43 * Gets maximum link.
44 *
45 * @return maximum link
46 */
47 public Bandwidth maximumLink() {
48 return maximumLink;
49 }
50
51 /**
52 * Sets maximum link.
53 *
54 * @param maximumLink maximum link
55 */
56 public void setMaximumLink(Bandwidth maximumLink) {
57 this.maximumLink = maximumLink;
58 }
59
60 /**
61 * Gets list of IPv6 remote router id.
62 *
63 * @return list of IPv6 remote router id
64 */
65 public List<Ip6Address> ipv6RemRouterId() {
66 return ipv6RemRouterId;
67 }
68
69
70 /**
71 * Sets list of IPv6 remote router id.
72 *
73 * @param ipv6RemRouterId IPv6 remote router id
74 */
75 public void setIpv6RemRouterId(List<Ip6Address> ipv6RemRouterId) {
76 this.ipv6RemRouterId = ipv6RemRouterId;
77 }
78
79 /**
80 * Gets list of IPv4 remote router id.
81 *
82 * @return list of IPv4 remote router id
83 */
84 public List<Ip4Address> ipv4RemRouterId() {
85 return ipv4RemRouterId;
86 }
87
88 /**
89 * Sets IPv4 remote router id.
90 *
91 * @param ipv4RemRouterId IPv4 remote router id
92 */
93 public void setIpv4RemRouterId(List<Ip4Address> ipv4RemRouterId) {
94 this.ipv4RemRouterId = ipv4RemRouterId;
95 }
96
97 /**
98 * Gets list of IPv6 local router id.
99 *
100 * @return list of IPv6 local router id
101 */
102 public List<Ip6Address> ipv6LocRouterId() {
103 return ipv6LocRouterId;
104 }
105
106 /**
107 * Sets list of IPv6 local router id.
108 *
109 * @param ipv6LocRouterId IPv6 local router id
110 */
111 public void setIpv6LocRouterId(List<Ip6Address> ipv6LocRouterId) {
112 this.ipv6LocRouterId = ipv6LocRouterId;
113 }
114
115 /**
116 * Gets list of IPv4 local router id.
117 *
118 * @return list of IPv4 local router id
119 */
120 public List<Ip4Address> ipv4LocRouterId() {
121 return ipv4LocRouterId;
122 }
123
124 /**
125 * Sets list of IPv4 local router id.
126 *
127 * @param ipv4LocRouterId IPv4 local router id
128 */
129 public void setIpv4LocRouterId(List<Ip4Address> ipv4LocRouterId) {
130 this.ipv4LocRouterId = ipv4LocRouterId;
131 }
132
133 /**
134 * Gets traffic engineering metric.
135 *
136 * @return traffic engineering metric
137 */
138 public Integer teMetric() {
139 return teMetric;
140 }
141
142 /**
143 * Sets traffic engineering metric.
144 *
145 * @param teMetric Traffic engineering metric
146 */
147 public void setTeMetric(Integer teMetric) {
148 this.teMetric = teMetric;
149 }
150
151 /**
152 * Gets maximum bandwidth reserved.
153 *
154 * @return maximum bandwidth reserved
155 */
156 public Bandwidth maxReserved() {
157 return maxReserved;
158 }
159
160 /**
161 * Sets maximum bandwidth reserved.
162 *
163 * @param maxReserved maximum bandwidth reserved
164 */
165 public void setMaxReserved(Bandwidth maxReserved) {
166 this.maxReserved = maxReserved;
167 }
168
169 /**
170 * Gets list of maximum unreserved bandwidth.
171 *
172 * @return list of maximum unreserved bandwidth
173 */
174 public List<Bandwidth> maxUnResBandwidth() {
175 return maxUnResBandwidth;
176 }
177
178 /**
179 * Sets ist of maximum unreserved bandwidth.
180 *
181 * @param bandwidth maximum unreserved bandwidth
182 */
183 public void setMaxUnResBandwidth(Bandwidth bandwidth) {
184 this.maxUnResBandwidth.add(bandwidth);
185 }
186}