41 :
_client(client), _stream(stream)
49 : _srv(srv), _registration(®istration), _stream(conn), _endpoint(dtn::core::
BundleCore::local), _handler(NULL)
60 return *_registration;
70 _registration->
abort();
88 while (_stream->good())
104 getline(*_stream, buffer);
107 std::string::reverse_iterator iter = buffer.rbegin();
108 if ( (*iter) ==
'\r' ) buffer = buffer.substr(0, buffer.length() - 1);
111 if (cmd.empty())
continue;
114 if (cmd[0] ==
"protocol")
116 if (cmd[1] ==
"tcpcl")
122 else if (cmd[1] ==
"management")
128 else if (cmd[1] ==
"event")
134 else if (cmd[1] ==
"extended")
140 else if (cmd[1] ==
"streaming")
146 else if (cmd[1] ==
"p2p_extension")
148 if (cmd.size() < 3) {
153 if (cmd[2] ==
"wifi") {
157 }
else if (cmd[2] ==
"bt") {
176 }
catch (
const std::exception&) {
182 void ClientHandler::error(STATUS_CODES code,
const std::string &msg)
185 (*_stream) << code <<
" " << msg << std::endl;
201 _registration->
abort();
208 void ClientHandler::processCommand(
const std::vector<std::string> &cmd)
216 virtual ~BundleFilter() {};
220 virtual bool shouldAdd(
const dtn::data::MetaBundle&)
const throw (dtn::storage::BundleSelectorException)
231 if (cmd[1] ==
"endpoint")
256 else if (cmd[0] ==
"registration")
278 else if (cmd[1] ==
"del")
296 else if (cmd[1] ==
"list")
301 (*_stream) <<
API_STATUS_OK <<
" REGISTRATION LIST" << std::endl;
302 for (std::set<dtn::data::EID>::const_iterator iter = list.begin(); iter != list.end(); ++iter)
304 (*_stream) << (*iter).getString() << std::endl;
306 (*_stream) << std::endl;
319 }
catch (
const std::exception&) {