27 using namespace dtn::data;
33 DiscoveryService::DiscoveryService()
34 : _service_protocol(dtn::core::Node::CONN_UNDEFINED)
39 : _service_protocol(p), _service_name(asTag(p)), _service_parameters(parameters)
44 : _service_protocol(asProtocol(name)), _service_name(name), _service_parameters(parameters)
82 if (tag ==
"undefined") {
85 else if (tag ==
"udpcl") {
88 else if (tag ==
"tcpcl") {
91 else if (tag ==
"lowpancl") {
94 else if (tag ==
"bt") {
97 else if (tag ==
"http") {
100 else if (tag ==
"file") {
103 else if (tag ==
"dgram:udp") {
106 else if (tag ==
"dgram:eth") {
109 else if (tag ==
"dgram:lowpan") {
112 else if (tag ==
"p2p:wifi") {
115 else if (tag ==
"p2p:bt") {
118 else if (tag ==
"email") {
130 return "unsupported";
160 return "dgram:lowpan";
180 stream << name << parameters;
190 stream >> name >> parameters;
dtn::core::Node::Protocol _service_protocol
std::string _service_name
dtn::core::Node::Protocol getProtocol() const
std::ostream & operator<<(std::ostream &stream, const DiscoveryBeacon &announcement)
dtn::data::Length getLength() const
const std::string & getName() const
void update(const std::string ¶meters)
std::string _service_parameters
const std::string & getParameters() const
virtual ~DiscoveryService()
static std::string asTag(const dtn::core::Node::Protocol proto)
std::istream & operator>>(std::istream &stream, DiscoveryBeacon &announcement)
static dtn::core::Node::Protocol asProtocol(const std::string &tag)