Lines Matching refs:service
38 DnssdService *dnssd_service_free(DnssdService *service) { in dnssd_service_free() argument
39 if (!service) in dnssd_service_free()
42 if (service->manager) in dnssd_service_free()
43 hashmap_remove(service->manager->dnssd_services, service->name); in dnssd_service_free()
45 dns_resource_record_unref(service->ptr_rr); in dnssd_service_free()
46 dns_resource_record_unref(service->srv_rr); in dnssd_service_free()
48 dnssd_txtdata_free_all(service->txt_data_items); in dnssd_service_free()
50 free(service->filename); in dnssd_service_free()
51 free(service->name); in dnssd_service_free()
52 free(service->type); in dnssd_service_free()
53 free(service->name_template); in dnssd_service_free()
55 return mfree(service); in dnssd_service_free()
59 _cleanup_(dnssd_service_freep) DnssdService *service = NULL; in dnssd_service_load()
68 service = new0(DnssdService, 1); in dnssd_service_load()
69 if (!service) in dnssd_service_load()
72 service->filename = strdup(filename); in dnssd_service_load()
73 if (!service->filename) in dnssd_service_load()
76 service->name = strdup(basename(filename)); in dnssd_service_load()
77 if (!service->name) in dnssd_service_load()
80 d = endswith(service->name, ".dnssd"); in dnssd_service_load()
88 dropin_dirname = strjoina(service->name, ".dnssd.d"); in dnssd_service_load()
95 service, in dnssd_service_load()
100 if (!service->name_template) in dnssd_service_load()
103 service->name); in dnssd_service_load()
105 if (!service->type) in dnssd_service_load()
108 service->name); in dnssd_service_load()
110 if (LIST_IS_EMPTY(service->txt_data_items)) { in dnssd_service_load()
119 LIST_PREPEND(items, service->txt_data_items, txt_data); in dnssd_service_load()
123 r = hashmap_ensure_put(&manager->dnssd_services, &string_hash_ops, service->name, service); in dnssd_service_load()
127 service->manager = manager; in dnssd_service_load()
129 r = dnssd_update_rrs(service); in dnssd_service_load()
133 TAKE_PTR(service); in dnssd_service_load()