|
|
| 26 |
#include "ns3/object-factory.h" |
26 |
#include "ns3/object-factory.h" |
| 27 |
#include "ns3/net-device-container.h" |
27 |
#include "ns3/net-device-container.h" |
| 28 |
#include "ns3/queue-disc-container.h" |
28 |
#include "ns3/queue-disc-container.h" |
|
|
29 |
#include "ns3/queue.h" |
| 29 |
|
30 |
|
| 30 |
namespace ns3 { |
31 |
namespace ns3 { |
| 31 |
|
32 |
|
|
|
| 139 |
* attributes, use the AddInternalQueue, AddPacketFilter and AddChildQueueDisc methods. |
140 |
* attributes, use the AddInternalQueue, AddPacketFilter and AddChildQueueDisc methods. |
| 140 |
* |
141 |
* |
| 141 |
* \param type the type of queue disc |
142 |
* \param type the type of queue disc |
| 142 |
* \param n01 the name of the attribute to set on the queue disc |
|
|
| 143 |
* \param v01 the value of the attribute to set on the queue disc |
| 144 |
* \param n02 the name of the attribute to set on the queue disc |
| 145 |
* \param v02 the value of the attribute to set on the queue disc |
| 146 |
* \param n03 the name of the attribute to set on the queue disc |
| 147 |
* \param v03 the value of the attribute to set on the queue disc |
| 148 |
* \param n04 the name of the attribute to set on the queue disc |
| 149 |
* \param v04 the value of the attribute to set on the queue disc |
| 150 |
* \param n05 the name of the attribute to set on the queue disc |
| 151 |
* \param v05 the value of the attribute to set on the queue disc |
| 152 |
* \param n06 the name of the attribute to set on the queue disc |
| 153 |
* \param v06 the value of the attribute to set on the queue disc |
| 154 |
* \param n07 the name of the attribute to set on the queue disc |
| 155 |
* \param v07 the value of the attribute to set on the queue disc |
| 156 |
* \param n08 the name of the attribute to set on the queue disc |
| 157 |
* \param v08 the value of the attribute to set on the queue disc |
| 158 |
* \param n09 the name of the attribute to set on the queue disc |
| 159 |
* \param v09 the value of the attribute to set on the queue disc |
| 160 |
* \param n10 the name of the attribute to set on the queue disc |
| 161 |
* \param v10 the value of the attribute to set on the queue disc |
| 162 |
* \param n11 the name of the attribute to set on the queue disc |
| 163 |
* \param v11 the value of the attribute to set on the queue disc |
| 164 |
* \param n12 the name of the attribute to set on the queue disc |
| 165 |
* \param v12 the value of the attribute to set on the queue disc |
| 166 |
* \param n13 the name of the attribute to set on the queue disc |
| 167 |
* \param v13 the value of the attribute to set on the queue disc |
| 168 |
* \param n14 the name of the attribute to set on the queue disc |
| 169 |
* \param v14 the value of the attribute to set on the queue disc |
| 170 |
* \param n15 the name of the attribute to set on the queue disc |
| 171 |
* \param v15 the value of the attribute to set on the queue disc |
143 |
* \param v15 the value of the attribute to set on the queue disc |
| 172 |
* \return the handle of the root queue disc (zero) |
144 |
* \return the handle of the root queue disc (zero) |
| 173 |
*/ |
145 |
*/ |
| 174 |
uint16_t SetRootQueueDisc (std::string type, |
146 |
template <typename... Args> |
| 175 |
std::string n01 = "", const AttributeValue &v01 = EmptyAttributeValue (), |
147 |
uint16_t SetRootQueueDisc (std::string type, Args... args); |
| 176 |
std::string n02 = "", const AttributeValue &v02 = EmptyAttributeValue (), |
|
|
| 177 |
std::string n03 = "", const AttributeValue &v03 = EmptyAttributeValue (), |
| 178 |
std::string n04 = "", const AttributeValue &v04 = EmptyAttributeValue (), |
| 179 |
std::string n05 = "", const AttributeValue &v05 = EmptyAttributeValue (), |
| 180 |
std::string n06 = "", const AttributeValue &v06 = EmptyAttributeValue (), |
| 181 |
std::string n07 = "", const AttributeValue &v07 = EmptyAttributeValue (), |
| 182 |
std::string n08 = "", const AttributeValue &v08 = EmptyAttributeValue (), |
| 183 |
std::string n09 = "", const AttributeValue &v09 = EmptyAttributeValue (), |
| 184 |
std::string n10 = "", const AttributeValue &v10 = EmptyAttributeValue (), |
| 185 |
std::string n11 = "", const AttributeValue &v11 = EmptyAttributeValue (), |
| 186 |
std::string n12 = "", const AttributeValue &v12 = EmptyAttributeValue (), |
| 187 |
std::string n13 = "", const AttributeValue &v13 = EmptyAttributeValue (), |
| 188 |
std::string n14 = "", const AttributeValue &v14 = EmptyAttributeValue (), |
| 189 |
std::string n15 = "", const AttributeValue &v15 = EmptyAttributeValue ()); |
| 190 |
|
148 |
|
| 191 |
/** |
149 |
/** |
| 192 |
* Helper function used to add the given number of internal queues (of the given |
150 |
* Helper function used to add the given number of internal queues (of the given |
|
|
| 196 |
* \param count the number of queues to add |
154 |
* \param count the number of queues to add |
| 197 |
* \param type the type of queue |
155 |
* \param type the type of queue |
| 198 |
* \param n01 the name of the attribute to set on the queue |
156 |
* \param n01 the name of the attribute to set on the queue |
| 199 |
* \param v01 the value of the attribute to set on the queue |
|
|
| 200 |
* \param n02 the name of the attribute to set on the queue |
| 201 |
* \param v02 the value of the attribute to set on the queue |
| 202 |
* \param n03 the name of the attribute to set on the queue |
| 203 |
* \param v03 the value of the attribute to set on the queue |
| 204 |
* \param n04 the name of the attribute to set on the queue |
| 205 |
* \param v04 the value of the attribute to set on the queue |
| 206 |
* \param n05 the name of the attribute to set on the queue |
| 207 |
* \param v05 the value of the attribute to set on the queue |
| 208 |
* \param n06 the name of the attribute to set on the queue |
| 209 |
* \param v06 the value of the attribute to set on the queue |
| 210 |
* \param n07 the name of the attribute to set on the queue |
| 211 |
* \param v07 the value of the attribute to set on the queue |
| 212 |
* \param n08 the name of the attribute to set on the queue |
| 213 |
* \param v08 the value of the attribute to set on the queue |
| 214 |
*/ |
157 |
*/ |
| 215 |
void AddInternalQueues (uint16_t handle, uint16_t count, std::string type, |
158 |
template <typename... Args> |
| 216 |
std::string n01 = "", const AttributeValue &v01 = EmptyAttributeValue (), |
159 |
void AddInternalQueues (uint16_t handle, uint16_t count, std::string type, Args... args); |
| 217 |
std::string n02 = "", const AttributeValue &v02 = EmptyAttributeValue (), |
|
|
| 218 |
std::string n03 = "", const AttributeValue &v03 = EmptyAttributeValue (), |
| 219 |
std::string n04 = "", const AttributeValue &v04 = EmptyAttributeValue (), |
| 220 |
std::string n05 = "", const AttributeValue &v05 = EmptyAttributeValue (), |
| 221 |
std::string n06 = "", const AttributeValue &v06 = EmptyAttributeValue (), |
| 222 |
std::string n07 = "", const AttributeValue &v07 = EmptyAttributeValue (), |
| 223 |
std::string n08 = "", const AttributeValue &v08 = EmptyAttributeValue ()); |
| 224 |
|
160 |
|
| 225 |
/** |
161 |
/** |
| 226 |
* Helper function used to add a packet filter (of the given type and with |
162 |
* Helper function used to add a packet filter (of the given type and with |
|
|
| 229 |
* \param handle the handle of the parent queue disc |
165 |
* \param handle the handle of the parent queue disc |
| 230 |
* \param type the type of packet filter |
166 |
* \param type the type of packet filter |
| 231 |
* \param n01 the name of the attribute to set on the packet filter |
167 |
* \param n01 the name of the attribute to set on the packet filter |
| 232 |
* \param v01 the value of the attribute to set on the packet filter |
|
|
| 233 |
* \param n02 the name of the attribute to set on the packet filter |
| 234 |
* \param v02 the value of the attribute to set on the packet filter |
| 235 |
* \param n03 the name of the attribute to set on the packet filter |
| 236 |
* \param v03 the value of the attribute to set on the packet filter |
| 237 |
* \param n04 the name of the attribute to set on the packet filter |
| 238 |
* \param v04 the value of the attribute to set on the packet filter |
| 239 |
* \param n05 the name of the attribute to set on the packet filter |
| 240 |
* \param v05 the value of the attribute to set on the packet filter |
| 241 |
* \param n06 the name of the attribute to set on the packet filter |
| 242 |
* \param v06 the value of the attribute to set on the packet filter |
| 243 |
* \param n07 the name of the attribute to set on the packet filter |
| 244 |
* \param v07 the value of the attribute to set on the packet filter |
| 245 |
* \param n08 the name of the attribute to set on the packet filter |
| 246 |
* \param v08 the value of the attribute to set on the packet filter |
| 247 |
*/ |
168 |
*/ |
| 248 |
void AddPacketFilter (uint16_t handle, std::string type, |
169 |
template <typename... Args> |
| 249 |
std::string n01 = "", const AttributeValue &v01 = EmptyAttributeValue (), |
170 |
void AddPacketFilter (uint16_t handle, std::string type, Args... args); |
| 250 |
std::string n02 = "", const AttributeValue &v02 = EmptyAttributeValue (), |
|
|
| 251 |
std::string n03 = "", const AttributeValue &v03 = EmptyAttributeValue (), |
| 252 |
std::string n04 = "", const AttributeValue &v04 = EmptyAttributeValue (), |
| 253 |
std::string n05 = "", const AttributeValue &v05 = EmptyAttributeValue (), |
| 254 |
std::string n06 = "", const AttributeValue &v06 = EmptyAttributeValue (), |
| 255 |
std::string n07 = "", const AttributeValue &v07 = EmptyAttributeValue (), |
| 256 |
std::string n08 = "", const AttributeValue &v08 = EmptyAttributeValue ()); |
| 257 |
|
171 |
|
| 258 |
/** |
172 |
/** |
| 259 |
* Container type for Class IDs |
173 |
* Container type for Class IDs |
|
|
| 268 |
* \param count the number of queue disc classes to add |
182 |
* \param count the number of queue disc classes to add |
| 269 |
* \param type the type of queue disc class |
183 |
* \param type the type of queue disc class |
| 270 |
* \param n01 the name of the attribute to set on the queue disc class |
184 |
* \param n01 the name of the attribute to set on the queue disc class |
| 271 |
* \param v01 the value of the attribute to set on the queue disc class |
|
|
| 272 |
* \param n02 the name of the attribute to set on the queue disc class |
| 273 |
* \param v02 the value of the attribute to set on the queue disc class |
| 274 |
* \param n03 the name of the attribute to set on the queue disc class |
| 275 |
* \param v03 the value of the attribute to set on the queue disc class |
| 276 |
* \param n04 the name of the attribute to set on the queue disc class |
| 277 |
* \param v04 the value of the attribute to set on the queue disc class |
| 278 |
* \param n05 the name of the attribute to set on the queue disc class |
| 279 |
* \param v05 the value of the attribute to set on the queue disc class |
| 280 |
* \param n06 the name of the attribute to set on the queue disc class |
| 281 |
* \param v06 the value of the attribute to set on the queue disc class |
| 282 |
* \param n07 the name of the attribute to set on the queue disc class |
| 283 |
* \param v07 the value of the attribute to set on the queue disc class |
| 284 |
* \param n08 the name of the attribute to set on the queue disc class |
| 285 |
* \param v08 the value of the attribute to set on the queue disc class |
| 286 |
* \return the list of class IDs |
185 |
* \return the list of class IDs |
| 287 |
*/ |
186 |
*/ |
| 288 |
ClassIdList AddQueueDiscClasses (uint16_t handle, uint16_t count, std::string type, |
187 |
template <typename... Args> |
| 289 |
std::string n01 = "", const AttributeValue &v01 = EmptyAttributeValue (), |
188 |
ClassIdList AddQueueDiscClasses (uint16_t handle, uint16_t count, std::string type, Args... args); |
| 290 |
std::string n02 = "", const AttributeValue &v02 = EmptyAttributeValue (), |
|
|
| 291 |
std::string n03 = "", const AttributeValue &v03 = EmptyAttributeValue (), |
| 292 |
std::string n04 = "", const AttributeValue &v04 = EmptyAttributeValue (), |
| 293 |
std::string n05 = "", const AttributeValue &v05 = EmptyAttributeValue (), |
| 294 |
std::string n06 = "", const AttributeValue &v06 = EmptyAttributeValue (), |
| 295 |
std::string n07 = "", const AttributeValue &v07 = EmptyAttributeValue (), |
| 296 |
std::string n08 = "", const AttributeValue &v08 = EmptyAttributeValue ()); |
| 297 |
|
189 |
|
| 298 |
/** |
190 |
/** |
| 299 |
* Helper function used to attach a child queue disc (of the given type and with |
191 |
* Helper function used to attach a child queue disc (of the given type and with |
|
|
| 304 |
* \param classId the class ID of the class to attach the queue disc to |
196 |
* \param classId the class ID of the class to attach the queue disc to |
| 305 |
* \param type the type of queue disc |
197 |
* \param type the type of queue disc |
| 306 |
* \param n01 the name of the attribute to set on the queue disc |
198 |
* \param n01 the name of the attribute to set on the queue disc |
| 307 |
* \param v01 the value of the attribute to set on the queue disc |
|
|
| 308 |
* \param n02 the name of the attribute to set on the queue disc |
| 309 |
* \param v02 the value of the attribute to set on the queue disc |
| 310 |
* \param n03 the name of the attribute to set on the queue disc |
| 311 |
* \param v03 the value of the attribute to set on the queue disc |
| 312 |
* \param n04 the name of the attribute to set on the queue disc |
| 313 |
* \param v04 the value of the attribute to set on the queue disc |
| 314 |
* \param n05 the name of the attribute to set on the queue disc |
| 315 |
* \param v05 the value of the attribute to set on the queue disc |
| 316 |
* \param n06 the name of the attribute to set on the queue disc |
| 317 |
* \param v06 the value of the attribute to set on the queue disc |
| 318 |
* \param n07 the name of the attribute to set on the queue disc |
| 319 |
* \param v07 the value of the attribute to set on the queue disc |
| 320 |
* \param n08 the name of the attribute to set on the queue disc |
| 321 |
* \param v08 the value of the attribute to set on the queue disc |
| 322 |
* \param n09 the name of the attribute to set on the queue disc |
| 323 |
* \param v09 the value of the attribute to set on the queue disc |
| 324 |
* \param n10 the name of the attribute to set on the queue disc |
| 325 |
* \param v10 the value of the attribute to set on the queue disc |
| 326 |
* \param n11 the name of the attribute to set on the queue disc |
| 327 |
* \param v11 the value of the attribute to set on the queue disc |
| 328 |
* \param n12 the name of the attribute to set on the queue disc |
| 329 |
* \param v12 the value of the attribute to set on the queue disc |
| 330 |
* \param n13 the name of the attribute to set on the queue disc |
| 331 |
* \param v13 the value of the attribute to set on the queue disc |
| 332 |
* \param n14 the name of the attribute to set on the queue disc |
| 333 |
* \param v14 the value of the attribute to set on the queue disc |
| 334 |
* \param n15 the name of the attribute to set on the queue disc |
| 335 |
* \param v15 the value of the attribute to set on the queue disc |
| 336 |
* \return the handle of the created child queue disc |
199 |
* \return the handle of the created child queue disc |
| 337 |
*/ |
200 |
*/ |
| 338 |
uint16_t AddChildQueueDisc (uint16_t handle, uint16_t classId, std::string type, |
201 |
template <typename... Args> |
| 339 |
std::string n01 = "", const AttributeValue &v01 = EmptyAttributeValue (), |
202 |
uint16_t AddChildQueueDisc (uint16_t handle, uint16_t classId, std::string type, Args... args); |
| 340 |
std::string n02 = "", const AttributeValue &v02 = EmptyAttributeValue (), |
|
|
| 341 |
std::string n03 = "", const AttributeValue &v03 = EmptyAttributeValue (), |
| 342 |
std::string n04 = "", const AttributeValue &v04 = EmptyAttributeValue (), |
| 343 |
std::string n05 = "", const AttributeValue &v05 = EmptyAttributeValue (), |
| 344 |
std::string n06 = "", const AttributeValue &v06 = EmptyAttributeValue (), |
| 345 |
std::string n07 = "", const AttributeValue &v07 = EmptyAttributeValue (), |
| 346 |
std::string n08 = "", const AttributeValue &v08 = EmptyAttributeValue (), |
| 347 |
std::string n09 = "", const AttributeValue &v09 = EmptyAttributeValue (), |
| 348 |
std::string n10 = "", const AttributeValue &v10 = EmptyAttributeValue (), |
| 349 |
std::string n11 = "", const AttributeValue &v11 = EmptyAttributeValue (), |
| 350 |
std::string n12 = "", const AttributeValue &v12 = EmptyAttributeValue (), |
| 351 |
std::string n13 = "", const AttributeValue &v13 = EmptyAttributeValue (), |
| 352 |
std::string n14 = "", const AttributeValue &v14 = EmptyAttributeValue (), |
| 353 |
std::string n15 = "", const AttributeValue &v15 = EmptyAttributeValue ()); |
| 354 |
|
203 |
|
| 355 |
/** |
204 |
/** |
| 356 |
* Container type for Handlers |
205 |
* Container type for Handlers |
|
|
| 366 |
* \param classes the class IDs of the classes to attach a queue disc to |
215 |
* \param classes the class IDs of the classes to attach a queue disc to |
| 367 |
* \param type the type of queue disc |
216 |
* \param type the type of queue disc |
| 368 |
* \param n01 the name of the attribute to set on the queue disc |
217 |
* \param n01 the name of the attribute to set on the queue disc |
| 369 |
* \param v01 the value of the attribute to set on the queue disc |
|
|
| 370 |
* \param n02 the name of the attribute to set on the queue disc |
| 371 |
* \param v02 the value of the attribute to set on the queue disc |
| 372 |
* \param n03 the name of the attribute to set on the queue disc |
| 373 |
* \param v03 the value of the attribute to set on the queue disc |
| 374 |
* \param n04 the name of the attribute to set on the queue disc |
| 375 |
* \param v04 the value of the attribute to set on the queue disc |
| 376 |
* \param n05 the name of the attribute to set on the queue disc |
| 377 |
* \param v05 the value of the attribute to set on the queue disc |
| 378 |
* \param n06 the name of the attribute to set on the queue disc |
| 379 |
* \param v06 the value of the attribute to set on the queue disc |
| 380 |
* \param n07 the name of the attribute to set on the queue disc |
| 381 |
* \param v07 the value of the attribute to set on the queue disc |
| 382 |
* \param n08 the name of the attribute to set on the queue disc |
| 383 |
* \param v08 the value of the attribute to set on the queue disc |
| 384 |
* \param n09 the name of the attribute to set on the queue disc |
| 385 |
* \param v09 the value of the attribute to set on the queue disc |
| 386 |
* \param n10 the name of the attribute to set on the queue disc |
| 387 |
* \param v10 the value of the attribute to set on the queue disc |
| 388 |
* \param n11 the name of the attribute to set on the queue disc |
| 389 |
* \param v11 the value of the attribute to set on the queue disc |
| 390 |
* \param n12 the name of the attribute to set on the queue disc |
| 391 |
* \param v12 the value of the attribute to set on the queue disc |
| 392 |
* \param n13 the name of the attribute to set on the queue disc |
| 393 |
* \param v13 the value of the attribute to set on the queue disc |
| 394 |
* \param n14 the name of the attribute to set on the queue disc |
| 395 |
* \param v14 the value of the attribute to set on the queue disc |
| 396 |
* \param n15 the name of the attribute to set on the queue disc |
| 397 |
* \param v15 the value of the attribute to set on the queue disc |
| 398 |
* \return the list of handles of the created child queue discs |
218 |
* \return the list of handles of the created child queue discs |
| 399 |
*/ |
219 |
*/ |
| 400 |
HandleList AddChildQueueDiscs (uint16_t handle, const ClassIdList &classes, std::string type, |
220 |
template <typename... Args> |
| 401 |
std::string n01 = "", const AttributeValue &v01 = EmptyAttributeValue (), |
221 |
HandleList AddChildQueueDiscs (uint16_t handle, const ClassIdList &classes, std::string type, Args... args); |
| 402 |
std::string n02 = "", const AttributeValue &v02 = EmptyAttributeValue (), |
|
|
| 403 |
std::string n03 = "", const AttributeValue &v03 = EmptyAttributeValue (), |
| 404 |
std::string n04 = "", const AttributeValue &v04 = EmptyAttributeValue (), |
| 405 |
std::string n05 = "", const AttributeValue &v05 = EmptyAttributeValue (), |
| 406 |
std::string n06 = "", const AttributeValue &v06 = EmptyAttributeValue (), |
| 407 |
std::string n07 = "", const AttributeValue &v07 = EmptyAttributeValue (), |
| 408 |
std::string n08 = "", const AttributeValue &v08 = EmptyAttributeValue (), |
| 409 |
std::string n09 = "", const AttributeValue &v09 = EmptyAttributeValue (), |
| 410 |
std::string n10 = "", const AttributeValue &v10 = EmptyAttributeValue (), |
| 411 |
std::string n11 = "", const AttributeValue &v11 = EmptyAttributeValue (), |
| 412 |
std::string n12 = "", const AttributeValue &v12 = EmptyAttributeValue (), |
| 413 |
std::string n13 = "", const AttributeValue &v13 = EmptyAttributeValue (), |
| 414 |
std::string n14 = "", const AttributeValue &v14 = EmptyAttributeValue (), |
| 415 |
std::string n15 = "", const AttributeValue &v15 = EmptyAttributeValue ()); |
| 416 |
|
222 |
|
| 417 |
/** |
223 |
/** |
| 418 |
* Helper function used to add a queue limits object to the transmission |
224 |
* Helper function used to add a queue limits object to the transmission |
|
|
| 420 |
* |
226 |
* |
| 421 |
* \param type the type of queue |
227 |
* \param type the type of queue |
| 422 |
* \param n01 the name of the attribute to set on the queue limits object |
228 |
* \param n01 the name of the attribute to set on the queue limits object |
| 423 |
* \param v01 the value of the attribute to set on the queue limits object |
|
|
| 424 |
* \param n02 the name of the attribute to set on the queue limits object |
| 425 |
* \param v02 the value of the attribute to set on the queue limits object |
| 426 |
* \param n03 the name of the attribute to set on the queue limits object |
| 427 |
* \param v03 the value of the attribute to set on the queue limits object |
| 428 |
* \param n04 the name of the attribute to set on the queue limits object |
| 429 |
* \param v04 the value of the attribute to set on the queue limits object |
| 430 |
* \param n05 the name of the attribute to set on the queue limits object |
| 431 |
* \param v05 the value of the attribute to set on the queue limits object |
| 432 |
* \param n06 the name of the attribute to set on the queue limits object |
| 433 |
* \param v06 the value of the attribute to set on the queue limits object |
| 434 |
* \param n07 the name of the attribute to set on the queue limits object |
| 435 |
* \param v07 the value of the attribute to set on the queue limits object |
| 436 |
* \param n08 the name of the attribute to set on the queue limits object |
| 437 |
* \param v08 the value of the attribute to set on the queue limits object |
| 438 |
*/ |
229 |
*/ |
| 439 |
void SetQueueLimits (std::string type, |
230 |
template <typename... Args> |
| 440 |
std::string n01 = "", const AttributeValue &v01 = EmptyAttributeValue (), |
231 |
void SetQueueLimits (std::string type, Args... args); |
| 441 |
std::string n02 = "", const AttributeValue &v02 = EmptyAttributeValue (), |
|
|
| 442 |
std::string n03 = "", const AttributeValue &v03 = EmptyAttributeValue (), |
| 443 |
std::string n04 = "", const AttributeValue &v04 = EmptyAttributeValue (), |
| 444 |
std::string n05 = "", const AttributeValue &v05 = EmptyAttributeValue (), |
| 445 |
std::string n06 = "", const AttributeValue &v06 = EmptyAttributeValue (), |
| 446 |
std::string n07 = "", const AttributeValue &v07 = EmptyAttributeValue (), |
| 447 |
std::string n08 = "", const AttributeValue &v08 = EmptyAttributeValue ()); |
| 448 |
|
232 |
|
| 449 |
/** |
233 |
/** |
| 450 |
* \param c set of devices |
234 |
* \param c set of devices |
|
|
| 499 |
ObjectFactory m_queueLimitsFactory; |
283 |
ObjectFactory m_queueLimitsFactory; |
| 500 |
}; |
284 |
}; |
| 501 |
|
285 |
|
|
|
286 |
} // namespace ns3 |
| 287 |
|
| 288 |
|
| 289 |
/*************************************************************** |
| 290 |
* Implementation of the templates declared above. |
| 291 |
***************************************************************/ |
| 292 |
|
| 293 |
namespace ns3 { |
| 294 |
|
| 295 |
template <typename... Args> |
| 296 |
uint16_t |
| 297 |
TrafficControlHelper::SetRootQueueDisc (std::string type, Args... args) |
| 298 |
{ |
| 299 |
NS_ABORT_MSG_UNLESS (m_queueDiscFactory.empty (), "A root queue disc has been already added to this factory"); |
| 300 |
|
| 301 |
ObjectFactory factory; |
| 302 |
factory.SetTypeId (type); |
| 303 |
factory.Set (args...); |
| 304 |
|
| 305 |
m_queueDiscFactory.push_back (QueueDiscFactory (factory)); |
| 306 |
return 0; |
| 307 |
} |
| 308 |
|
| 309 |
template <typename... Args> |
| 310 |
void |
| 311 |
TrafficControlHelper::AddInternalQueues (uint16_t handle, uint16_t count, std::string type, Args... args) |
| 312 |
{ |
| 313 |
NS_ABORT_MSG_IF (handle >= m_queueDiscFactory.size (), "A queue disc with handle " |
| 314 |
<< handle << " does not exist"); |
| 315 |
|
| 316 |
QueueBase::AppendItemTypeIfNotPresent (type, "QueueDiscItem"); |
| 317 |
|
| 318 |
ObjectFactory factory; |
| 319 |
factory.SetTypeId (type); |
| 320 |
factory.Set (args...); |
| 321 |
|
| 322 |
for (int i = 0; i < count; i++) |
| 323 |
{ |
| 324 |
m_queueDiscFactory[handle].AddInternalQueue (factory); |
| 325 |
} |
| 326 |
} |
| 327 |
|
| 328 |
template <typename... Args> |
| 329 |
void |
| 330 |
TrafficControlHelper::AddPacketFilter (uint16_t handle, std::string type, Args... args) |
| 331 |
{ |
| 332 |
NS_ABORT_MSG_IF (handle >= m_queueDiscFactory.size (), "A queue disc with handle " |
| 333 |
<< handle << " does not exist"); |
| 334 |
|
| 335 |
ObjectFactory factory; |
| 336 |
factory.SetTypeId (type); |
| 337 |
factory.Set (args...); |
| 338 |
|
| 339 |
m_queueDiscFactory[handle].AddPacketFilter (factory); |
| 340 |
} |
| 341 |
|
| 342 |
template <typename... Args> |
| 343 |
TrafficControlHelper::ClassIdList |
| 344 |
TrafficControlHelper::AddQueueDiscClasses (uint16_t handle, uint16_t count, std::string type, Args... args) |
| 345 |
{ |
| 346 |
NS_ABORT_MSG_IF (handle >= m_queueDiscFactory.size (), "A queue disc with handle " |
| 347 |
<< handle << " does not exist"); |
| 348 |
|
| 349 |
ObjectFactory factory; |
| 350 |
factory.SetTypeId (type); |
| 351 |
factory.Set (args...); |
| 352 |
|
| 353 |
ClassIdList list; |
| 354 |
uint16_t classId; |
| 355 |
|
| 356 |
for (int i = 0; i < count; i++) |
| 357 |
{ |
| 358 |
classId = m_queueDiscFactory[handle].AddQueueDiscClass (factory); |
| 359 |
list.push_back (classId); |
| 360 |
} |
| 361 |
return list; |
| 362 |
} |
| 363 |
|
| 364 |
template <typename... Args> |
| 365 |
uint16_t |
| 366 |
TrafficControlHelper::AddChildQueueDisc (uint16_t handle, uint16_t classId, std::string type, Args... args) |
| 367 |
{ |
| 368 |
NS_ABORT_MSG_IF (handle >= m_queueDiscFactory.size (), "A queue disc with handle " |
| 369 |
<< handle << " does not exist"); |
| 370 |
|
| 371 |
ObjectFactory factory; |
| 372 |
factory.SetTypeId (type); |
| 373 |
factory.Set (args...); |
| 374 |
|
| 375 |
uint16_t childHandle = m_queueDiscFactory.size (); |
| 376 |
m_queueDiscFactory.push_back (QueueDiscFactory (factory)); |
| 377 |
m_queueDiscFactory[handle].SetChildQueueDisc (classId, childHandle); |
| 378 |
|
| 379 |
return childHandle; |
| 380 |
} |
| 381 |
|
| 382 |
template <typename... Args> |
| 383 |
TrafficControlHelper::HandleList |
| 384 |
TrafficControlHelper::AddChildQueueDiscs (uint16_t handle, const TrafficControlHelper::ClassIdList &classes, |
| 385 |
std::string type, Args... args) |
| 386 |
{ |
| 387 |
HandleList list; |
| 388 |
for (ClassIdList::const_iterator c = classes.begin (); c != classes.end (); c++) |
| 389 |
{ |
| 390 |
uint16_t childHandle = AddChildQueueDisc (handle, *c, type, args...); |
| 391 |
list.push_back (childHandle); |
| 392 |
} |
| 393 |
return list; |
| 394 |
} |
| 395 |
|
| 396 |
template <typename... Args> |
| 397 |
void |
| 398 |
TrafficControlHelper::SetQueueLimits (std::string type, Args... args) |
| 399 |
{ |
| 400 |
m_queueLimitsFactory.SetTypeId (type); |
| 401 |
m_queueLimitsFactory.Set (args...); |
| 402 |
} |
| 403 |
|
| 404 |
|
| 502 |
} // namespace ns3 |
405 |
} // namespace ns3 |
| 503 |
|
406 |
|
| 504 |
#endif /* TRAFFIC_CONTROL_HELPER_H */ |
407 |
#endif /* TRAFFIC_CONTROL_HELPER_H */ |