equal
deleted
inserted
replaced
94 |
94 |
95 TypeId |
95 TypeId |
96 NscTcpL4Protocol::GetTypeId (void) |
96 NscTcpL4Protocol::GetTypeId (void) |
97 { |
97 { |
98 static TypeId tid = TypeId ("ns3::NscTcpL4Protocol") |
98 static TypeId tid = TypeId ("ns3::NscTcpL4Protocol") |
99 .SetParent<Ipv4L4Protocol> () |
99 .SetParent<IpL4Protocol> () |
100 .AddConstructor<NscTcpL4Protocol>() |
100 .AddConstructor<NscTcpL4Protocol>() |
101 .AddAttribute ("SocketList", "The list of sockets associated to this protocol.", |
101 .AddAttribute ("SocketList", "The list of sockets associated to this protocol.", |
102 ObjectVectorValue (), |
102 ObjectVectorValue (), |
103 MakeObjectVectorAccessor (&NscTcpL4Protocol::m_sockets), |
103 MakeObjectVectorAccessor (&NscTcpL4Protocol::m_sockets), |
104 MakeObjectVectorChecker<NscTcpSocketImpl> ()) |
104 MakeObjectVectorChecker<NscTcpSocketImpl> ()) |
240 } |
240 } |
241 m_node = 0; |
241 m_node = 0; |
242 delete m_nscInterface; |
242 delete m_nscInterface; |
243 m_nscInterface = 0; |
243 m_nscInterface = 0; |
244 m_downTarget.Nullify (); |
244 m_downTarget.Nullify (); |
245 Ipv4L4Protocol::DoDispose (); |
245 IpL4Protocol::DoDispose (); |
246 } |
246 } |
247 |
247 |
248 Ptr<Socket> |
248 Ptr<Socket> |
249 NscTcpL4Protocol::CreateSocket (void) |
249 NscTcpL4Protocol::CreateSocket (void) |
250 { |
250 { |
299 { |
299 { |
300 NS_LOG_FUNCTION (this << endPoint); |
300 NS_LOG_FUNCTION (this << endPoint); |
301 // NSC m_endPoints->DeAllocate (endPoint); |
301 // NSC m_endPoints->DeAllocate (endPoint); |
302 } |
302 } |
303 |
303 |
304 Ipv4L4Protocol::RxStatus |
304 IpL4Protocol::RxStatus |
305 NscTcpL4Protocol::Receive (Ptr<Packet> packet, |
305 NscTcpL4Protocol::Receive (Ptr<Packet> packet, |
306 Ipv4Header const &header, |
306 Ipv4Header const &header, |
307 Ptr<Ipv4Interface> incomingInterface) |
307 Ptr<Ipv4Interface> incomingInterface) |
308 { |
308 { |
309 NS_LOG_FUNCTION (this << packet << header << incomingInterface); |
309 NS_LOG_FUNCTION (this << packet << header << incomingInterface); |
333 // deliver complete packet to the NSC network stack |
333 // deliver complete packet to the NSC network stack |
334 m_nscStack->if_receive_packet (0, data, packetSize); |
334 m_nscStack->if_receive_packet (0, data, packetSize); |
335 delete[] buf; |
335 delete[] buf; |
336 |
336 |
337 wakeup (); |
337 wakeup (); |
338 return Ipv4L4Protocol::RX_OK; |
338 return IpL4Protocol::RX_OK; |
|
339 } |
|
340 |
|
341 IpL4Protocol::RxStatus |
|
342 NscTcpL4Protocol::Receive(Ptr<Packet>, Ipv6Address&, Ipv6Address&, Ptr<Ipv6Interface>) |
|
343 { |
|
344 return IpL4Protocol::RX_ENDPOINT_UNREACH; |
339 } |
345 } |
340 |
346 |
341 void NscTcpL4Protocol::SoftInterrupt (void) |
347 void NscTcpL4Protocol::SoftInterrupt (void) |
342 { |
348 { |
343 m_nscStack->timer_interrupt (); |
349 m_nscStack->timer_interrupt (); |
455 } |
461 } |
456 } |
462 } |
457 } |
463 } |
458 |
464 |
459 void |
465 void |
460 NscTcpL4Protocol::SetDownTarget (Ipv4L4Protocol::DownTargetCallback callback) |
466 NscTcpL4Protocol::SetDownTarget (IpL4Protocol::DownTargetCallback callback) |
461 { |
467 { |
462 m_downTarget = callback; |
468 m_downTarget = callback; |
463 } |
469 } |
464 |
470 |
465 Ipv4L4Protocol::DownTargetCallback |
471 void |
|
472 NscTcpL4Protocol::SetDownTarget6 (IpL4Protocol::DownTargetCallback6 callback) |
|
473 { |
|
474 } |
|
475 |
|
476 IpL4Protocol::DownTargetCallback |
466 NscTcpL4Protocol::GetDownTarget (void) const |
477 NscTcpL4Protocol::GetDownTarget (void) const |
467 { |
478 { |
468 return m_downTarget; |
479 return m_downTarget; |
469 } |
480 } |
470 |
481 |
|
482 IpL4Protocol::DownTargetCallback6 |
|
483 NscTcpL4Protocol::GetDownTarget6 (void) const |
|
484 { |
|
485 return (IpL4Protocol::DownTargetCallback6)0; |
|
486 } |
|
487 |
471 } // namespace ns3 |
488 } // namespace ns3 |
472 |
489 |