src/devices/mesh/mesh-wifi-peer-manager.h
changeset 4857 ddfb13420455
parent 4853 cb12c7003071
equal deleted inserted replaced
4856:b7241df728a3 4857:ddfb13420455
    34 namespace ns3 {
    34 namespace ns3 {
    35 class MeshWifiMac;
    35 class MeshWifiMac;
    36 /**
    36 /**
    37  * \ingroup mesh
    37  * \ingroup mesh
    38  */
    38  */
    39 class WifiPeerLinkDescriptor : public RefCountBase
    39 class WifiPeerLinkDescriptorDUP : public RefCountBase
    40 {
    40 {
    41 public:
    41 public:
    42   WifiPeerLinkDescriptor ();
    42   WifiPeerLinkDescriptorDUP ();
    43   /**
    43   /**
    44    * Beacon loss processing:
    44    * Beacon loss processing:
    45    */
    45    */
    46   void  SetBeaconInformation (Time lastBeacon, Time BeaconInterval);
    46   void  SetBeaconInformation (Time lastBeacon, Time BeaconInterval);
    47   void  SetMaxBeaconLoss (uint8_t maxBeaconLoss);
    47   void  SetMaxBeaconLoss (uint8_t maxBeaconLoss);
    62   void  SetLocalLinkId  (uint16_t id);
    62   void  SetLocalLinkId  (uint16_t id);
    63   void  SetPeerLinkId   (uint16_t id);
    63   void  SetPeerLinkId   (uint16_t id);
    64   void  SetLocalAid     (uint16_t aid);
    64   void  SetLocalAid     (uint16_t aid);
    65   void  SetPeerAid      (uint16_t aid);
    65   void  SetPeerAid      (uint16_t aid);
    66   void  SetBeaconTimingElement (IeDot11sBeaconTiming beaconTiming);
    66   void  SetBeaconTimingElement (IeDot11sBeaconTiming beaconTiming);
    67   void  SetPeerLinkDescriptorElement (IeDot11sPeerManagement peerLinkElement);
    67   void  SetPeerLinkDescriptorDUPElement (IeDot11sPeerManagement peerLinkElement);
    68   Mac48Address GetPeerAddress () const;
    68   Mac48Address GetPeerAddress () const;
    69   /**
    69   /**
    70    * Debug purpose
    70    * Debug purpose
    71    */
    71    */
    72   Mac48Address GetLocalAddress () const;
    72   Mac48Address GetLocalAddress () const;
    73   uint16_t GetLocalAid () const;
    73   uint16_t GetLocalAid () const;
    74   Time  GetLastBeacon () const;
    74   Time  GetLastBeacon () const;
    75   Time  GetBeaconInterval () const;
    75   Time  GetBeaconInterval () const;
    76   IeDot11sBeaconTiming    GetBeaconTimingElement () const;
    76   IeDot11sBeaconTiming    GetBeaconTimingElement () const;
    77   IeDot11sPeerManagement  GetPeerLinkDescriptorElement () const;
    77   IeDot11sPeerManagement  GetPeerLinkDescriptorDUPElement () const;
    78   void  ClearTimingElement ();
    78   void  ClearTimingElement ();
    79   /* MLME */
    79   /* MLME */
    80   void  MLMECancelPeerLink (dot11sReasonCode reason);
    80   void  MLMECancelPeerLink (dot11sReasonCode reason);
    81   void  MLMEPassivePeerLinkOpen ();
    81   void  MLMEPassivePeerLinkOpen ();
    82   void  MLMEActivePeerLinkOpen ();
    82   void  MLMEActivePeerLinkOpen ();
   251   struct BeaconInfo
   251   struct BeaconInfo
   252   {
   252   {
   253     Time referenceTbtt; //When one of my station's beacons was put into a beacon queue;
   253     Time referenceTbtt; //When one of my station's beacons was put into a beacon queue;
   254     Time beaconInterval; //Beacon interval of my station;
   254     Time beaconInterval; //Beacon interval of my station;
   255   };
   255   };
   256   typedef std::map<Mac48Address, std::vector<Ptr<WifiPeerLinkDescriptor> >, std::less<Mac48Address> >  PeerDescriptorsMap;
   256   typedef std::map<Mac48Address, std::vector<Ptr<WifiPeerLinkDescriptorDUP> >, std::less<Mac48Address> >  PeerDescriptorsMap;
   257   typedef std::map<Mac48Address, Ptr<MeshWifiMac>,std::less<Mac48Address> > MeshMacMap;
   257   typedef std::map<Mac48Address, Ptr<MeshWifiMac>,std::less<Mac48Address> > MeshMacMap;
   258   typedef std::map<Mac48Address, BeaconInfo, std::less<Mac48Address> > BeaconInfoMap;
   258   typedef std::map<Mac48Address, BeaconInfo, std::less<Mac48Address> > BeaconInfoMap;
   259 
   259 
   260   //Ptr<MeshWifiMac> m_mac;
   260   //Ptr<MeshWifiMac> m_mac;
   261   //Maximum peers that may be opened:
   261   //Maximum peers that may be opened:
   280   uint8_t  m_maxBeaconLoss;
   280   uint8_t  m_maxBeaconLoss;
   281   //Periodically we scan the peer manager list of peers
   281   //Periodically we scan the peer manager list of peers
   282   //and check if the too many  beacons were lost:
   282   //and check if the too many  beacons were lost:
   283   Time  m_peerLinkCleanupPeriod;
   283   Time  m_peerLinkCleanupPeriod;
   284   EventId  m_cleanupEvent;
   284   EventId  m_cleanupEvent;
   285   Ptr<WifiPeerLinkDescriptor> AddDescriptor (
   285   Ptr<WifiPeerLinkDescriptorDUP> AddDescriptor (
   286     Mac48Address portAddress,
   286     Mac48Address portAddress,
   287     Mac48Address peerAddress,
   287     Mac48Address peerAddress,
   288     Time lastBeacon,
   288     Time lastBeacon,
   289     Time beaconInterval
   289     Time beaconInterval
   290   );
   290   );