A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ipv4-flow-probe.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 //
3 // Copyright (c) 2009 INESC Porto
4 //
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
7 // published by the Free Software Foundation;
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 //
18 // Author: Gustavo J. A. M. Carneiro <gjc@inescporto.pt> <gjcarneiro@gmail.com>
19 //
20 
21 #ifndef IPV4_FLOW_PROBE_H
22 #define IPV4_FLOW_PROBE_H
23 
24 #include "ns3/flow-probe.h"
25 #include "ns3/ipv4-flow-classifier.h"
26 #include "ns3/ipv4-l3-protocol.h"
27 
28 namespace ns3 {
29 
30 class FlowMonitor;
31 class Node;
32 
40 class Ipv4FlowProbe : public FlowProbe
41 {
42 
43 public:
49  virtual ~Ipv4FlowProbe ();
50 
53  static TypeId GetTypeId (void);
54 
56  enum DropReason
57  {
60 
63 
66 
72 
78  };
79 
80 protected:
81 
82  virtual void DoDispose (void);
83 
84 private:
89  void SendOutgoingLogger (const Ipv4Header &ipHeader, Ptr<const Packet> ipPayload, uint32_t interface);
94  void ForwardLogger (const Ipv4Header &ipHeader, Ptr<const Packet> ipPayload, uint32_t interface);
99  void ForwardUpLogger (const Ipv4Header &ipHeader, Ptr<const Packet> ipPayload, uint32_t interface);
106  void DropLogger (const Ipv4Header &ipHeader, Ptr<const Packet> ipPayload,
107  Ipv4L3Protocol::DropReason reason, Ptr<Ipv4> ipv4, uint32_t ifIndex);
110  void QueueDropLogger (Ptr<const Packet> ipPayload);
111 
114 };
115 
116 
117 } // namespace ns3
118 
119 #endif /* IPV4_FLOW_PROBE_H */
void ForwardUpLogger(const Ipv4Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
Log a packet being received by the destination.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
virtual void DoDispose(void)
Destructor implementation.
Ipv4FlowProbe(Ptr< FlowMonitor > monitor, Ptr< Ipv4FlowClassifier > classifier, Ptr< Node > node)
Constructor.
Fallback reason (no known reason)
void SendOutgoingLogger(const Ipv4Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
Log a packet being sent.
DropReason
Reason why a packet has been dropped.
void ForwardLogger(const Ipv4Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
Log a packet being forwarded.
Packet header for IPv4.
Definition: ipv4-header.h:31
void QueueDropLogger(Ptr< const Packet > ipPayload)
Log a packet being dropped by a queue.
Packet dropped due to invalid checksum in the IPv4 header.
Ptr< Ipv4FlowClassifier > m_classifier
the Ipv4FlowClassifier this probe is associated with
The FlowProbe class is responsible for listening for packet events in a specific point of the simulat...
Definition: flow-probe.h:39
Packet dropped due to TTL decremented to zero during IPv4 forwarding.
Class that monitors flows at the IPv4 layer of a Node.
Packet dropped due to queue overflow.
Interface is down so can not send packet.
Packet dropped due to missing route to the destination.
static TypeId GetTypeId(void)
Register this type.
DropReason
enumeration of possible reasons why a packet may be dropped
a unique identifier for an interface.
Definition: type-id.h:58
Ptr< Ipv4L3Protocol > m_ipv4
the Ipv4L3Protocol this probe is bound to
void DropLogger(const Ipv4Header &ipHeader, Ptr< const Packet > ipPayload, Ipv4L3Protocol::DropReason reason, Ptr< Ipv4 > ipv4, uint32_t ifIndex)
Log a packet being dropped.