![]() |
![]() |
![]() |
Easy Publish and Consume Reference Manual | ![]() |
---|---|---|---|---|
#include <libepc/service-info.h> EpcServiceInfo; EpcServiceInfo* epc_service_info_new (const gchar *type, const gchar *host, guint port, const AvahiStringList *details); EpcServiceInfo* epc_service_info_new_full (const gchar *type, const gchar *host, guint port, const AvahiStringList *details, const AvahiAddress *address, const gchar *ifname); EpcServiceInfo* epc_service_info_ref (EpcServiceInfo *info); void epc_service_info_unref (EpcServiceInfo *info); const AvahiAddress* epc_service_info_get_address (const EpcServiceInfo *info); EpcAddressFamily epc_service_info_get_address_family (const EpcServiceInfo *info); const gchar* epc_service_info_get_detail (const EpcServiceInfo *info, const gchar *name); const gchar* epc_service_info_get_host (const EpcServiceInfo *info); const gchar* epc_service_info_get_interface (const EpcServiceInfo *info); guint epc_service_info_get_port (const EpcServiceInfo *info); const gchar* epc_service_info_get_service_type (const EpcServiceInfo *info);
typedef struct _EpcServiceInfo EpcServiceInfo;
Description of a network service.
See also: epc_service_monitor_new()
.
EpcServiceInfo* epc_service_info_new (const gchar *type, const gchar *host, guint port, const AvahiStringList *details);
Creates a new service description using the information provided. The
details
list usually is retrieved from the TXT record the dynamic naming
system (DNS) provides for the service. When using Avahi's service chooser
aui_service_dialog_get_txt_data()
can be used for getting a details
list.
To create an ad-hoc list use avahi_string_list_new()
and related functions.
EpcServiceInfo* epc_service_info_new_full (const gchar *type, const gchar *host, guint port, const AvahiStringList *details, const AvahiAddress *address, const gchar *ifname);
Creates a new service description using the information provided. The
details
list usually is retrieved from the TXT record the dynamic naming
system (DNS) provides for the service. When using Avahi's service chooser
aui_service_dialog_get_txt_data()
can be used for getting a details
list.
To create an ad-hoc list use avahi_string_list_new()
and related functions.
EpcServiceInfo* epc_service_info_ref (EpcServiceInfo *info);
Increases the reference count of info
by one.
See also: epc_service_info_unref()
info : |
a EpcServiceInfo |
Returns : | The same info object.
|
void epc_service_info_unref (EpcServiceInfo *info);
Decreases the reference count of info
by one. When its reference count
drops to 0, the object is finalized (i.e. its memory is freed).
See also: epc_service_info_ref()
info : |
a EpcServiceInfo |
const AvahiAddress* epc_service_info_get_address (const EpcServiceInfo *info);
Retrieves the IP address for contacting the service,
or NULL
when that information is not available.
info : |
a EpcServiceInfo |
Returns : | A IP address, or NULL .
|
EpcAddressFamily epc_service_info_get_address_family (const EpcServiceInfo *info);
Retrieves the address family for contacting the service, or EPC_ADDRESS_UNSPEC when that information is not available.
info : |
a EpcServiceInfo |
Returns : | A EpcAddressFamily. |
const gchar* epc_service_info_get_detail (const EpcServiceInfo *info, const gchar *name);
Retrieves a detail stored in the service's TXT record.
Returns NULL
when the requested information is not available.
info : |
a EpcServiceInfo |
name : |
the detail's name |
Returns : | The requested service detail, or NULL .
|
const gchar* epc_service_info_get_host (const EpcServiceInfo *info);
Retrieves the DNS host name associated with info
.
info : |
a EpcServiceInfo |
Returns : | A DNS host name. |
const gchar* epc_service_info_get_interface (const EpcServiceInfo *info);
Retrieves the name of the network interface which must be used for
contacting the service, or NULL
when that information is not available.
info : |
a EpcServiceInfo |
Returns : | A network interface name, or NULL .
|
guint epc_service_info_get_port (const EpcServiceInfo *info);
Retrieves the TCP/IP port associated with info
.
info : |
a EpcServiceInfo |
Returns : | A TCP/IP port. |
const gchar* epc_service_info_get_service_type (const EpcServiceInfo *info);
Retrieves the DNS-SD service type associated with info
.
info : |
a EpcServiceInfo |
Returns : | A DNS-SD service type. |