View | Details | Raw Unified | Return to bug 417
Collapse All | Expand All

(-)a/src/internet-stack/ipv4-end-point.cc (-4 / +18 lines)
 Lines 21-26    Link Here 
21
#include "ipv4-end-point.h"
21
#include "ipv4-end-point.h"
22
#include "ns3/packet.h"
22
#include "ns3/packet.h"
23
#include "ns3/log.h"
23
#include "ns3/log.h"
24
#include "ns3/simulator.h"
24
25
25
NS_LOG_COMPONENT_DEFINE ("Ipv4EndPoint");
26
NS_LOG_COMPONENT_DEFINE ("Ipv4EndPoint");
26
27
 Lines 95-103    Link Here 
95
Ipv4EndPoint::ForwardUp (Ptr<Packet> p, Ipv4Address saddr, uint16_t sport)
96
Ipv4EndPoint::ForwardUp (Ptr<Packet> p, Ipv4Address saddr, uint16_t sport)
96
{
97
{
97
  if (!m_rxCallback.IsNull ())
98
  if (!m_rxCallback.IsNull ())
98
  {
99
    {
99
    m_rxCallback (p, saddr, sport);
100
      Simulator::ScheduleNow (&Ipv4EndPoint::DoForwardUp, this, p, saddr, sport);
100
  }
101
    }
102
}
103
void 
104
Ipv4EndPoint::DoForwardUp (Ptr<Packet> p, Ipv4Address saddr, uint16_t sport)
105
{
106
  m_rxCallback (p, saddr, sport);
101
}
107
}
102
108
103
void 
109
void 
 Lines 109-116    Link Here 
109
                   (uint32_t)icmpCode << icmpInfo);
115
                   (uint32_t)icmpCode << icmpInfo);
110
  if (!m_icmpCallback.IsNull ())
116
  if (!m_icmpCallback.IsNull ())
111
    {
117
    {
112
      m_icmpCallback (icmpSource,icmpTtl,icmpType,icmpCode,icmpInfo);
118
      Simulator::ScheduleNow (&Ipv4EndPoint::DoForwardIcmp, this, 
119
                              icmpSource, icmpTtl, icmpType, icmpCode, icmpInfo);
113
    }
120
    }
121
}
122
void 
123
Ipv4EndPoint::DoForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, 
124
                             uint8_t icmpType, uint8_t icmpCode,
125
                             uint32_t icmpInfo)
126
{
127
  m_icmpCallback (icmpSource,icmpTtl,icmpType,icmpCode,icmpInfo);
114
}
128
}
115
129
116
}; // namespace ns3
130
}; // namespace ns3
(-)a/src/internet-stack/ipv4-end-point.h (+4 lines)
 Lines 69-74    Link Here 
69
                    uint32_t icmpInfo);
69
                    uint32_t icmpInfo);
70
70
71
private:
71
private:
72
  void DoForwardUp (Ptr<Packet> p, Ipv4Address saddr, uint16_t sport);
73
  void DoForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, 
74
                      uint8_t icmpType, uint8_t icmpCode,
75
                      uint32_t icmpInfo);
72
  Ipv4Address m_localAddr;
76
  Ipv4Address m_localAddr;
73
  uint16_t m_localPort;
77
  uint16_t m_localPort;
74
  Ipv4Address m_peerAddr;
78
  Ipv4Address m_peerAddr;

Return to bug 417