case TYPE_PTR:
if (!strcmp(name, sdudp))
- service_announce_services(iface, 0, announce_ttl);
- else if (!strcmp(name, sdtcp))
- service_announce_services(iface, 1, announce_ttl);
+ service_announce_services(iface, announce_ttl);
service_reply(iface, name, announce_ttl);
break;
static struct blob_buf b;
static VLIST_TREE(services, avl_strcmp, service_update, false, false);
char *sdudp = "_services._dns-sd._udp.local";
-char *sdtcp = "_services._dns-sd._tcp.local";
static int service_init_announce;
static const char *
}
void
-service_announce_services(struct interface *iface, int tcp, int ttl)
+service_announce_services(struct interface *iface, int ttl)
{
struct service *s;
vlist_for_each_element(&services, s, node) {
- if (!strstr(s->service, "._tcp") && tcp)
- continue;
- if (!strstr(s->service, "._udp") && !tcp)
- continue;
s->t = 0;
if (ttl) {
dns_init_answer();
service_add_ptr(s->service, ttl);
- if (tcp)
- dns_send_answer(iface, sdtcp);
- else
- dns_send_answer(iface, sdudp);
+ dns_send_answer(iface, sdudp);
}
service_reply_single(iface, s, ttl, 0);
}
void
service_announce(struct interface *iface, int ttl)
{
- service_announce_services(iface, 0, ttl);
- service_announce_services(iface, 1, ttl);
+ service_announce_services(iface, ttl);
}
static void
#define _SERVICE_H__
extern char *sdudp;
-extern char *sdtcp;
extern void service_init(int announce);
extern void service_cleanup(void);
extern void service_announce(struct interface *iface, int ttl);
extern void service_reply(struct interface *iface, const char *match, int ttl);
-extern void service_announce_services(struct interface *iface, int tcp, int ttl);
+extern void service_announce_services(struct interface *iface, int ttl);
#endif