DebuggerMessages.h
Go to the documentation of this file.
1 /*
2  * PFPSim: Library for the Programmable Forwarding Plane Simulation Framework
3  *
4  * Copyright (C) 2016 Concordia Univ., Montreal
5  * Samar Abdi
6  * Umair Aftab
7  * Gordon Bailey
8  * Faras Dewal
9  * Shafigh Parsazad
10  * Eric Tremblay
11  *
12  * Copyright (C) 2016 Ericsson
13  * Bochra Boughzala
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28  * 02110-1301, USA.
29  */
30 
39 #ifndef CORE_DEBUGGER_DEBUGGERMESSAGES_H_
40 #define CORE_DEBUGGER_DEBUGGERMESSAGES_H_
41 
42 #include <string>
43 #include <vector>
44 #include <iostream>
45 
46 #include "../proto/PFPSimDebugger.pb.h"
47 #include "Breakpoint.h"
48 #include "Watchpoint.h"
49 #include "CPDebuggerInterface.h"
50 
51 namespace pfp {
52 namespace core {
53 namespace db {
54 
59  public:
64  explicit DebuggerMessage(PFPSimDebugger::DebugMsg_Type type);
65 
70 
76  bool SerializeToString(std::string* output);
77 
82  std::string DebugString();
83 
88  PFPSimDebugger::DebugMsg_Type type();
89 
90  protected:
91  PFPSimDebugger::DebugMsg message;
92 };
93 
98  public:
99  CounterValueMessage(std::string name, int value);
100 };
101 
106  public:
107  AllCounterValuesMessage(std::string *name_list, int *value_list, int num);
108 };
109 
114  public:
115  BreakpointHitMessage(int id, std::string module, int packet_id,
116  double sim_time, bool read);
117 };
118 
123  public:
125  PFPSimDebugger::GenericAcknowledgeMsg_Status status);
126 };
127 
132  public:
133  explicit AllBreakpointValuesMessage(std::vector<Breakpoint> breakpoint_list);
134 };
135 
140  public:
141  explicit WhoAmIReplyMessage(int packet_id);
142 };
143 
148  public:
149  PacketListValuesMessage(int *id_list, std::string *location_list,
150  double *time_list, int num);
151 };
152 
157  public:
158  WatchpointHitMessage(int id, std::string counter_name,
159  int old_value, int new_value);
160 };
161 
166  public:
167  explicit AllWatchpointValuesMessage(std::vector<Watchpoint> watchpoint_list);
168 };
169 
174  public:
175  BacktraceReplyMessage(int id, std::string *module_list,
176  double *read_time_list, double *write_time_list, int num);
177 };
178 
183  public:
185 };
186 
191  public:
192  SimulationStoppedMessage(std::string module, int packet_id,
193  double time_ns, bool read);
194 };
195 
200  public:
201  AllIgnoreModulesMessage(std::string *module_list, int num);
202 };
203 
208  public:
209  explicit SimulationTimeMessage(double sim_time);
210 };
211 
216  public:
217  PacketDroppedMessage(int id, std::string module, std::string reason);
218 };
219 
224  public:
225  DroppedPacketsMessage(int *id_list, std::string *module_list,
226  std::string *reason_list, int num);
227 };
228 
233  public:
235  std::vector<CPDebuggerInterface::TableEntry> table_entries);
236 };
237 
238 }; // namespace db
239 }; // namespace core
240 }; // namespace pfp
241 
242 #endif // CORE_DEBUGGER_DEBUGGERMESSAGES_H_
PFPSimDebugger::DebugMsg_Type type()
Get the type of the message.
Definition: DebuggerMessages.cpp:55
Message which returns the value of all the counters.
Definition: DebuggerMessages.h:105
Message which returns the backtrace of a packet.
Definition: DebuggerMessages.h:173
Defines an interface to be implemented by Control Plane modules for compatibility with the debugger...
Message which returns the list of all the table entries in all of the tables.
Definition: DebuggerMessages.h:232
DebuggerMessage(PFPSimDebugger::DebugMsg_Type type)
Default Constructor.
Definition: DebuggerMessages.cpp:39
Message which indicates that a packet has been dropped.
Definition: DebuggerMessages.h:215
Message which returns the list of all dropped packets.
Definition: DebuggerMessages.h:223
Message which indicates that the simulation has ended.
Definition: DebuggerMessages.h:182
Message which indicates that the simulation has stopped.
Definition: DebuggerMessages.h:190
Message which returns the list of all the packets currently within the simulation.
Definition: DebuggerMessages.h:147
Message which returns the list of all the watchpoints.
Definition: DebuggerMessages.h:165
Message which indicates that a breakpoint has been hit.
Definition: DebuggerMessages.h:113
Defines a class representation of a breakpoint.
Message which returns the value of a counter.
Definition: DebuggerMessages.h:97
Base class for an messages that will be sent to pfpdb via the DebuggerIPCServer.
Definition: DebuggerMessages.h:58
bool SerializeToString(std::string *output)
Serializes the message to a string using protobuf so that it can easily be send via the IPC...
Definition: DebuggerMessages.cpp:47
Message which returns the ID of the packet which is current being followed.
Definition: DebuggerMessages.h:139
Defines a class representation of a watchpoint for the debugger.
PFPSimDebugger::DebugMsg message
Definition: DebuggerMessages.h:91
Message which is sent to indicate that a request was successful or not when the debugger isn't expect...
Definition: DebuggerMessages.h:122
Message which returns the current simulation time.
Definition: DebuggerMessages.h:207
Message which indicates that a watchpoint has been hit.
Definition: DebuggerMessages.h:156
Message which returns the list of all breakpoints.
Definition: DebuggerMessages.h:131
~DebuggerMessage()
Destructor.
Definition: DebuggerMessages.cpp:43
PacketBase.h.
Definition: ConfigurationParameters.cpp:36
std::string DebugString()
Creates a human-readable string representation of the message so that it can be printed in a log...
Definition: DebuggerMessages.cpp:51
Message which returns the list of all the modules that are being ignored.
Definition: DebuggerMessages.h:199