satellite-phy-rx-carrier-packet-probe.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Bucknell University
4  * Copyright (c) 2014 Magister Solutions
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors of original work (application-packet-probe.h) which this work
20  * derives from:
21  * - L. Felipe Perrone (perrone@bucknell.edu)
22  * - Tiago G. Rodrigues (tgr002@bucknell.edu)
23  * - Mitch Watrous (watrous@u.washington.edu)
24  *
25  * Modified for the signature of SatPhyRxCarrier trace sources by:
26  * - Budiarto Herman (budiarto.herman@magister.fi)
27  */
28 
29 #ifndef SATELLITE_PHY_RX_CARRIER_PACKET_PROBE_H
30 #define SATELLITE_PHY_RX_CARRIER_PACKET_PROBE_H
31 
32 #include <ns3/address.h>
33 #include <ns3/nstime.h>
34 #include <ns3/probe.h>
35 #include <ns3/traced-callback.h>
36 
37 namespace ns3
38 {
39 
51 class SatPhyRxCarrierPacketProbe : public Probe
52 {
53  public:
58  static TypeId GetTypeId();
59 
64 
69 
77  void SetValue(uint32_t nPackets, const Address& address, bool statusFlag);
78 
87  static void SetValueByPath(std::string path,
88  uint32_t nPackets,
89  const Address& address,
90  bool statusFlag);
91 
99  virtual bool ConnectByObject(std::string traceSource, Ptr<Object> obj);
100 
109  virtual void ConnectByPath(std::string path);
110 
118  typedef void (*RxStatusCallback)(uint32_t nPackets, const Address& from, bool status);
119 
120  private:
130  void TraceSink(uint32_t nPackets, const Address& address, bool statusFlag);
131 
133  TracedCallback<uint32_t, const Address&, bool> m_output;
135  TracedCallback<uint32_t, uint32_t> m_outputUinteger;
137  TracedCallback<bool, bool> m_outputBool;
138 
140  uint32_t m_nPackets;
142  Address m_address;
145 };
146 
147 } // namespace ns3
148 
149 #endif // SATELLITE_PHY_RX_CARRIER_PACKET_PROBE_H
Probe to translate from a TraceSource to two more easily parsed TraceSources.
bool m_statusFlag
The traced packet burst status flag.
uint32_t m_nPackets
The traced number of packets in the packet burst.
TracedCallback< uint32_t, const Address &, bool > m_output
Output trace, the number of packets, source address, and status flag.
virtual void ConnectByPath(std::string path)
connect to a trace source provided by a config path
virtual bool ConnectByObject(std::string traceSource, Ptr< Object > obj)
connect to a trace source attribute provided by a given object
void SetValue(uint32_t nPackets, const Address &address, bool statusFlag)
Set a probe value.
void(* RxStatusCallback)(uint32_t nPackets, const Address &from, bool status)
Common callback signature for trace sources related to packets reception by PHY and its status.
TracedCallback< uint32_t, uint32_t > m_outputUinteger
Output trace, previous and current number of packets.
virtual ~SatPhyRxCarrierPacketProbe()
Destructor for SatPhyRxCarrierPacketProbe.
static void SetValueByPath(std::string path, uint32_t nPackets, const Address &address, bool statusFlag)
Set a probe value by its name in the Config system.
Address m_address
The socket address for the traced packet burst.
void TraceSink(uint32_t nPackets, const Address &address, bool statusFlag)
Method to connect to an underlying ns3::TraceSource with arguments of type double and const Address&.
TracedCallback< bool, bool > m_outputBool
Output trace, previous and current status flag.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.