Loading...
Searching...
No Matches
satellite-packet-trace.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2013 Magister Solutions Ltd.
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: Jani Puttonen <jani.puttonen@magister.fi>
19 */
20
21#ifndef SATELLITE_PACKET_TRACE_H_
22#define SATELLITE_PACKET_TRACE_H_
23
24#include "satellite-enums.h"
25
26#include "ns3/mac48-address.h"
27#include "ns3/nstime.h"
28#include "ns3/object.h"
29#include "ns3/output-stream-wrapper.h"
30
31#include <stdint.h>
32#include <string>
33
34namespace ns3
35{
36
43
44class SatPacketTrace : public Object
45{
46 public:
51
60 virtual void NotifyConstructionCompleted() override;
61
65 virtual ~SatPacketTrace();
66
71 static TypeId GetTypeId(void);
72
76 virtual void DoDispose();
77
90 void AddTraceEntry(Time now,
93 uint32_t nodeId,
94 Mac48Address macAddress,
97 std::string packetInfo);
98
99 private:
103 void PrintHeader();
104
108 std::string m_fileName;
109
113 Ptr<OutputStreamWrapper> m_packetTraceStream;
114};
115
116} // namespace ns3
117
118#endif /* SATELLITE_PACKET_TRACE_H_ */
SatLinkDir_t
Link direction used for packet tracing.
SatNodeType_t
Node type used for packet tracing.
SatPacketEvent_t
Packet event used for packet tracing.
SatLogLevel_t
Log level used for packet tracing.
virtual ~SatPacketTrace()
Destructor.
Ptr< OutputStreamWrapper > m_packetTraceStream
Stream wrapper used for packet traces.
virtual void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
virtual void DoDispose()
Dispose of this class instance.
std::string m_fileName
File name of the packet trace log.
void PrintHeader()
Print header to the packet trace log.
void AddTraceEntry(Time now, SatEnums::SatPacketEvent_t packetEvent, SatEnums::SatNodeType_t nodeType, uint32_t nodeId, Mac48Address macAddress, SatEnums::SatLogLevel_t logLevel, SatEnums::SatLinkDir_t linkDir, std::string packetInfo)
Add a packet trace entry to the log.
static TypeId GetTypeId(void)
Get the type ID.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.