67 std::string buffer =
"";
75 if (buffer.length() == 0)
continue;
78 std::string::reverse_iterator iter = buffer.rbegin();
79 if ( (*iter) ==
'\r' ) buffer = buffer.substr(0, buffer.length() - 1);
82 if (cmd.empty())
continue;
109 void ManagementConnection::processCommand(
const std::vector<std::string> &cmd)
117 virtual ~BundleFilter() {};
121 virtual bool shouldAdd(
const dtn::data::MetaBundle&)
const throw (dtn::storage::BundleSelectorException)
128 if (cmd[0] ==
"neighbor")
132 if (cmd[1] ==
"list")
137 for (std::set<dtn::core::Node>::const_iterator iter = nlist.begin(); iter != nlist.end(); ++iter)
139 _stream << (*iter).getEID().getString() << std::endl;
148 else if (cmd[0] ==
"interface")
150 if (cmd[1] ==
"address")
170 else if (cmd[2] ==
"del")
180 }
catch (
const std::bad_cast&) {
189 else if (cmd[0] ==
"connection")
197 if (cmd.size() > 6) {
198 if (cmd[6] ==
"global") {
209 std::string uri =
"ip=" + cmd[4] +
";port=" + cmd[5] +
";";
215 else if (cmd[3] ==
"del")
217 std::string uri =
"ip=" + cmd[4] +
";port=" + cmd[5] +
";";
224 else if (cmd[2] ==
"udp")
228 std::string uri =
"ip=" + cmd[4] +
";port=" + cmd[5] +
";";
234 else if (cmd[3] ==
"del")
236 std::string uri =
"ip=" + cmd[4] +
";port=" + cmd[5] +
";";
243 else if (cmd[2] ==
"file")
252 else if (cmd[3] ==
"del")
261 else if (cmd[0] ==
"logcat")
266 else if (cmd[0] ==
"core")
268 if (cmd[1] ==
"shutdown")
274 else if (cmd[1] ==
"reload")
280 else if (cmd[1] ==
"powersave")
286 else if (cmd[1] ==
"suspend")
292 else if (cmd[1] ==
"wakeup")
298 else if (cmd[1] ==
"internet_off")
304 else if (cmd[1] ==
"internet_on")
311 else if (cmd[0] ==
"bundle")
313 if (cmd[1] ==
"list")
325 for (std::list<dtn::data::MetaBundle>::const_iterator iter = blist.begin(); iter != blist.end(); ++iter)
336 else if (cmd[0] ==
"routing")
340 if ( cmd[1] ==
"prophet" )
348 dtn::routing::BaseRouter::extension_list::const_iterator it;
352 for(it = routingExtensions.begin(); it != routingExtensions.end(); ++it)
358 if ( cmd[2] ==
"info" ){
362 _stream << *dp_map << std::endl;
363 }
else if ( cmd[2] ==
"acknowledgements" ) {
378 }
catch (
const std::bad_cast&) { }
380 if(it == routingExtensions.end())
389 else if (cmd[0] ==
"stats")
393 if ( cmd[1] ==
"info" ) {
399 }
else if ( cmd[1] ==
"timesync" ) {
406 }
else if ( cmd[1] ==
"bundles" ) {
417 }
else if ( cmd[1] ==
"convergencelayers" ) {
421 for (ConnectionManager::stats_list::const_iterator iter = list.begin(); iter != list.end(); ++iter) {
425 for (ConvergenceLayer::stats_map::const_iterator map_it = map.begin(); map_it != map.end(); ++map_it) {
430 }
else if ( cmd[1] ==
"reset" ) {
451 }
catch (
const std::exception&) {