size_t len = dot ? dot - name : 0;
/* Make sure it's query for the instance name we use */
- if (len && len == strlen(mdns_hostname) &&
- !strncmp(name, mdns_hostname, len))
+ if (len && len == strlen(umdns_host_label) &&
+ !strncmp(name, umdns_host_label, len))
service_reply(iface, to, dot + 1, announce_ttl);
}
break;
host = strstr(name, ".local");
if (host)
*host = '\0';
- if (!strcmp(mdns_hostname, name))
+ if (!strcmp(umdns_host_label, name))
dns_reply_a(iface, to, announce_ttl);
break;
};
{
static char buffer[256];
- snprintf(buffer, sizeof(buffer), "%s.%s", mdns_hostname, domain);
+ snprintf(buffer, sizeof(buffer), "%s.%s", umdns_host_label, domain);
return buffer;
}
uint8_t mdns_buf[MDNS_BUF_LEN];
int debug = 0;
-char mdns_hostname[HOSTNAME_LEN];
+char umdns_host_label[HOSTNAME_LEN];
char mdns_hostname_local[HOSTNAME_LEN + 6];
uint32_t
{
struct utsname utsname;
- mdns_hostname[0] = 0;
+ umdns_host_label[0] = 0;
mdns_hostname_local[0] = 0;
if (uname(&utsname) < 0)
return;
- snprintf(mdns_hostname, sizeof(mdns_hostname), "%s", utsname.nodename);
+ snprintf(umdns_host_label, sizeof(umdns_host_label), "%s", utsname.nodename);
snprintf(mdns_hostname_local, sizeof(mdns_hostname_local), "%s.local", utsname.nodename);
}
extern int debug;
extern uint8_t mdns_buf[MDNS_BUF_LEN];
-extern char mdns_hostname[HOSTNAME_LEN];
+
+/**
+ * The first label of a host's fully qualified domain name
+ *
+ * E.g. just "example" for the domain name example.local.
+ */
+extern char umdns_host_label[HOSTNAME_LEN];
+
extern char mdns_hostname_local[HOSTNAME_LEN + 6];
extern void get_hostname(void);