OLD | NEW |
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,2009 IITP RAS | 3 * Copyright (c) 2008,2009 IITP RAS |
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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 Ptr<PeerLink> peerLink = FindPeerLink (interface, peerAddress); | 358 Ptr<PeerLink> peerLink = FindPeerLink (interface, peerAddress); |
359 if (peerLink != 0) | 359 if (peerLink != 0) |
360 { | 360 { |
361 return (peerLink->LinkIsEstab ()); | 361 return (peerLink->LinkIsEstab ()); |
362 } | 362 } |
363 return false; | 363 return false; |
364 } | 364 } |
365 bool | 365 bool |
366 PeerManagementProtocol::ShouldSendOpen (uint32_t interface, Mac48Address peerAdd
ress) | 366 PeerManagementProtocol::ShouldSendOpen (uint32_t interface, Mac48Address peerAdd
ress) |
367 { | 367 { |
| 368 NS_UNUSED (interface); |
| 369 NS_UNUSED (peerAddress); |
368 return (m_stats.linksTotal < m_maxNumberOfPeerLinks); | 370 return (m_stats.linksTotal < m_maxNumberOfPeerLinks); |
369 } | 371 } |
370 | 372 |
371 bool | 373 bool |
372 PeerManagementProtocol::ShouldAcceptOpen (uint32_t interface, Mac48Address peerA
ddress, | 374 PeerManagementProtocol::ShouldAcceptOpen (uint32_t interface, Mac48Address peerA
ddress, |
373 PmpReasonCode & reasonCode) | 375 PmpReasonCode & reasonCode) |
374 { | 376 { |
| 377 NS_UNUSED (interface); |
| 378 NS_UNUSED (peerAddress); |
375 if (m_stats.linksTotal >= m_maxNumberOfPeerLinks) | 379 if (m_stats.linksTotal >= m_maxNumberOfPeerLinks) |
376 { | 380 { |
377 reasonCode = REASON11S_MESH_MAX_PEERS; | 381 reasonCode = REASON11S_MESH_MAX_PEERS; |
378 return false; | 382 return false; |
379 } | 383 } |
380 return true; | 384 return true; |
381 } | 385 } |
382 | 386 |
383 void | 387 void |
384 PeerManagementProtocol::CheckBeaconCollisions (uint32_t interface) | 388 PeerManagementProtocol::CheckBeaconCollisions (uint32_t interface) |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 } | 517 } |
514 if (nstate == PeerLink::IDLE) | 518 if (nstate == PeerLink::IDLE) |
515 { | 519 { |
516 Ptr<PeerLink> link = FindPeerLink (interface, peerAddress); | 520 Ptr<PeerLink> link = FindPeerLink (interface, peerAddress); |
517 NS_ASSERT (link == 0); | 521 NS_ASSERT (link == 0); |
518 } | 522 } |
519 } | 523 } |
520 uint8_t | 524 uint8_t |
521 PeerManagementProtocol::GetNumberOfLinks () | 525 PeerManagementProtocol::GetNumberOfLinks () |
522 { | 526 { |
523 return m_stats.linksTotal; | 527 return static_cast<uint8_t> (m_stats.linksTotal); |
524 } | 528 } |
525 Ptr<IeMeshId> | 529 Ptr<IeMeshId> |
526 PeerManagementProtocol::GetMeshId () const | 530 PeerManagementProtocol::GetMeshId () const |
527 { | 531 { |
528 NS_ASSERT (m_meshId != 0); | 532 NS_ASSERT (m_meshId != 0); |
529 return m_meshId; | 533 return m_meshId; |
530 } | 534 } |
531 void | 535 void |
532 PeerManagementProtocol::SetMeshId (std::string s) | 536 PeerManagementProtocol::SetMeshId (std::string s) |
533 { | 537 { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 m_enableBca = enable; | 614 m_enableBca = enable; |
611 } | 615 } |
612 bool | 616 bool |
613 PeerManagementProtocol::GetBeaconCollisionAvoidance () const | 617 PeerManagementProtocol::GetBeaconCollisionAvoidance () const |
614 { | 618 { |
615 return m_enableBca; | 619 return m_enableBca; |
616 } | 620 } |
617 } // namespace dot11s | 621 } // namespace dot11s |
618 } // namespace ns3 | 622 } // namespace ns3 |
619 | 623 |
OLD | NEW |