diff --git a/.hgignore b/.hgignore index abd47b695..a622a8d15 100644 --- a/.hgignore +++ b/.hgignore @@ -11,6 +11,7 @@ ^doc/introspected-doxygen\.h$ .*\.py[co]$ \.pcap$ +\.xml$ \.mob$ ^doc/manual/manual/ doc/manual/manual.aux diff --git a/src/devices/mesh/dot11s/dot11s-mac-header.cc b/src/devices/mesh/dot11s/dot11s-mac-header.cc index ae808696e..e91cff4dc 100644 --- a/src/devices/mesh/dot11s/dot11s-mac-header.cc +++ b/src/devices/mesh/dot11s/dot11s-mac-header.cc @@ -111,12 +111,12 @@ MeshHeader::SetAddressExt (uint8_t num_of_addresses) { if (num_of_addresses > 3) return; - m_meshFlags |= 0xc0 & (num_of_addresses << 6); + m_meshFlags |= 0x03 & num_of_addresses; } uint8_t MeshHeader::GetAddressExt () const { - return ((0xc0 & m_meshFlags) >> 6); + return (0x03 & m_meshFlags); } uint32_t MeshHeader::GetSerializedSize () const @@ -129,7 +129,7 @@ MeshHeader::Serialize (Buffer::Iterator start) const Buffer::Iterator i = start; i.WriteU8 (m_meshFlags); i.WriteU8 (m_meshTtl); - i.WriteU32 (m_meshSeqno); + i.WriteHtolsbU32 (m_meshSeqno); uint8_t addresses_to_add = GetAddressExt (); //Writing Address extensions: if ((addresses_to_add == 1) || (addresses_to_add == 3)) @@ -146,8 +146,8 @@ MeshHeader::Deserialize (Buffer::Iterator start) uint8_t addresses_to_read = 0; m_meshFlags = i.ReadU8 (); m_meshTtl = i.ReadU8 (); - m_meshSeqno = i.ReadU32 (); - addresses_to_read = (m_meshFlags & 0xc0) >> 6; + m_meshSeqno = i.ReadLsbtohU32 (); + addresses_to_read = m_meshFlags & 0x03; if ((addresses_to_read == 1) || (addresses_to_read == 3)) ReadFrom (i, m_addr4); if (addresses_to_read > 1) @@ -195,7 +195,7 @@ WifiMeshActionHeader::SetAction ( switch (type) { - case MESH_PEER_LINK_MGT: + case MESH_PEERING_MGT: { m_actionValue = action.peerLink; break; @@ -206,8 +206,9 @@ WifiMeshActionHeader::SetAction ( break; } case MESH_LINK_METRIC: - case MESH_INTERWORK_ACTION: + case MESH_INTERWORKING: case MESH_RESOURCE_COORDINATION: + case MESH_PROXY_FORWARDING: break; }; } @@ -216,19 +217,21 @@ WifiMeshActionHeader::GetCategory () { switch (m_category) { - case MESH_PEER_LINK_MGT: - return MESH_PEER_LINK_MGT; + case MESH_PEERING_MGT: + return MESH_PEERING_MGT; case MESH_LINK_METRIC: return MESH_LINK_METRIC; case MESH_PATH_SELECTION: return MESH_PATH_SELECTION; - case MESH_INTERWORK_ACTION: - return MESH_INTERWORK_ACTION; + case MESH_INTERWORKING: + return MESH_INTERWORKING; case MESH_RESOURCE_COORDINATION: return MESH_RESOURCE_COORDINATION; + case MESH_PROXY_FORWARDING: + return MESH_PROXY_FORWARDING; default: NS_ASSERT (false); - return MESH_PEER_LINK_MGT; + return MESH_PEERING_MGT; } } WifiMeshActionHeader::ActionValue @@ -237,7 +240,7 @@ WifiMeshActionHeader::GetAction () ActionValue retval; switch (m_category) { - case MESH_PEER_LINK_MGT: + case MESH_PEERING_MGT: switch (m_actionValue) { case PEER_LINK_OPEN: @@ -274,7 +277,7 @@ WifiMeshActionHeader::GetAction () } case MESH_LINK_METRIC: // ??? - case MESH_INTERWORK_ACTION: + case MESH_INTERWORKING: // ??? case MESH_RESOURCE_COORDINATION: // ??? diff --git a/src/devices/mesh/dot11s/dot11s-mac-header.h b/src/devices/mesh/dot11s/dot11s-mac-header.h index ad5bfd159..48d7bdf4f 100644 --- a/src/devices/mesh/dot11s/dot11s-mac-header.h +++ b/src/devices/mesh/dot11s/dot11s-mac-header.h @@ -89,11 +89,12 @@ public: /* Compatible with open80211s implementation */ enum CategoryValue //table 7-24 staring from 4 { - MESH_PEER_LINK_MGT = 30, + MESH_PEERING_MGT = 30, MESH_LINK_METRIC = 31, MESH_PATH_SELECTION = 32, - MESH_INTERWORK_ACTION = 33, + MESH_INTERWORKING = 33, MESH_RESOURCE_COORDINATION = 34, + MESH_PROXY_FORWARDING = 35, }; /* Compatible with open80211s implementation */ enum PeerLinkMgtActionValue @@ -129,7 +130,7 @@ public: MDAOP_SET_TEARDOWN, BEACON_TIMING_REQUEST, BEACON_TIMING_RESPONSE, - TBTT_ADJASTMENT_REQUEST, + TBTT_ADJUSTMENT_REQUEST, MESH_CHANNEL_SWITCH_ANNOUNCEMENT, }; typedef union diff --git a/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc index c4e0eb046..3cb06172c 100644 --- a/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc +++ b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc @@ -93,7 +93,7 @@ IeBeaconTiming::AddNeighboursTimingElementUnit ( { if (m_numOfUnits == 50) return; - //Firs we lookup if this element already exists + //First we lookup if this element already exists for (NeighboursTimingUnitsList::const_iterator i = m_neighbours.begin (); i != m_neighbours.end(); i++) if ( ((*i)->GetAid () == AidToU8(aid)) diff --git a/src/devices/mesh/dot11s/ie-dot11s-configuration.cc b/src/devices/mesh/dot11s/ie-dot11s-configuration.cc index dbb676583..078e19740 100644 --- a/src/devices/mesh/dot11s/ie-dot11s-configuration.cc +++ b/src/devices/mesh/dot11s/ie-dot11s-configuration.cc @@ -148,7 +148,7 @@ IeConfiguration::DeserializeInformation (Buffer::Iterator i, uint8_t length) m_CCMId = (dot11sCongestionControlMode)i.ReadLsbtohU32 (); m_SPId = (dot11sSynchronizationProtocolIdentifier)i.ReadLsbtohU32 (); m_APId = (dot11sAuthenticationProtocol)i.ReadLsbtohU32 (); - m_neighbors = i.ReadU8 () / 2; + m_neighbors = (i.ReadU8 () >> 1) & 0xF; i = m_meshCap.Deserialize (i); return i.GetDistanceFrom (start); } diff --git a/src/devices/mesh/dot11s/peer-management-plugin.cc b/src/devices/mesh/dot11s/peer-management-plugin.cc index 871536e69..3171d9b51 100644 --- a/src/devices/mesh/dot11s/peer-management-plugin.cc +++ b/src/devices/mesh/dot11s/peer-management-plugin.cc @@ -82,7 +82,7 @@ PeerManagerMacPlugin::Receive (Ptr const_packet, const WifiMacHeader & h packet->RemoveHeader (actionHdr); WifiMeshActionHeader::ActionValue actionValue = actionHdr.GetAction (); // If can not handle - just return; - if(actionHdr.GetCategory () != WifiMeshActionHeader::MESH_PEER_LINK_MGT) + if(actionHdr.GetCategory () != WifiMeshActionHeader::MESH_PEERING_MGT) return m_protocol->IsActiveLink(m_ifIndex,header.GetAddr2()); m_stats.recvMgt ++; m_stats.recvMgtBytes += packet->GetSize (); @@ -149,7 +149,7 @@ PeerManagerMacPlugin::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & WifiMeshActionHeader actionHdr; packet->PeekHeader (actionHdr); WifiMeshActionHeader::ActionValue actionValue = actionHdr.GetAction (); - if(actionHdr.GetCategory () == WifiMeshActionHeader::MESH_PEER_LINK_MGT) + if(actionHdr.GetCategory () == WifiMeshActionHeader::MESH_PEERING_MGT) return true; } if(header.GetAddr1 ().IsGroup ()) @@ -201,7 +201,7 @@ PeerManagerMacPlugin::SendPeerLinkManagementFrame( WifiMeshActionHeader::ActionValue action; action.peerLink = WifiMeshActionHeader::PEER_LINK_OPEN; fields.subtype = WifiMeshActionHeader::PEER_LINK_OPEN; - actionHdr.SetAction (WifiMeshActionHeader::MESH_PEER_LINK_MGT, action); + actionHdr.SetAction (WifiMeshActionHeader::MESH_PEERING_MGT, action); } if (peerElement.SubtypeIsConfirm ()) { @@ -210,7 +210,7 @@ PeerManagerMacPlugin::SendPeerLinkManagementFrame( action.peerLink = WifiMeshActionHeader::PEER_LINK_CONFIRM; fields.aid = aid; fields.subtype = WifiMeshActionHeader::PEER_LINK_CONFIRM; - actionHdr.SetAction (WifiMeshActionHeader::MESH_PEER_LINK_MGT, action); + actionHdr.SetAction (WifiMeshActionHeader::MESH_PEERING_MGT, action); } if (peerElement.SubtypeIsClose ()) { @@ -219,7 +219,7 @@ PeerManagerMacPlugin::SendPeerLinkManagementFrame( action.peerLink = WifiMeshActionHeader::PEER_LINK_CLOSE; fields.subtype = WifiMeshActionHeader::PEER_LINK_CLOSE; fields.reasonCode = peerElement.GetReasonCode (); - actionHdr.SetAction (WifiMeshActionHeader::MESH_PEER_LINK_MGT, action); + actionHdr.SetAction (WifiMeshActionHeader::MESH_PEERING_MGT, action); } plinkFrame.SetPlinkFrameStart(fields); packet->AddHeader (plinkFrame);