24#ifndef _NETCOMM_SERVICE_DISCOVERY_SERVICE_H_
25#define _NETCOMM_SERVICE_DISCOVERY_SERVICE_H_
27#include <sys/socket.h>
35class NetworkNameResolver;
44 unsigned short int port);
50 unsigned short int port,
51 const struct sockaddr * addr,
52 const socklen_t addr_size,
53 std::list<std::string> &
txt);
62 unsigned short int port);
68 void add_txt(
const char *format, ...);
69 void set_txt(std::list<std::string> &txtlist);
74 const char *
name()
const;
76 const char *
type()
const;
77 const char *
domain()
const;
78 const char *
host()
const;
80 unsigned short int port()
const;
81 const std::list<std::string> &
txt()
const;
89 std::list<std::string> list;
94 unsigned short int _port;
95 struct sockaddr_storage _addr;
97 mutable char *_modified_name;
Network name and address resolver.
Representation of a service announced or found via service discovery (i.e.
std::string addr_string() const
Get IP address of entry as string.
~NetworkService()
Destructor.
bool operator==(const NetworkService &s) const
Equal operator for NetworkService reference.
void set_modified_name(const char *new_name) const
Set modified name of service.
const char * modified_name() const
Get modified name of service.
const char * type() const
Get type of service.
void set_txt(std::list< std::string > &txtlist)
Set TXT records all at once.
void add_txt(const char *format,...)
Add a TXT record.
unsigned short int port() const
Get port of service.
NetworkService & operator=(const NetworkService &s)
Assignment operator.
void set_name(const char *new_name)
Set name of service.
NetworkService(const char *name, const char *type, const char *domain, const char *host, unsigned short int port)
Constructor.
const char * name() const
Get name of service.
const char * host() const
Get host of service.
bool operator<(const NetworkService &s) const
Less than operator.
const char * domain() const
Get domain of service.
const std::list< std::string > & txt() const
Get TXT record list of service.
Fawkes library namespace.