24 #ifndef __NETCOMM_SERVICE_DISCOVERY_SERVICE_H_ 25 #define __NETCOMM_SERVICE_DISCOVERY_SERVICE_H_ 30 #include <sys/types.h> 31 #include <sys/socket.h> 35 class 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);
57 unsigned short int port);
64 const char *name,
const char *type,
65 unsigned short int port);
71 void add_txt(
const char *format, ...);
72 void set_txt(std::list<std::string> &txtlist);
77 const char *
name()
const;
79 const char *
type()
const;
80 const char *
domain()
const;
81 const char *
host()
const;
83 unsigned short int port()
const;
84 const std::list<std::string> &
txt()
const;
91 std::list<std::string> list;
96 unsigned short int _port;
97 struct sockaddr_storage _addr;
99 mutable char * _modified_name;
Fawkes library namespace.
const char * host() const
Get host of service.
std::string addr_string() const
Get IP address of entry as string.
unsigned short int port() const
Get port of service.
void set_name(const char *new_name)
Set name of service.
void add_txt(const char *format,...)
Add a TXT record.
NetworkService(const char *name, const char *type, const char *domain, const char *host, unsigned short int port)
Constructor.
const char * modified_name() const
Get modified name of service.
Representation of a service announced or found via service discovery (i.e.
Network name and address resolver.
void set_txt(std::list< std::string > &txtlist)
Set TXT records all at once.
bool operator<(const NetworkService &s) const
Less than operator.
const std::list< std::string > & txt() const
Get TXT record list of service.
bool operator==(const NetworkService &s) const
Equal operator for NetworkService reference.
const char * domain() const
Get domain of service.
~NetworkService()
Destructor.
const char * type() const
Get type of service.
void set_modified_name(const char *new_name) const
Set modified name of service.
const char * name() const
Get name of service.