示例#1
0
int avahi_domain_browser_free (AvahiDomainBrowser *b) {
    AvahiClient *client;
    int r = AVAHI_OK;

    assert(b);
    assert(b->ref >= 1);

    if (--(b->ref) >= 1)
        return AVAHI_OK;

    client = b->client;

    if (b->path && avahi_client_is_connected(b->client))
        r = avahi_client_simple_method_call(client, b->path, AVAHI_DBUS_INTERFACE_DOMAIN_BROWSER, "Free");

    AVAHI_LLIST_REMOVE(AvahiDomainBrowser, domain_browsers, client->domain_browsers, b);

    if (b->defer_timeout)
        b->client->poll_api->timeout_free(b->defer_timeout);

    avahi_string_list_free(b->static_browse_domains);
    avahi_free(b->path);
    avahi_free(b);

    return r;
}
int avahi_address_resolver_free(AvahiAddressResolver *r) {
    AvahiClient *client;
    int ret = AVAHI_OK;

    assert(r);
    client = r->client;

    if (r->path && avahi_client_is_connected(client))
        ret = avahi_client_simple_method_call(client, r->path, AVAHI_DBUS_INTERFACE_ADDRESS_RESOLVER, "Free");

    AVAHI_LLIST_REMOVE(AvahiAddressResolver, address_resolvers, client->address_resolvers, r);

    avahi_free(r->path);
    avahi_free(r);

    return ret;
}
示例#3
0
int avahi_record_browser_free (AvahiRecordBrowser *b) {
    AvahiClient *client;
    int r = AVAHI_OK;

    assert(b);
    client = b->client;

    if (b->path && avahi_client_is_connected(b->client))
        r = avahi_client_simple_method_call(client, b->path, AVAHI_DBUS_INTERFACE_RECORD_BROWSER, "Free");

    AVAHI_LLIST_REMOVE(AvahiRecordBrowser, record_browsers, b->client->record_browsers, b);

    avahi_free(b->path);
    avahi_free(b->name);
    avahi_free(b);
    return r;
}
示例#4
0
int avahi_service_type_browser_free (AvahiServiceTypeBrowser *b) {
    AvahiClient *client;
    int r = AVAHI_OK;

    assert(b);
    client = b->client;

    if (b->path && avahi_client_is_connected(b->client))
        r = avahi_client_simple_method_call(client, b->path, AVAHI_DBUS_INTERFACE_SERVICE_TYPE_BROWSER, "Free");

    AVAHI_LLIST_REMOVE(AvahiServiceTypeBrowser, service_type_browsers, b->client->service_type_browsers, b);

    avahi_free(b->path);
    avahi_free(b->domain);
    avahi_free(b);
    return r;
}
int avahi_host_name_resolver_free(AvahiHostNameResolver *r) {
    int ret = AVAHI_OK;
    AvahiClient *client;

    assert(r);
    client = r->client;

    if (r->path && avahi_client_is_connected(client))
        ret = avahi_client_simple_method_call(client, r->path, AVAHI_DBUS_INTERFACE_HOST_NAME_RESOLVER, "Free");

    AVAHI_LLIST_REMOVE(AvahiHostNameResolver, host_name_resolvers, client->host_name_resolvers, r);

    avahi_free(r->path);
    avahi_free(r->host_name);
    avahi_free(r);

    return ret;
}
int avahi_service_resolver_free(AvahiServiceResolver *r) {
    AvahiClient *client;
    int ret = AVAHI_OK;

    assert(r);
    client = r->client;

    if (r->path && avahi_client_is_connected(client))
        ret = avahi_client_simple_method_call(client, r->path, AVAHI_DBUS_INTERFACE_SERVICE_RESOLVER, "Free");

    AVAHI_LLIST_REMOVE(AvahiServiceResolver, service_resolvers, client->service_resolvers, r);

    avahi_free(r->path);
    avahi_free(r->name);
    avahi_free(r->type);
    avahi_free(r->domain);
    avahi_free(r);

    return ret;
}