24 #ifndef _LIBS_GUI_UTILS_SERVICE_MODEL_H_
25 #define _LIBS_GUI_UTILS_SERVICE_MODEL_H_
27 #include <core/utils/lock_queue.h>
28 #include <netcomm/service_discovery/browse_handler.h>
60 Gtk::TreeModelColumn<Glib::ustring>
name;
61 Gtk::TreeModelColumn<Glib::ustring>
type;
62 Gtk::TreeModelColumn<Glib::ustring>
domain;
63 Gtk::TreeModelColumn<Glib::ustring>
65 Gtk::TreeModelColumn<Glib::ustring>
67 Gtk::TreeModelColumn<Glib::ustring>
69 Gtk::TreeModelColumn<unsigned short>
port;
71 Gtk::TreeModelColumn<struct sockaddr_storage>
sockaddr;
80 void browse_failed(
const char *name,
const char *type,
const char *domain);
84 const char * host_name,
85 const char * interface,
86 const struct sockaddr * addr,
87 const socklen_t addr_size,
89 std::list<std::string> &txt,
91 void service_removed(
const char *name,
const char *type,
const char *domain);
128 bool m_own_avahi_thread;
Interface for class that process browse results.
Detects services and manages information about detected services.
Gtk::TreeModelColumn< Glib::ustring > domain
The domain of the service.
Gtk::TreeModelColumn< unsigned short > port
The port the service is running on.
Gtk::TreeModelColumn< Glib::ustring > type
The type of the service.
Gtk::TreeModelColumn< Glib::ustring > addrport
Address:port string.
Gtk::TreeModelColumn< Glib::ustring > name
The name of the service.
Gtk::TreeModelColumn< Glib::ustring > hostname
The name of the host the service is running on.
Gtk::TreeModelColumn< struct sockaddr_storage > sockaddr
sockaddr structure
Gtk::TreeModelColumn< Glib::ustring > ipaddr
The IP address as string of the host the service is running on.
Gtk::TreeModelColumn< Glib::ustring > interface
Name of network interface to reach service.
Abstract base class for widgets that allow to view the detected services of a certain type.
fawkes::AvahiThread * m_avahi
Avahi thread.
ServiceRecord & get_column_record()
Access the column record.
void service_added(const char *name, const char *type, const char *domain, const char *host_name, const char *interface, const struct sockaddr *addr, const socklen_t addr_size, uint16_t port, std::list< std::string > &txt, int flags)
A service has been announced on the network.
void browse_failed(const char *name, const char *type, const char *domain)
Failed to browse for a given service.
fawkes::LockQueue< ServiceAddedRecord > m_added_services
Queue that holds the newly added services.
virtual void on_service_added()
Signal handler for the service-added signal.
virtual void on_service_removed()
Signal handler for the service-removed signal.
fawkes::LockQueue< ServiceRemovedRecord > m_removed_services
Queue that holds the recently removed services.
Glib::Dispatcher m_signal_service_added
This signal is emitted whenever a new service has been added.
void all_for_now()
All results have been retrieved.
ServiceModel(const char *service="_fawkes._tcp")
Constructor.
Glib::RefPtr< Gtk::ListStore > & get_list_store()
Get a reference to the model.
void cache_exhausted()
Cache exhausted.
Glib::RefPtr< Gtk::ListStore > m_service_list
Storage object.
Glib::Dispatcher m_signal_service_removed
This signal is emitted whenever a service is removed.
void service_removed(const char *name, const char *type, const char *domain)
A service has been removed from the network.
ServiceRecord m_service_record
Column record class.
virtual ~ServiceModel()
Destructor.
Fawkes library namespace.
Data structure to hold information about a newly added services.
std::string name
the name of the new service
unsigned short port
the port the new service is running on
struct sockaddr_storage sockaddr
sockaddr structure
std::string hostname
the hostname of the new service
std::string domain
the domain of the new service
std::string interface
name of network interface to reach service
std::string type
the type of the new service
std::string ipaddr
the IP address of the new service
std::string addrport
address:port
Data structure to hold information about a recently removed services.
std::string type
the type of the service
std::string domain
the domain of the service
std::string name
the name of the service