OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 #include <netinet/in.h> | 2 #include <netinet/in.h> |
3 #include <sys/socket.h> | 3 #include <sys/socket.h> |
4 #include <sys/types.h> | 4 #include <sys/types.h> |
5 #include "ipv4-raw-socket-impl.h" | 5 #include "ipv4-raw-socket-impl.h" |
6 #include "ipv4-l3-protocol.h" | 6 #include "ipv4-l3-protocol.h" |
7 #include "icmpv4.h" | 7 #include "icmpv4.h" |
8 #include "ns3/ipv4-packet-info-tag.h" | 8 #include "ns3/ipv4-packet-info-tag.h" |
9 #include "ns3/inet-socket-address.h" | 9 #include "ns3/inet-socket-address.h" |
10 #include "ns3/node.h" | 10 #include "ns3/node.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 { | 311 { |
312 return false; | 312 return false; |
313 } | 313 } |
314 NS_LOG_LOGIC ("src = " << m_src << " dst = " << m_dst); | 314 NS_LOG_LOGIC ("src = " << m_src << " dst = " << m_dst); |
315 if ((m_src == Ipv4Address::GetAny () || ipHeader.GetDestination () == m_src) &
& | 315 if ((m_src == Ipv4Address::GetAny () || ipHeader.GetDestination () == m_src) &
& |
316 (m_dst == Ipv4Address::GetAny () || ipHeader.GetSource () == m_dst) && | 316 (m_dst == Ipv4Address::GetAny () || ipHeader.GetSource () == m_dst) && |
317 ipHeader.GetProtocol () == m_protocol) | 317 ipHeader.GetProtocol () == m_protocol) |
318 { | 318 { |
319 Ptr<Packet> copy = p->Copy (); | 319 Ptr<Packet> copy = p->Copy (); |
320 // Should check via getsockopt ().. | 320 // Should check via getsockopt ().. |
321 if (this->m_recvpktinfo) | 321 if (IsRecvPktInfo ()) |
322 { | 322 { |
323 Ipv4PacketInfoTag tag; | 323 Ipv4PacketInfoTag tag; |
324 copy->RemovePacketTag (tag); | 324 copy->RemovePacketTag (tag); |
325 tag.SetRecvIf (incomingInterface->GetDevice ()->GetIfIndex ()); | 325 tag.SetRecvIf (incomingInterface->GetDevice ()->GetIfIndex ()); |
326 copy->AddPacketTag (tag); | 326 copy->AddPacketTag (tag); |
327 } | 327 } |
328 if (m_protocol == 1) | 328 if (m_protocol == 1) |
329 { | 329 { |
330 Icmpv4Header icmpHeader; | 330 Icmpv4Header icmpHeader; |
331 copy->PeekHeader (icmpHeader); | 331 copy->PeekHeader (icmpHeader); |
(...skipping 27 matching lines...) Expand all Loading... |
359 return true; | 359 return true; |
360 } | 360 } |
361 | 361 |
362 bool | 362 bool |
363 Ipv4RawSocketImpl::GetAllowBroadcast () const | 363 Ipv4RawSocketImpl::GetAllowBroadcast () const |
364 { | 364 { |
365 return true; | 365 return true; |
366 } | 366 } |
367 | 367 |
368 } // namespace ns3 | 368 } // namespace ns3 |
OLD | NEW |