|
|
| 182 |
} |
182 |
} |
| 183 |
InetSocketAddress ad = InetSocketAddress::ConvertFrom (address); |
183 |
InetSocketAddress ad = InetSocketAddress::ConvertFrom (address); |
| 184 |
m_dst = ad.GetIpv4 (); |
184 |
m_dst = ad.GetIpv4 (); |
|
|
185 |
SetIpTos (ad.GetTos ()); |
| 186 |
|
| 185 |
return 0; |
187 |
return 0; |
| 186 |
} |
188 |
} |
| 187 |
int |
189 |
int |
|
|
| 202 |
{ |
204 |
{ |
| 203 |
NS_LOG_FUNCTION (this << p << flags); |
205 |
NS_LOG_FUNCTION (this << p << flags); |
| 204 |
InetSocketAddress to = InetSocketAddress (m_dst, m_protocol); |
206 |
InetSocketAddress to = InetSocketAddress (m_dst, m_protocol); |
|
|
207 |
to.SetTos (GetIpTos ()); |
| 205 |
return SendTo (p, flags, to); |
208 |
return SendTo (p, flags, to); |
| 206 |
} |
209 |
} |
| 207 |
int |
210 |
int |
|
|
| 218 |
{ |
221 |
{ |
| 219 |
return 0; |
222 |
return 0; |
| 220 |
} |
223 |
} |
|
|
224 |
|
| 221 |
InetSocketAddress ad = InetSocketAddress::ConvertFrom (toAddress); |
225 |
InetSocketAddress ad = InetSocketAddress::ConvertFrom (toAddress); |
| 222 |
Ptr<Ipv4> ipv4 = m_node->GetObject<Ipv4> (); |
226 |
Ptr<Ipv4> ipv4 = m_node->GetObject<Ipv4> (); |
| 223 |
Ipv4Address dst = ad.GetIpv4 (); |
227 |
Ipv4Address dst = ad.GetIpv4 (); |
| 224 |
Ipv4Address src = m_src; |
228 |
Ipv4Address src = m_src; |
|
|
229 |
uint8_t tos = ad.GetTos (); |
| 230 |
|
| 231 |
uint8_t priority = GetPriority (); |
| 232 |
if (tos) |
| 233 |
{ |
| 234 |
SocketIpTosTag ipTosTag; |
| 235 |
ipTosTag.SetTos (tos); |
| 236 |
// This packet may already have a SocketIpTosTag (see BUG 2440) |
| 237 |
p->ReplacePacketTag (ipTosTag); |
| 238 |
priority = IpTos2Priority (tos); |
| 239 |
} |
| 240 |
if (priority) |
| 241 |
{ |
| 242 |
SocketPriorityTag priorityTag; |
| 243 |
priorityTag.SetPriority (priority); |
| 244 |
p->ReplacePacketTag (priorityTag); |
| 245 |
} |
| 246 |
|
| 247 |
if (IsManualIpTtl () && GetIpTtl () != 0 && !dst.IsMulticast () && !dst.IsBroadcast ()) |
| 248 |
{ |
| 249 |
SocketIpTtlTag tag; |
| 250 |
tag.SetTtl (GetIpTtl ()); |
| 251 |
p->AddPacketTag (tag); |
| 252 |
} |
| 253 |
|
| 225 |
if (ipv4->GetRoutingProtocol ()) |
254 |
if (ipv4->GetRoutingProtocol ()) |
| 226 |
{ |
255 |
{ |
| 227 |
Ipv4Header header; |
256 |
Ipv4Header header; |
|
|
| 357 |
tag.SetRecvIf (incomingInterface->GetDevice ()->GetIfIndex ()); |
386 |
tag.SetRecvIf (incomingInterface->GetDevice ()->GetIfIndex ()); |
| 358 |
copy->AddPacketTag (tag); |
387 |
copy->AddPacketTag (tag); |
| 359 |
} |
388 |
} |
| 360 |
if (m_protocol == 1) |
389 |
|
|
|
390 |
//Check only version 4 options |
| 391 |
if (IsIpRecvTos ()) |
| 392 |
{ |
| 393 |
SocketIpTosTag ipTosTag; |
| 394 |
ipTosTag.SetTos (ipHeader.GetTos ()); |
| 395 |
copy->AddPacketTag (ipTosTag); |
| 396 |
} |
| 397 |
|
| 398 |
if (IsIpRecvTtl ()) |
| 399 |
{ |
| 400 |
SocketIpTtlTag ipTtlTag; |
| 401 |
ipTtlTag.SetTtl (ipHeader.GetTtl ()); |
| 402 |
copy->AddPacketTag (ipTtlTag); |
| 403 |
} |
| 404 |
|
| 405 |
if (m_protocol == 1) |
| 361 |
{ |
406 |
{ |
| 362 |
Icmpv4Header icmpHeader; |
407 |
Icmpv4Header icmpHeader; |
| 363 |
copy->PeekHeader (icmpHeader); |
408 |
copy->PeekHeader (icmpHeader); |