|
Lines 485-496
UdpSocketImpl::DoSendTo (Ptr<Packet> p, Ipv4Address dest, uint16_t port)
|
Link Here
|
|---|
|
| 485 |
return -1; |
485 |
return -1; |
| 486 |
} |
486 |
} |
| 487 |
|
487 |
|
| 488 |
if (IsManualIpTos ()) |
488 |
SocketIpTosTag ipTosTag; |
| 489 |
{ |
489 |
ipTosTag.SetTos (GetIpTos ()); |
| 490 |
SocketIpTosTag ipTosTag; |
|
|
| 491 |
ipTosTag.SetTos (GetIpTos ()); |
| 492 |
p->AddPacketTag (ipTosTag); |
| 493 |
} |
| 494 |
|
490 |
|
| 495 |
Ptr<Ipv4> ipv4 = m_node->GetObject<Ipv4> (); |
491 |
Ptr<Ipv4> ipv4 = m_node->GetObject<Ipv4> (); |
| 496 |
|
492 |
|
|
Lines 561-572
UdpSocketImpl::DoSendTo (Ptr<Packet> p, Ipv4Address dest, uint16_t port)
|
Link Here
|
|---|
|
| 561 |
continue; |
557 |
continue; |
| 562 |
} |
558 |
} |
| 563 |
Ipv4Mask maski = iaddr.GetMask (); |
559 |
Ipv4Mask maski = iaddr.GetMask (); |
|
|
560 |
Ptr<Packet> pktCopy = p->Copy (); |
| 561 |
if (IsManualIpTos ()) |
| 562 |
{ |
| 563 |
pktCopy->AddPacketTag (ipTosTag); |
| 564 |
} |
| 564 |
if (maski == Ipv4Mask::GetOnes ()) |
565 |
if (maski == Ipv4Mask::GetOnes ()) |
| 565 |
{ |
566 |
{ |
| 566 |
// if the network mask is 255.255.255.255, do not convert dest |
567 |
// if the network mask is 255.255.255.255, do not convert dest |
| 567 |
NS_LOG_LOGIC ("Sending one copy from " << addri << " to " << dest |
568 |
NS_LOG_LOGIC ("Sending one copy from " << addri << " to " << dest |
| 568 |
<< " (mask is " << maski << ")"); |
569 |
<< " (mask is " << maski << ")"); |
| 569 |
m_udp->Send (p->Copy (), addri, dest, |
570 |
m_udp->Send (pktCopy, addri, dest, |
| 570 |
m_endPoint->GetLocalPort (), port); |
571 |
m_endPoint->GetLocalPort (), port); |
| 571 |
NotifyDataSent (p->GetSize ()); |
572 |
NotifyDataSent (p->GetSize ()); |
| 572 |
NotifySend (GetTxAvailable ()); |
573 |
NotifySend (GetTxAvailable ()); |
|
Lines 577-583
UdpSocketImpl::DoSendTo (Ptr<Packet> p, Ipv4Address dest, uint16_t port)
|
Link Here
|
|---|
|
| 577 |
Ipv4Address bcast = addri.GetSubnetDirectedBroadcast (maski); |
578 |
Ipv4Address bcast = addri.GetSubnetDirectedBroadcast (maski); |
| 578 |
NS_LOG_LOGIC ("Sending one copy from " << addri << " to " << bcast |
579 |
NS_LOG_LOGIC ("Sending one copy from " << addri << " to " << bcast |
| 579 |
<< " (mask is " << maski << ")"); |
580 |
<< " (mask is " << maski << ")"); |
| 580 |
m_udp->Send (p->Copy (), addri, bcast, |
581 |
m_udp->Send (pktCopy, addri, bcast, |
| 581 |
m_endPoint->GetLocalPort (), port); |
582 |
m_endPoint->GetLocalPort (), port); |
| 582 |
NotifyDataSent (p->GetSize ()); |
583 |
NotifyDataSent (p->GetSize ()); |
| 583 |
NotifySend (GetTxAvailable ()); |
584 |
NotifySend (GetTxAvailable ()); |
|
Lines 588-594
UdpSocketImpl::DoSendTo (Ptr<Packet> p, Ipv4Address dest, uint16_t port)
|
Link Here
|
|---|
|
| 588 |
} |
589 |
} |
| 589 |
else if (m_endPoint->GetLocalAddress () != Ipv4Address::GetAny ()) |
590 |
else if (m_endPoint->GetLocalAddress () != Ipv4Address::GetAny ()) |
| 590 |
{ |
591 |
{ |
| 591 |
m_udp->Send (p->Copy (), m_endPoint->GetLocalAddress (), dest, |
592 |
Ptr<Packet> pktCopy = p->Copy (); |
|
|
593 |
if (IsManualIpTos ()) |
| 594 |
{ |
| 595 |
pktCopy->AddPacketTag (ipTosTag); |
| 596 |
} |
| 597 |
m_udp->Send (pktCopy, m_endPoint->GetLocalAddress (), dest, |
| 592 |
m_endPoint->GetLocalPort (), port, 0); |
598 |
m_endPoint->GetLocalPort (), port, 0); |
| 593 |
NotifyDataSent (p->GetSize ()); |
599 |
NotifyDataSent (p->GetSize ()); |
| 594 |
NotifySend (GetTxAvailable ()); |
600 |
NotifySend (GetTxAvailable ()); |
|
Lines 623-629
UdpSocketImpl::DoSendTo (Ptr<Packet> p, Ipv4Address dest, uint16_t port)
|
Link Here
|
|---|
|
| 623 |
} |
629 |
} |
| 624 |
|
630 |
|
| 625 |
header.SetSource (route->GetSource ()); |
631 |
header.SetSource (route->GetSource ()); |
| 626 |
m_udp->Send (p->Copy (), header.GetSource (), header.GetDestination (), |
632 |
Ptr<Packet> pktCopy = p->Copy (); |
|
|
633 |
if (IsManualIpTos ()) |
| 634 |
{ |
| 635 |
pktCopy->AddPacketTag (ipTosTag); |
| 636 |
} |
| 637 |
m_udp->Send (pktCopy, header.GetSource (), header.GetDestination (), |
| 627 |
m_endPoint->GetLocalPort (), port, route); |
638 |
m_endPoint->GetLocalPort (), port, route); |
| 628 |
NotifyDataSent (p->GetSize ()); |
639 |
NotifyDataSent (p->GetSize ()); |
| 629 |
return p->GetSize (); |
640 |
return p->GetSize (); |