LEFT | RIGHT |
(no file at all) | |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 Yufei Cheng | 3 * Copyright (c) 2011 Yufei Cheng |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 * \param packet the packet | 216 * \param packet the packet |
217 * \param dsrP the clean packet with payload | 217 * \param dsrP the clean packet with payload |
218 * \param ipv4Address the IPv4 address | 218 * \param ipv4Address the IPv4 address |
219 * \param source IPv4 address of the source | 219 * \param source IPv4 address of the source |
220 * \param ipv4Header the IPv4 header of packet received | 220 * \param ipv4Header the IPv4 header of packet received |
221 * \param protocol the protocol number of the up layer | 221 * \param protocol the protocol number of the up layer |
222 * \param isPromisc if the packet must be dropped | 222 * \param isPromisc if the packet must be dropped |
223 * \param promiscSource IPv4 address | 223 * \param promiscSource IPv4 address |
224 * \return the processed size | 224 * \return the processed size |
225 */ | 225 */ |
226 virtual uint8_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ipv
4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, bo
ol& isPromisc, Ipv4Address promiscSource) = 0; | 226 virtual uint32_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ip
v4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, b
ool& isPromisc, Ipv4Address promiscSource) = 0; |
227 | 227 |
228 protected: | 228 protected: |
229 /** | 229 /** |
230 * \brief Drop trace callback. | 230 * \brief Drop trace callback. |
231 */ | 231 */ |
232 TracedCallback<Ptr<const Packet> > m_dropTrace; | 232 TracedCallback<Ptr<const Packet> > m_dropTrace; |
233 /** | 233 /** |
234 * \brief The broadcast IP address. | 234 * \brief The broadcast IP address. |
235 */ | 235 */ |
236 Ipv4Address Broadcast; | 236 Ipv4Address Broadcast; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 /** | 286 /** |
287 * \brief Get the type ID. | 287 * \brief Get the type ID. |
288 * \return the object TypeId | 288 * \return the object TypeId |
289 */ | 289 */ |
290 static TypeId GetTypeId (); | 290 static TypeId GetTypeId (); |
291 | 291 |
292 DsrOptionPad1 (); | 292 DsrOptionPad1 (); |
293 virtual ~DsrOptionPad1 (); | 293 virtual ~DsrOptionPad1 (); |
294 | 294 |
295 virtual uint8_t GetOptionNumber () const; | 295 virtual uint8_t GetOptionNumber () const; |
296 virtual uint8_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ipv
4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, bo
ol& isPromisc, Ipv4Address promiscSource); | 296 virtual uint32_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ip
v4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, b
ool& isPromisc, Ipv4Address promiscSource); |
297 }; | 297 }; |
298 | 298 |
299 /** | 299 /** |
300 * \class DsrOptionPadn | 300 * \class DsrOptionPadn |
301 * \brief IPv4 Option Padn | 301 * \brief IPv4 Option Padn |
302 */ | 302 */ |
303 class DsrOptionPadn : public DsrOptions | 303 class DsrOptionPadn : public DsrOptions |
304 { | 304 { |
305 public: | 305 public: |
306 /** | 306 /** |
307 * \brief PadN option number. | 307 * \brief PadN option number. |
308 */ | 308 */ |
309 static const uint8_t OPT_NUMBER = 0; | 309 static const uint8_t OPT_NUMBER = 0; |
310 | 310 |
311 /** | 311 /** |
312 * \brief Get the type ID. | 312 * \brief Get the type ID. |
313 * \return the object TypeId | 313 * \return the object TypeId |
314 */ | 314 */ |
315 static TypeId GetTypeId (); | 315 static TypeId GetTypeId (); |
316 | 316 |
317 DsrOptionPadn (); | 317 DsrOptionPadn (); |
318 virtual ~DsrOptionPadn (); | 318 virtual ~DsrOptionPadn (); |
319 | 319 |
320 virtual uint8_t GetOptionNumber () const; | 320 virtual uint8_t GetOptionNumber () const; |
321 virtual uint8_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ipv
4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, bo
ol& isPromisc, Ipv4Address promiscSource); | 321 virtual uint32_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ip
v4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, b
ool& isPromisc, Ipv4Address promiscSource); |
322 }; | 322 }; |
323 | 323 |
324 /** | 324 /** |
325 * \class DsrOptionRreq | 325 * \class DsrOptionRreq |
326 * \brief Dsr Option Rreq | 326 * \brief Dsr Option Rreq |
327 */ | 327 */ |
328 class DsrOptionRreq : public DsrOptions | 328 class DsrOptionRreq : public DsrOptions |
329 { | 329 { |
330 public: | 330 public: |
331 /** | 331 /** |
(...skipping 14 matching lines...) Expand all Loading... |
346 /** | 346 /** |
347 * \brief Constructor. | 347 * \brief Constructor. |
348 */ | 348 */ |
349 DsrOptionRreq (); | 349 DsrOptionRreq (); |
350 /** | 350 /** |
351 * \brief Destructor. | 351 * \brief Destructor. |
352 */ | 352 */ |
353 virtual ~DsrOptionRreq (); | 353 virtual ~DsrOptionRreq (); |
354 | 354 |
355 virtual uint8_t GetOptionNumber () const; | 355 virtual uint8_t GetOptionNumber () const; |
356 virtual uint8_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ipv
4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, bo
ol& isPromisc, Ipv4Address promiscSource); | 356 virtual uint32_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ip
v4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, b
ool& isPromisc, Ipv4Address promiscSource); |
357 | 357 |
358 private: | 358 private: |
359 /** | 359 /** |
360 * \brief The route cache. | 360 * \brief The route cache. |
361 */ | 361 */ |
362 Ptr<dsr::DsrRouteCache> m_routeCache; | 362 Ptr<dsr::DsrRouteCache> m_routeCache; |
363 /** | 363 /** |
364 * \brief The ipv4. | 364 * \brief The ipv4. |
365 */ | 365 */ |
366 Ptr<Ipv4> m_ipv4; | 366 Ptr<Ipv4> m_ipv4; |
(...skipping 19 matching lines...) Expand all Loading... |
386 /** | 386 /** |
387 * \brief Get the instance type ID. | 387 * \brief Get the instance type ID. |
388 * \return instance type ID | 388 * \return instance type ID |
389 */ | 389 */ |
390 virtual TypeId GetInstanceTypeId () const; | 390 virtual TypeId GetInstanceTypeId () const; |
391 | 391 |
392 DsrOptionRrep (); | 392 DsrOptionRrep (); |
393 virtual ~DsrOptionRrep (); | 393 virtual ~DsrOptionRrep (); |
394 | 394 |
395 virtual uint8_t GetOptionNumber () const; | 395 virtual uint8_t GetOptionNumber () const; |
396 virtual uint8_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ipv
4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, bo
ol& isPromisc, Ipv4Address promiscSource); | 396 virtual uint32_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ip
v4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, b
ool& isPromisc, Ipv4Address promiscSource); |
397 | 397 |
398 private: | 398 private: |
399 /** | 399 /** |
400 * \brief The route cache. | 400 * \brief The route cache. |
401 */ | 401 */ |
402 Ptr<dsr::DsrRouteCache> m_routeCache; | 402 Ptr<dsr::DsrRouteCache> m_routeCache; |
403 /** | 403 /** |
404 * \brief The ip layer 3. | 404 * \brief The ip layer 3. |
405 */ | 405 */ |
406 Ptr<Ipv4> m_ipv4; | 406 Ptr<Ipv4> m_ipv4; |
(...skipping 19 matching lines...) Expand all Loading... |
426 /** | 426 /** |
427 * \brief Get the instance type ID. | 427 * \brief Get the instance type ID. |
428 * \return instance type ID | 428 * \return instance type ID |
429 */ | 429 */ |
430 virtual TypeId GetInstanceTypeId () const; | 430 virtual TypeId GetInstanceTypeId () const; |
431 | 431 |
432 DsrOptionSR (); | 432 DsrOptionSR (); |
433 virtual ~DsrOptionSR (); | 433 virtual ~DsrOptionSR (); |
434 | 434 |
435 virtual uint8_t GetOptionNumber () const; | 435 virtual uint8_t GetOptionNumber () const; |
436 virtual uint8_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ipv
4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, bo
ol& isPromisc, Ipv4Address promiscSource); | 436 virtual uint32_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ip
v4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, b
ool& isPromisc, Ipv4Address promiscSource); |
437 | 437 |
438 private: | 438 private: |
439 /** | 439 /** |
440 * \brief The ip layer 3. | 440 * \brief The ip layer 3. |
441 */ | 441 */ |
442 Ptr<Ipv4> m_ipv4; | 442 Ptr<Ipv4> m_ipv4; |
443 }; | 443 }; |
444 | 444 |
445 /** | 445 /** |
446 * \class DsrOptionRerr | 446 * \class DsrOptionRerr |
(...skipping 15 matching lines...) Expand all Loading... |
462 /** | 462 /** |
463 * \brief Get the instance type ID. | 463 * \brief Get the instance type ID. |
464 * \return instance type ID | 464 * \return instance type ID |
465 */ | 465 */ |
466 virtual TypeId GetInstanceTypeId () const; | 466 virtual TypeId GetInstanceTypeId () const; |
467 | 467 |
468 DsrOptionRerr (); | 468 DsrOptionRerr (); |
469 virtual ~DsrOptionRerr (); | 469 virtual ~DsrOptionRerr (); |
470 | 470 |
471 virtual uint8_t GetOptionNumber () const; | 471 virtual uint8_t GetOptionNumber () const; |
472 virtual uint8_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ipv
4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, bo
ol& isPromisc, Ipv4Address promiscSource); | 472 virtual uint32_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ip
v4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, b
ool& isPromisc, Ipv4Address promiscSource); |
473 /** | 473 /** |
474 * \brief Do Send error message | 474 * \brief Do Send error message |
475 * | 475 * |
476 * \param p the packet | 476 * \param p the packet |
477 * \param rerr the DsrOptionRerrUnreachHeader header | 477 * \param rerr the DsrOptionRerrUnreachHeader header |
478 * \param rerrSize the route error header size | 478 * \param rerrSize the route error header size |
479 * \param ipv4Address ipv4 address of our own | 479 * \param ipv4Address ipv4 address of our own |
480 * \param protocol the protocol number of the up layer | 480 * \param protocol the protocol number of the up layer |
481 * \return the processed size | 481 * \return the processed size |
482 */ | 482 */ |
(...skipping 30 matching lines...) Expand all Loading... |
513 /** | 513 /** |
514 * \brief Get the instance type ID. | 514 * \brief Get the instance type ID. |
515 * \return instance type ID | 515 * \return instance type ID |
516 */ | 516 */ |
517 virtual TypeId GetInstanceTypeId () const; | 517 virtual TypeId GetInstanceTypeId () const; |
518 | 518 |
519 DsrOptionAckReq (); | 519 DsrOptionAckReq (); |
520 virtual ~DsrOptionAckReq (); | 520 virtual ~DsrOptionAckReq (); |
521 | 521 |
522 virtual uint8_t GetOptionNumber () const; | 522 virtual uint8_t GetOptionNumber () const; |
523 virtual uint8_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ipv
4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, bo
ol& isPromisc, Ipv4Address promiscSource); | 523 virtual uint32_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ip
v4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, b
ool& isPromisc, Ipv4Address promiscSource); |
524 | 524 |
525 private: | 525 private: |
526 /** | 526 /** |
527 * \brief The route cache. | 527 * \brief The route cache. |
528 */ | 528 */ |
529 Ptr<dsr::DsrRouteCache> m_routeCache; | 529 Ptr<dsr::DsrRouteCache> m_routeCache; |
530 /** | 530 /** |
531 * \brief The ipv4 layer 3. | 531 * \brief The ipv4 layer 3. |
532 */ | 532 */ |
533 Ptr<Ipv4> m_ipv4; | 533 Ptr<Ipv4> m_ipv4; |
(...skipping 19 matching lines...) Expand all Loading... |
553 /** | 553 /** |
554 * \brief Get the instance type ID. | 554 * \brief Get the instance type ID. |
555 * \return instance type ID | 555 * \return instance type ID |
556 */ | 556 */ |
557 virtual TypeId GetInstanceTypeId () const; | 557 virtual TypeId GetInstanceTypeId () const; |
558 | 558 |
559 DsrOptionAck (); | 559 DsrOptionAck (); |
560 virtual ~DsrOptionAck (); | 560 virtual ~DsrOptionAck (); |
561 | 561 |
562 virtual uint8_t GetOptionNumber () const; | 562 virtual uint8_t GetOptionNumber () const; |
563 virtual uint8_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ipv
4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, bo
ol& isPromisc, Ipv4Address promiscSource); | 563 virtual uint32_t Process (Ptr<Packet> packet, Ptr<Packet> dsrP, Ipv4Address ip
v4Address, Ipv4Address source, Ipv4Header const& ipv4Header, uint8_t protocol, b
ool& isPromisc, Ipv4Address promiscSource); |
564 | 564 |
565 private: | 565 private: |
566 /** | 566 /** |
567 * \brief The route cache. | 567 * \brief The route cache. |
568 */ | 568 */ |
569 Ptr<dsr::DsrRouteCache> m_routeCache; | 569 Ptr<dsr::DsrRouteCache> m_routeCache; |
570 /** | 570 /** |
571 * \brief The ipv4 layer 3. | 571 * \brief The ipv4 layer 3. |
572 */ | 572 */ |
573 Ptr<Ipv4> m_ipv4; | 573 Ptr<Ipv4> m_ipv4; |
574 }; | 574 }; |
575 } // namespace dsr | 575 } // namespace dsr |
576 } // Namespace ns3 | 576 } // Namespace ns3 |
577 | 577 |
578 #endif | 578 #endif |
LEFT | RIGHT |