42 ibrcommon::MutexLock l(_mutex);
46 _stream <<
"Event: " << node.getName() << std::endl;
47 _stream <<
"Action: ";
49 switch (node.getAction())
52 _stream <<
"available";
55 _stream <<
"unavailable";
58 _stream <<
"data_added";
61 _stream <<
"data_removed";
70 _stream <<
"EID: " << node.getNode().getEID().getString() << std::endl;
78 ibrcommon::MutexLock l(_mutex);
82 _stream <<
"Event: " << global.getName() << std::endl;
83 _stream <<
"Action: ";
85 switch (global.getAction())
100 _stream <<
"shutdown";
103 _stream <<
"low-energy";
106 _stream <<
"internet available";
109 _stream <<
"internet unavailable";
112 _stream <<
"start discovery";
115 _stream <<
"stop discovery";
120 _stream << std::endl;
123 _stream << std::endl;
128 ibrcommon::MutexLock l(_mutex);
132 _stream <<
"Event: " << received.getName() << std::endl;
133 _stream <<
"Peer: " << received.peer.getString() << std::endl;
134 _stream <<
"Local: " << (received.fromlocal ?
"true" :
"false") << std::endl;
137 _stream <<
"Source: " << received.bundle.source.getString() << std::endl;
138 _stream <<
"Timestamp: " << received.bundle.timestamp.toString() << std::endl;
139 _stream <<
"Sequencenumber: " << received.bundle.sequencenumber.toString() << std::endl;
140 _stream <<
"Lifetime: " << received.bundle.lifetime.toString() << std::endl;
141 _stream <<
"Procflags: " << received.bundle.procflags.toString() << std::endl;
144 _stream <<
"Destination: " << received.bundle.destination.getString() << std::endl;
149 _stream <<
"Appdatalength: " << received.bundle.appdatalength.toString() << std::endl;
150 _stream <<
"Fragmentoffset: " << received.bundle.fragmentoffset.toString() << std::endl;
154 _stream << std::endl;
159 ibrcommon::MutexLock l(_mutex);
162 _stream <<
"Event: " << custody.getName() << std::endl;
163 _stream <<
"Action: ";
165 switch (custody.getAction())
176 _stream << std::endl;
179 _stream <<
"Source: " << custody.getBundle().source.getString() << std::endl;
180 _stream <<
"Timestamp: " << custody.getBundle().timestamp.toString() << std::endl;
181 _stream <<
"Sequencenumber: " << custody.getBundle().sequencenumber.toString() << std::endl;
182 _stream <<
"Lifetime: " << custody.getBundle().lifetime.toString() << std::endl;
183 _stream <<
"Procflags: " << custody.getBundle().procflags.toString() << std::endl;
186 _stream <<
"Destination: " << custody.getBundle().destination.getString() << std::endl;
188 if (custody.getBundle().isFragment())
191 _stream <<
"Appdatalength: " << custody.getBundle().appdatalength.toString() << std::endl;
192 _stream <<
"Fragmentoffset: " << custody.getBundle().fragmentoffset.toString() << std::endl;
196 _stream << std::endl;
201 ibrcommon::MutexLock l(_mutex);
205 _stream <<
"Event: " << aborted.getName() << std::endl;
206 _stream <<
"Peer: " << aborted.getPeer().getString() << std::endl;
209 _stream <<
"Source: " << aborted.getBundleID().source.getString() << std::endl;
210 _stream <<
"Timestamp: " << aborted.getBundleID().timestamp.toString() << std::endl;
211 _stream <<
"Sequencenumber: " << aborted.getBundleID().sequencenumber.toString() << std::endl;
213 if (aborted.getBundleID().isFragment())
216 _stream <<
"Fragmentoffset: " << aborted.getBundleID().fragmentoffset.toString() << std::endl;
217 _stream <<
"Fragmentpayload: " << aborted.getBundleID().getPayloadLength() << std::endl;
221 _stream << std::endl;
226 ibrcommon::MutexLock l(_mutex);
230 _stream <<
"Event: " << completed.getName() << std::endl;
231 _stream <<
"Peer: " << completed.getPeer().getString() << std::endl;
234 _stream <<
"Source: " << completed.getBundle().source.getString() << std::endl;
235 _stream <<
"Timestamp: " << completed.getBundle().timestamp.toString() << std::endl;
236 _stream <<
"Sequencenumber: " << completed.getBundle().sequencenumber.toString() << std::endl;
237 _stream <<
"Lifetime: " << completed.getBundle().lifetime.toString() << std::endl;
238 _stream <<
"Procflags: " << completed.getBundle().procflags.toString() << std::endl;
241 _stream <<
"Destination: " << completed.getBundle().destination.getString() << std::endl;
243 if (completed.getBundle().isFragment())
246 _stream <<
"Appdatalength: " << completed.getBundle().appdatalength.toString() << std::endl;
247 _stream <<
"Fragmentoffset: " << completed.getBundle().fragmentoffset.toString() << std::endl;
251 _stream << std::endl;
256 ibrcommon::MutexLock l(_mutex);
260 _stream <<
"Event: " << connection.getName() << std::endl;
261 _stream <<
"Action: ";
263 switch (connection.getState())
275 _stream <<
"timeout";
280 _stream << std::endl;
283 _stream <<
"Peer: " << connection.getNode().getEID().getString() << std::endl;
286 _stream << std::endl;
291 ibrcommon::MutexLock l(_mutex);
295 _stream <<
"Event: " << queued.getName() << std::endl;
298 _stream <<
"Source: " << queued.bundle.source.getString() << std::endl;
299 _stream <<
"Timestamp: " << queued.bundle.timestamp.toString() << std::endl;
300 _stream <<
"Sequencenumber: " << queued.bundle.sequencenumber.toString() << std::endl;
301 _stream <<
"Lifetime: " << queued.bundle.lifetime.toString() << std::endl;
302 _stream <<
"Procflags: " << queued.bundle.procflags.toString() << std::endl;
305 _stream <<
"Destination: " << queued.bundle.destination.getString() << std::endl;
307 if (queued.bundle.isFragment())
310 _stream <<
"Appdatalength: " << queued.bundle.appdatalength.toString() << std::endl;
311 _stream <<
"Fragmentoffset: " << queued.bundle.fragmentoffset.toString() << std::endl;
315 _stream << std::endl;
331 std::string::reverse_iterator iter = buffer.rbegin();
332 if ( (*iter) ==
'\r' ) buffer = buffer.substr(0, buffer.length() - 1);
335 if (cmd.empty())
continue;
338 if (cmd[0] ==
"exit")
break;
341 ibrcommon::MutexLock l(_mutex);
void raiseEvent(const dtn::core::NodeEvent &evt)
EventConnection(ClientHandler &client, ibrcommon::socketstream &stream)
static void add(EventReceiver< E > *receiver)
static void remove(const EventReceiver< E > *receiver)
virtual ~EventConnection()
ibrcommon::socketstream & _stream
static std::vector< std::string > tokenize(const std::string &token, const std::string &data, const std::string::size_type max=std::string::npos)