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

(-)a/src/internet/model/ipv4-end-point.cc (-28 / +1 lines)
 Lines 136-154    Link Here 
136
  
136
  
137
  if (!m_rxCallback.IsNull ())
137
  if (!m_rxCallback.IsNull ())
138
    {
138
    {
139
      Simulator::ScheduleNow (&Ipv4EndPoint::DoForwardUp, this, p, header, sport, 
140
                              incomingInterface);
141
    }
142
}
143
144
void 
145
Ipv4EndPoint::DoForwardUp (Ptr<Packet> p, const Ipv4Header& header, uint16_t sport,
146
                           Ptr<Ipv4Interface> incomingInterface)
147
{
148
  NS_LOG_FUNCTION (this << p << &header << sport << incomingInterface);
149
  
150
  if (!m_rxCallback.IsNull ())
151
    {
152
      m_rxCallback (p, header, sport, incomingInterface);
139
      m_rxCallback (p, header, sport, incomingInterface);
153
    }
140
    }
154
}
141
}
 Lines 162-182    Link Here 
162
                   (uint32_t)icmpCode << icmpInfo);
149
                   (uint32_t)icmpCode << icmpInfo);
163
  if (!m_icmpCallback.IsNull ())
150
  if (!m_icmpCallback.IsNull ())
164
    {
151
    {
165
      Simulator::ScheduleNow (&Ipv4EndPoint::DoForwardIcmp, this, 
152
      m_icmpCallback (icmpSource, icmpTtl, icmpType, icmpCode, icmpInfo);
166
                              icmpSource, icmpTtl, icmpType, icmpCode, icmpInfo);
167
    }
168
}
169
170
void 
171
Ipv4EndPoint::DoForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, 
172
                             uint8_t icmpType, uint8_t icmpCode,
173
                             uint32_t icmpInfo)
174
{
175
  NS_LOG_FUNCTION (this << icmpSource << static_cast<uint32_t> (icmpTtl) << static_cast<uint32_t> (icmpType) << static_cast<uint32_t> (icmpCode) << icmpInfo);
176
  
177
  if (!m_icmpCallback.IsNull ())
178
    {
179
      m_icmpCallback (icmpSource,icmpTtl,icmpType,icmpCode,icmpInfo);
180
    }
153
    }
181
}
154
}
182
155
(-)a/src/internet/model/ipv4-end-point.h (-21 lines)
 Lines 182-208    Link Here 
182
182
183
private:
183
private:
184
  /**
184
  /**
185
   * \brief ForwardUp wrapper.
186
   * \param p packet
187
   * \param header the packet header
188
   * \param sport source port
189
   * \param incomingInterface incoming interface
190
   */
191
  void DoForwardUp (Ptr<Packet> p, const Ipv4Header& header, uint16_t sport,
192
                    Ptr<Ipv4Interface> incomingInterface);
193
  /**
194
   * \brief ForwardIcmp wrapper.
195
   * \param icmpSource source IP address
196
   * \param icmpTtl time-to-live
197
   * \param icmpType ICMP type
198
   * \param icmpCode ICMP code
199
   * \param icmpInfo ICMP info
200
   */
201
  void DoForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl,
202
                      uint8_t icmpType, uint8_t icmpCode,
203
                      uint32_t icmpInfo);
204
205
  /**
206
   * \brief The local address.
185
   * \brief The local address.
207
   */
186
   */
208
  Ipv4Address m_localAddr;
187
  Ipv4Address m_localAddr;
(-)a/src/internet/model/ipv6-end-point.cc (-15 / +2 lines)
 Lines 115-122    Link Here 
115
{
115
{
116
  if (!m_rxCallback.IsNull ())
116
  if (!m_rxCallback.IsNull ())
117
    {
117
    {
118
      Simulator::ScheduleNow (&Ipv6EndPoint::DoForwardUp, this, p, header, port,
118
      m_rxCallback (p, header, port, incomingInterface);
119
                              incomingInterface);
120
    }
119
    }
121
}
120
}
122
121
 Lines 125-146    Link Here 
125
{
124
{
126
  if (!m_icmpCallback.IsNull ())
125
  if (!m_icmpCallback.IsNull ())
127
    {
126
    {
128
      Simulator::ScheduleNow (&Ipv6EndPoint::DoForwardIcmp, this,
127
      m_icmpCallback (src, ttl, type, code, info);
129
                              src, ttl, type, code, info);
130
    }
128
    }
131
}
129
}
132
130
133
void Ipv6EndPoint::DoForwardUp (Ptr<Packet> p, Ipv6Header header, uint16_t sport, Ptr<Ipv6Interface> incomingInterface)
134
{
135
  m_rxCallback (p, header, sport, incomingInterface);
136
}
137
138
void Ipv6EndPoint::DoForwardIcmp (Ipv6Address src, uint8_t ttl, uint8_t type, 
139
                                  uint8_t code, uint32_t info)
140
{
141
  m_icmpCallback (src, ttl, type, code, info);
142
}
143
144
void Ipv6EndPoint::SetRxEnabled (bool enabled)
131
void Ipv6EndPoint::SetRxEnabled (bool enabled)
145
{
132
{
146
  m_rxEnabled = enabled;
133
  m_rxEnabled = enabled;
(-)a/src/internet/model/ipv6-end-point.h (-20 lines)
 Lines 191-216    Link Here 
191
191
192
private:
192
private:
193
  /**
193
  /**
194
   * \brief ForwardUp wrapper.
195
   * \param p packet
196
   * \param header the packet header
197
   * \param sport source port
198
   * \param incomingInterface incoming interface
199
   */
200
  void DoForwardUp (Ptr<Packet> p, Ipv6Header header, uint16_t sport, Ptr<Ipv6Interface> incomingInterface);
201
202
  /**
203
   * \brief ForwardIcmp wrapper.
204
   * \param src source IPv6 address
205
   * \param ttl time-to-live
206
   * \param type ICMPv6 type
207
   * \param code ICMPv6 code
208
   * \param info ICMPv6 info
209
   */
210
  void DoForwardIcmp (Ipv6Address src, uint8_t ttl, uint8_t type,
211
                      uint8_t code, uint32_t info);
212
213
  /**
214
   * \brief The local address.
194
   * \brief The local address.
215
   */
195
   */
216
  Ipv6Address m_localAddr;
196
  Ipv6Address m_localAddr;

Return to bug 2211