## EpcServiceInfo EpcServiceInfo — DNS-SD service descriptions |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #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);

## Object Hierarchy

      GBoxed
       +----EpcServiceInfo

## Description

The EpcServiceInfo object describes DNS-SD services.

## Details

### EpcServiceInfo

    typedef struct _EpcServiceInfo EpcServiceInfo;

Description of a network service. See also: `epc_service_monitor_new()`.

### epc_service_info_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.

`type` : | the DNS-SD service type
`host` : | the DNS hostname
`port` : | the TCP/IP port
`details` : | list of key-value pairs, or `NULL`
Returns : | The newly created service description, or `NULL` on error.

### epc_service_info_new_full ()

    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.

`type` : | the DNS-SD service type
`host` : | the DNS hostname
`port` : | the TCP/IP port
`details` : | list of key-value pairs, or `NULL`
`address` : | IP address of the service, or `NULL`
`ifname` : | network interface for contacting the service, or `NULL`
Returns : | The newly created service description, or `NULL` on error.

### epc_service_info_ref ()

    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.

### epc_service_info_unref ()

    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

### epc_service_info_get_address ()

    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`.

### epc_service_info_get_address_family ()

    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.

### epc_service_info_get_detail ()

    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`.

### epc_service_info_get_host ()

    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.

### epc_service_info_get_interface ()

    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`.

### epc_service_info_get_port ()

    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.

### epc_service_info_get_service_type ()

    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.