LEFT | RIGHT |
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) 2008 INRIA | 3 * Copyright (c) 2008 INRIA |
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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 | 423 |
424 void | 424 void |
425 RegularWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr, const Rad
iotapHeader *radiotaphdr) | 425 RegularWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr, const Rad
iotapHeader *radiotaphdr) |
426 { | 426 { |
427 NS_LOG_FUNCTION (this << packet << hdr); | 427 NS_LOG_FUNCTION (this << packet << hdr); |
428 | 428 |
429 Mac48Address to = hdr->GetAddr1 (); | 429 Mac48Address to = hdr->GetAddr1 (); |
430 Mac48Address from = hdr->GetAddr2 (); | 430 Mac48Address from = hdr->GetAddr2 (); |
431 | 431 |
432 // We don't know how to deal with any frame that is not addressed to | 432 // We don't know how to deal with any frame that is not addressed to |
433 // us (and odds are there is nothing sensible we could do anyway),» | 433 // us (and odds are there is nothing sensible we could do anyway), |
434 // so we ignore such frames.» | 434 // so we ignore such frames. |
435 //» | 435 // |
436 // The derived class may also do some such filtering, but it doesn't» | 436 // The derived class may also do some such filtering, but it doesn't |
437 // hurt to have it here too as a backstop. | 437 // hurt to have it here too as a backstop. |
438 if (to != GetAddress ()) | 438 if (to != GetAddress ()) |
439 { | 439 { |
440 return; | 440 return; |
441 } | 441 } |
442 | 442 |
443 if (hdr->IsMgt () && hdr->IsAction ()) | 443 if (hdr->IsMgt () && hdr->IsAction ()) |
444 { | 444 { |
445 // There is currently only any reason for Management Action | 445 // There is currently only any reason for Management Action |
446 // frames to be flying about if we are a QoS STA. | 446 // frames to be flying about if we are a QoS STA. |
447 NS_ASSERT (m_qosSupported); | 447 NS_ASSERT (m_qosSupported); |
448 | 448 |
449 WifiActionHeader actionHdr; | 449 WifiActionHeader actionHdr; |
450 packet->RemoveHeader (actionHdr); | 450 packet->RemoveHeader (actionHdr); |
451 | 451 |
452 switch (actionHdr.GetCategory ()) | 452 switch (actionHdr.GetCategory ()) |
453 { | 453 { |
454 case WifiActionHeader::BLOCK_ACK: | 454 case WifiActionHeader::BLOCK_ACK: |
455 | 455 |
456 switch (actionHdr.GetAction().blockAck) | 456 switch (actionHdr.GetAction ().blockAck) |
457 { | 457 { |
458 case WifiActionHeader::BLOCK_ACK_ADDBA_REQUEST: | 458 case WifiActionHeader::BLOCK_ACK_ADDBA_REQUEST: |
459 { | 459 { |
460 MgtAddBaRequestHeader reqHdr; | 460 MgtAddBaRequestHeader reqHdr; |
461 packet->RemoveHeader (reqHdr); | 461 packet->RemoveHeader (reqHdr); |
462 | 462 |
463 // We've received an ADDBA Request. Our policy here is | 463 // We've received an ADDBA Request. Our policy here is |
464 // to automatically accept it, so we get the ADDBA | 464 // to automatically accept it, so we get the ADDBA |
465 // Response on it's way immediately. | 465 // Response on it's way immediately. |
466 SendAddBaResponse (&reqHdr, from); | 466 SendAddBaResponse (&reqHdr, from); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 MakeBooleanAccessor (&RegularWifiMac::SetQosSupported, | 606 MakeBooleanAccessor (&RegularWifiMac::SetQosSupported, |
607 &RegularWifiMac::GetQosSupported), | 607 &RegularWifiMac::GetQosSupported), |
608 MakeBooleanChecker ()) | 608 MakeBooleanChecker ()) |
609 .AddAttribute ("DcaTxop", "The DcaTxop object", | 609 .AddAttribute ("DcaTxop", "The DcaTxop object", |
610 PointerValue (), | 610 PointerValue (), |
611 MakePointerAccessor (&RegularWifiMac::GetDcaTxop), | 611 MakePointerAccessor (&RegularWifiMac::GetDcaTxop), |
612 MakePointerChecker<DcaTxop> ()) | 612 MakePointerChecker<DcaTxop> ()) |
613 .AddAttribute ("VO_EdcaTxopN", | 613 .AddAttribute ("VO_EdcaTxopN", |
614 "Queue that manages packets belonging to AC_VO access class", | 614 "Queue that manages packets belonging to AC_VO access class", |
615 PointerValue (), | 615 PointerValue (), |
616 MakePointerAccessor(&RegularWifiMac::GetVOQueue), | 616 MakePointerAccessor (&RegularWifiMac::GetVOQueue), |
617 MakePointerChecker<EdcaTxopN> ()) | 617 MakePointerChecker<EdcaTxopN> ()) |
618 .AddAttribute ("VI_EdcaTxopN", | 618 .AddAttribute ("VI_EdcaTxopN", |
619 "Queue that manages packets belonging to AC_VI access class", | 619 "Queue that manages packets belonging to AC_VI access class", |
620 PointerValue (), | 620 PointerValue (), |
621 MakePointerAccessor(&RegularWifiMac::GetVIQueue), | 621 MakePointerAccessor (&RegularWifiMac::GetVIQueue), |
622 MakePointerChecker<EdcaTxopN> ()) | 622 MakePointerChecker<EdcaTxopN> ()) |
623 .AddAttribute ("BE_EdcaTxopN", | 623 .AddAttribute ("BE_EdcaTxopN", |
624 "Queue that manages packets belonging to AC_BE access class", | 624 "Queue that manages packets belonging to AC_BE access class", |
625 PointerValue (), | 625 PointerValue (), |
626 MakePointerAccessor(&RegularWifiMac::GetBEQueue), | 626 MakePointerAccessor (&RegularWifiMac::GetBEQueue), |
627 MakePointerChecker<EdcaTxopN> ()) | 627 MakePointerChecker<EdcaTxopN> ()) |
628 .AddAttribute ("BK_EdcaTxopN", | 628 .AddAttribute ("BK_EdcaTxopN", |
629 "Queue that manages packets belonging to AC_BK access class", | 629 "Queue that manages packets belonging to AC_BK access class", |
630 PointerValue (), | 630 PointerValue (), |
631 MakePointerAccessor(&RegularWifiMac::GetBKQueue), | 631 MakePointerAccessor (&RegularWifiMac::GetBKQueue), |
632 MakePointerChecker<EdcaTxopN> ()) | 632 MakePointerChecker<EdcaTxopN> ()) |
633 .AddTraceSource ( "TxOkHeader", | 633 .AddTraceSource ( "TxOkHeader", |
634 "The header of successfully transmitted packet", | 634 "The header of successfully transmitted packet", |
635 MakeTraceSourceAccessor (&RegularWifiMac::m_txOkCallback)) | 635 MakeTraceSourceAccessor (&RegularWifiMac::m_txOkCallback)) |
636 .AddTraceSource ("TxErrHeader", | 636 .AddTraceSource ("TxErrHeader", |
637 "The header of unsuccessfully transmitted packet", | 637 "The header of unsuccessfully transmitted packet", |
638 MakeTraceSourceAccessor (&RegularWifiMac::m_txErrCallback)) | 638 MakeTraceSourceAccessor (&RegularWifiMac::m_txErrCallback)) |
639 ; | 639 ; |
640 | 640 |
641 return tid; | 641 return tid; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 } | 700 } |
701 | 701 |
702 void | 702 void |
703 RegularWifiMac::TxFailed (const WifiMacHeader &hdr) | 703 RegularWifiMac::TxFailed (const WifiMacHeader &hdr) |
704 { | 704 { |
705 NS_LOG_FUNCTION (this << hdr); | 705 NS_LOG_FUNCTION (this << hdr); |
706 m_txErrCallback (hdr); | 706 m_txErrCallback (hdr); |
707 } | 707 } |
708 | 708 |
709 } // namespace ns3 | 709 } // namespace ns3 |
LEFT | RIGHT |