23 #ifndef SRC_HEADERS_AVAHI_DISCOVER_H_ 24 #define SRC_HEADERS_AVAHI_DISCOVER_H_ 27 #include <avahi-gobject/ga-client.h> 28 #include <avahi-gobject/ga-service-browser.h> 29 #include <avahi-gobject/ga-service-resolver.h> 41 Entry(AvahiIfIndex interface_, AvahiProtocol protocol_,
const char *name_,
42 const char *type_,
const char *domain_, AvahiLookupResultFlags flags_)
43 : interface(interface_), protocol(protocol_), name(name_), type(type_),
44 domain(domain_), flags(flags_) {}
46 return interface == e.interface && protocol == e.
protocol && name == e.
name 62 const char *
name,
const char *
type,
const char *
domain, AvahiLookupResultFlags
flags,
void *data);
65 const char *
name,
const char *
type,
const char *
domain, AvahiLookupResultFlags
flags,
void *data);
68 const char *
name,
const char *
type,
const char *
domain,
const char *host_name,
69 const AvahiAddress * a, uint16_t port, AvahiStringList * txt,
70 AvahiLookupResultFlags
flags,
void *data);
71 static void on_failure(GaServiceResolver *resolver, GError *error,
void *data);
78 bool get_address_port(Glib::ustring& address,
int& port, Glib::ustring& name, Glib::ustring& host);
89 Gtk::TreeModelColumn<Glib::ustring>
name;
93 void on_response(
int response_id);
94 void on_row(
const Gtk::TreePath& path, Gtk::TreeViewColumn* column);
95 void on_avahi_changed();
96 void on_selection_changed();
104 #endif // SRC_HEADERS_AVAHI_DISCOVER_H_
bool get_address_port(Glib::ustring &address, int &port, Glib::ustring &name, Glib::ustring &host)
AvahiLookupResultFlags flags
static void cache_exhausted(GaServiceBrowser *browser, void *data)
bool operator==(const Entry &e) const
std::map< Glib::ustring, int > service_names
static void on_found(GaServiceResolver *resolver, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain, const char *host_name, const AvahiAddress *a, uint16_t port, AvahiStringList *txt, AvahiLookupResultFlags flags, void *data)
static void on_failure(GaServiceResolver *resolver, GError *error, void *data)
static void removed_service(GaServiceBrowser *browser, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain, AvahiLookupResultFlags flags, void *data)
bool invoke_resolver(const Glib::ustring &name)
static void new_service(GaServiceBrowser *browser, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain, AvahiLookupResultFlags flags, void *data)
Gtk::TreeModelColumn< Glib::ustring > name
bool get_address_port(Glib::ustring &address, int &port, Glib::ustring &name, Glib::ustring &host)
sigc::signal< void > & signal_changed()
sigc::signal< void > changed
std::list< Entry > services
GaServiceBrowser * browser
GaServiceResolver * resolver
void get_service_names(std::vector< Glib::ustring > &r)
Entry(AvahiIfIndex interface_, AvahiProtocol protocol_, const char *name_, const char *type_, const char *domain_, AvahiLookupResultFlags flags_)