297 m_channel = channel; |
297 m_channel = channel; |
298 m_phy->SetChannel (channel); |
298 m_phy->SetChannel (channel); |
299 NotifyConnected (); |
299 NotifyConnected (); |
300 } |
300 } |
301 bool |
301 bool |
302 WifiNetDevice::SendTo (const Packet &packet, const Address &to, uint16_t protocolNumber) |
302 WifiNetDevice::SendTo (Ptr<Packet> packet, const Address &to, uint16_t protocolNumber) |
303 { |
303 { |
304 NS_ASSERT (Mac48Address::IsMatchingType (to)); |
304 NS_ASSERT (Mac48Address::IsMatchingType (to)); |
305 |
305 |
306 Mac48Address realTo = Mac48Address::ConvertFrom (to); |
306 Mac48Address realTo = Mac48Address::ConvertFrom (to); |
307 |
|
308 Packet p = packet; |
|
309 |
307 |
310 LlcSnapHeader llc; |
308 LlcSnapHeader llc; |
311 llc.SetType (protocolNumber); |
309 llc.SetType (protocolNumber); |
312 p.AddHeader (llc); |
310 packet->AddHeader (llc); |
313 |
311 |
314 m_txLogger (p, realTo); |
312 m_txLogger (packet, realTo); |
315 |
313 |
316 return DoSendTo (p, realTo); |
314 return DoSendTo (packet, realTo); |
317 } |
315 } |
318 void |
316 void |
319 WifiNetDevice::DoForwardUp (Packet packet, const Mac48Address &from) |
317 WifiNetDevice::DoForwardUp (Ptr<Packet> packet, const Mac48Address &from) |
320 { |
318 { |
321 m_rxLogger (packet, from); |
319 m_rxLogger (packet, from); |
322 |
320 |
323 LlcSnapHeader llc; |
321 LlcSnapHeader llc; |
324 packet.RemoveHeader (llc); |
322 packet->RemoveHeader (llc); |
325 NetDevice::ForwardUp (packet, llc.GetType (), from); |
323 NetDevice::ForwardUp (packet, llc.GetType (), from); |
326 } |
324 } |
327 Mac48Address |
325 Mac48Address |
328 WifiNetDevice::GetSelfAddress (void) const |
326 WifiNetDevice::GetSelfAddress (void) const |
329 { |
327 { |
597 NqapWifiNetDevice::StartBeaconing (void) |
595 NqapWifiNetDevice::StartBeaconing (void) |
598 { |
596 { |
599 m_high->StartBeaconing (); |
597 m_high->StartBeaconing (); |
600 } |
598 } |
601 bool |
599 bool |
602 NqapWifiNetDevice::DoSendTo (const Packet &packet, Mac48Address const & to) |
600 NqapWifiNetDevice::DoSendTo (Ptr<const Packet> packet, Mac48Address const & to) |
603 { |
601 { |
604 m_high->Queue (packet, to); |
602 m_high->Queue (packet, to); |
605 return true; |
603 return true; |
606 } |
604 } |
607 void |
605 void |