Lines Matching refs:name
3 * DNS - host name to IP address resolver.
9 * This file implements a DNS host name to IP address resolver.
25 * 3. The name of the author may not be used to endorse or promote
44 * The lwIP DNS resolver functions are used to lookup a host name and
52 * gethostbyname() then does a dns_lookup() to see if the name is
96 /** DNS maximum number of retries when asking for a name, before "timeout". */
148 /* DNS query record starts with either a domain name or a pointer
149 to a name already present somewhere in the packet. */
158 /* DNS answer record starts with either a domain name or a pointer
159 to a name already present somewhere in the packet. */
176 char name[DNS_MAX_NAME_LENGTH];
187 * external name resolution is performed */
323 LWIP_ASSERT("invalid host name (NULL)", init_entry->name != NULL);
324 namelen = strlen(init_entry->name);
329 entry->name = (char*)entry + sizeof(struct local_hostlist_entry);
330 MEMCPY((char*)entry->name, init_entry->name, namelen);
331 ((char*)entry->name)[namelen] = 0;
353 if(strcmp(entry->name, hostname) == 0) {
361 if(strcmp(local_hostlist_static[i].name, hostname) == 0) {
385 if (((hostname == NULL) || !strcmp(entry->name, hostname)) &&
418 LWIP_ASSERT("invalid host name (NULL)", hostname != NULL);
425 entry->name = (char*)entry + sizeof(struct local_hostlist_entry);
426 MEMCPY((char*)entry->name, hostname, namelen);
427 ((char*)entry->name)[namelen] = 0;
444 * @param name the hostname to look up
450 dns_lookup(const char *name)
457 if ((addr = dns_lookup_local(name)) != IPADDR_NONE) {
462 if((addr = DNS_LOOKUP_LOCAL_EXTERN(name)) != IPADDR_NONE) {
467 /* Walk through name list, return entry if found. If not, return NULL. */
470 (strcmp(name, dns_table[i].name) == 0)) {
471 LWIP_DEBUGF(DNS_DEBUG, ("dns_lookup: \"%s\": found = ", name));
483 * Compare the "dotted" name "query" with the encoded name "response"
501 /* Compressed name */
504 /* Not compressed name */
522 * Walk through a compact encoded DNS name and return the end of the name.
524 * @param query encoded DNS name in the DNS server response
525 * @return end of the name
536 /* Compressed name */
539 /* Not compressed name */
554 * @param name hostname to query
560 dns_send(u8_t numdns, const char* name, u8_t id)
571 (u16_t)(numdns), name));
587 pHostname = name;
653 err = dns_send(pEntry->numdns, pEntry->name, i);
671 LWIP_DEBUGF(DNS_DEBUG, ("dns_check_entry: \"%s\": timeout\n", pEntry->name));
674 (*pEntry->found)(pEntry->name, NULL, pEntry->arg);
686 err = dns_send(pEntry->numdns, pEntry->name, i);
698 LWIP_DEBUGF(DNS_DEBUG, ("dns_check_entry: \"%s\": flush\n", pEntry->name));
763 /* The ID in the DNS header should be our entry into the name table. */
780 LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": error in flags\n", pEntry->name));
786 /* Check if the name in the "question" part match with the name in the entry. */
787 if (dns_compare_name((unsigned char *)(pEntry->name), (unsigned char *)dns_payload + SIZEOF_DNS_HDR) != 0) {
788 LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": response not match to query\n", pEntry->name));
794 /* Skip the name in the "question" part */
798 /* skip answer resource record's host name */
812 LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": response = ", pEntry->name));
817 (*pEntry->found)(pEntry->name, &pEntry->ipaddr, pEntry->arg);
826 LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": error in response\n", pEntry->name));
837 /* ERROR: call specified callback function with NULL as name to indicate an error */
839 (*pEntry->found)(pEntry->name, NULL, pEntry->arg);
854 * @param name the hostname that is to be queried
860 dns_enqueue(const char *name, dns_found_callback found, void *callback_arg)
888 LWIP_DEBUGF(DNS_DEBUG, ("dns_enqueue: \"%s\": DNS entries table is full\n", name));
898 LWIP_DEBUGF(DNS_DEBUG, ("dns_enqueue: \"%s\": use DNS entry %"U16_F"\n", name, (u16_t)(i)));
905 namelen = LWIP_MIN(strlen(name), DNS_MAX_NAME_LENGTH-1);
906 MEMCPY(pEntry->name, name, namelen);
907 pEntry->name[namelen] = 0;
922 * name is already in the local names table.
955 /* host name already in octet notation? set ip addr and return ERR_OK */