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 // | 2 // |
3 // Copyright (c) 2009 INESC Porto | 3 // Copyright (c) 2009 INESC Porto |
4 // | 4 // |
5 // This program is free software; you can redistribute it and/or modify | 5 // This program is free software; you can redistribute it and/or modify |
6 // it under the terms of the GNU General Public License version 2 as | 6 // it under the terms of the GNU General Public License version 2 as |
7 // published by the Free Software Foundation; | 7 // published by the Free Software Foundation; |
8 // | 8 // |
9 // This program is distributed in the hope that it will be useful, | 9 // This program is distributed in the hope that it will be useful, |
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 void | 252 void |
253 Ipv6FlowProbe::DoDispose () | 253 Ipv6FlowProbe::DoDispose () |
254 { | 254 { |
255 FlowProbe::DoDispose (); | 255 FlowProbe::DoDispose (); |
256 } | 256 } |
257 | 257 |
258 void | 258 void |
259 Ipv6FlowProbe::SendOutgoingLogger (const Ipv6Header &ipHeader, Ptr<const Packet>
ipPayload, uint32_t interface) | 259 Ipv6FlowProbe::SendOutgoingLogger (const Ipv6Header &ipHeader, Ptr<const Packet>
ipPayload, uint32_t interface) |
260 { | 260 { |
| 261 NS_UNUSED (interface); |
261 FlowId flowId; | 262 FlowId flowId; |
262 FlowPacketId packetId; | 263 FlowPacketId packetId; |
263 | 264 |
264 if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) | 265 if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) |
265 { | 266 { |
266 uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); | 267 uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); |
267 NS_LOG_DEBUG ("ReportFirstTx ("<<this<<", "<<flowId<<", "<<packetId<<", "<
<size<<"); " | 268 NS_LOG_DEBUG ("ReportFirstTx ("<<this<<", "<<flowId<<", "<<packetId<<", "<
<size<<"); " |
268 << ipHeader << *ipPayload); | 269 << ipHeader << *ipPayload); |
269 m_flowMonitor->ReportFirstTx (this, flowId, packetId, size); | 270 m_flowMonitor->ReportFirstTx (this, flowId, packetId, size); |
270 | 271 |
271 // tag the packet with the flow id and packet id, so that the packet can b
e identified even | 272 // tag the packet with the flow id and packet id, so that the packet can b
e identified even |
272 // when Ipv6Header is not accessible at some non-IPv6 protocol layer | 273 // when Ipv6Header is not accessible at some non-IPv6 protocol layer |
273 Ipv6FlowProbeTag fTag (flowId, packetId, size); | 274 Ipv6FlowProbeTag fTag (flowId, packetId, size); |
274 ipPayload->AddByteTag (fTag); | 275 ipPayload->AddByteTag (fTag); |
275 } | 276 } |
276 } | 277 } |
277 | 278 |
278 void | 279 void |
279 Ipv6FlowProbe::ForwardLogger (const Ipv6Header &ipHeader, Ptr<const Packet> ipPa
yload, uint32_t interface) | 280 Ipv6FlowProbe::ForwardLogger (const Ipv6Header &ipHeader, Ptr<const Packet> ipPa
yload, uint32_t interface) |
280 { | 281 { |
| 282 NS_UNUSED (interface); |
281 Ipv6FlowProbeTag fTag; | 283 Ipv6FlowProbeTag fTag; |
282 bool found = ipPayload->FindFirstMatchingByteTag (fTag); | 284 bool found = ipPayload->FindFirstMatchingByteTag (fTag); |
283 | 285 |
284 if (found) | 286 if (found) |
285 { | 287 { |
286 FlowId flowId = fTag.GetFlowId (); | 288 FlowId flowId = fTag.GetFlowId (); |
287 FlowPacketId packetId = fTag.GetPacketId (); | 289 FlowPacketId packetId = fTag.GetPacketId (); |
288 | 290 |
289 uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); | 291 uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); |
290 NS_LOG_DEBUG ("ReportForwarding ("<<this<<", "<<flowId<<", "<<packetId<<",
"<<size<<");"); | 292 NS_LOG_DEBUG ("ReportForwarding ("<<this<<", "<<flowId<<", "<<packetId<<",
"<<size<<");"); |
291 m_flowMonitor->ReportForwarding (this, flowId, packetId, size); | 293 m_flowMonitor->ReportForwarding (this, flowId, packetId, size); |
292 } | 294 } |
293 } | 295 } |
294 | 296 |
295 void | 297 void |
296 Ipv6FlowProbe::ForwardUpLogger (const Ipv6Header &ipHeader, Ptr<const Packet> ip
Payload, uint32_t interface) | 298 Ipv6FlowProbe::ForwardUpLogger (const Ipv6Header &ipHeader, Ptr<const Packet> ip
Payload, uint32_t interface) |
297 { | 299 { |
| 300 NS_UNUSED (interface); |
298 Ipv6FlowProbeTag fTag; | 301 Ipv6FlowProbeTag fTag; |
299 bool found = ipPayload->FindFirstMatchingByteTag (fTag); | 302 bool found = ipPayload->FindFirstMatchingByteTag (fTag); |
300 | 303 |
301 if (found) | 304 if (found) |
302 { | 305 { |
303 FlowId flowId = fTag.GetFlowId (); | 306 FlowId flowId = fTag.GetFlowId (); |
304 FlowPacketId packetId = fTag.GetPacketId (); | 307 FlowPacketId packetId = fTag.GetPacketId (); |
305 | 308 |
306 uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); | 309 uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); |
307 NS_LOG_DEBUG ("ReportLastRx ("<<this<<", "<<flowId<<", "<<packetId<<", "<<
size<<");"); | 310 NS_LOG_DEBUG ("ReportLastRx ("<<this<<", "<<flowId<<", "<<packetId<<", "<<
size<<");"); |
308 m_flowMonitor->ReportLastRx (this, flowId, packetId, size); | 311 m_flowMonitor->ReportLastRx (this, flowId, packetId, size); |
309 } | 312 } |
310 } | 313 } |
311 | 314 |
312 void | 315 void |
313 Ipv6FlowProbe::DropLogger (const Ipv6Header &ipHeader, Ptr<const Packet> ipPaylo
ad, | 316 Ipv6FlowProbe::DropLogger (const Ipv6Header &ipHeader, Ptr<const Packet> ipPaylo
ad, |
314 Ipv6L3Protocol::DropReason reason, Ptr<Ipv6> ipv6, ui
nt32_t ifIndex) | 317 Ipv6L3Protocol::DropReason reason, Ptr<Ipv6> ipv6, ui
nt32_t ifIndex) |
315 { | 318 { |
| 319 NS_UNUSED (ifIndex); |
316 #if 0 | 320 #if 0 |
317 switch (reason) | 321 switch (reason) |
318 { | 322 { |
319 case Ipv6L3Protocol::DROP_NO_ROUTE: | 323 case Ipv6L3Protocol::DROP_NO_ROUTE: |
320 break; | 324 break; |
321 | 325 |
322 case Ipv6L3Protocol::DROP_TTL_EXPIRED: | 326 case Ipv6L3Protocol::DROP_TTL_EXPIRED: |
323 case Ipv6L3Protocol::DROP_BAD_CHECKSUM: | 327 case Ipv6L3Protocol::DROP_BAD_CHECKSUM: |
324 Ipv6Address addri = m_ipv6->GetAddress (ifIndex); | 328 Ipv6Address addri = m_ipv6->GetAddress (ifIndex); |
325 Ipv6Mask maski = m_ipv6->GetNetworkMask (ifIndex); | 329 Ipv6Mask maski = m_ipv6->GetNetworkMask (ifIndex); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 432 |
429 NS_LOG_DEBUG ("Drop ("<<this<<", "<<flowId<<", "<<packetId<<", "<<size<<", " <
< DROP_QUEUE_DISC | 433 NS_LOG_DEBUG ("Drop ("<<this<<", "<<flowId<<", "<<packetId<<", "<<size<<", " <
< DROP_QUEUE_DISC |
430 << "); "); | 434 << "); "); |
431 | 435 |
432 m_flowMonitor->ReportDrop (this, flowId, packetId, size, DROP_QUEUE_DISC); | 436 m_flowMonitor->ReportDrop (this, flowId, packetId, size, DROP_QUEUE_DISC); |
433 } | 437 } |
434 | 438 |
435 } // namespace ns3 | 439 } // namespace ns3 |
436 | 440 |
437 | 441 |
OLD | NEW |