• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/lwip2/src/core/

Lines Matching refs:entry

146  * like one entry (used/free) */
214 /* DNS table entry states */
222 /** DNS table entry */
244 /** DNS request table entry: used when dns_gehostbyname cannot answer the
410 struct local_hostlist_entry *entry;
419 entry = (struct local_hostlist_entry *)memp_malloc(MEMP_LOCALHOSTLIST);
420 LWIP_ASSERT("mem-error in dns_init_local", entry != NULL);
421 if (entry != NULL) {
422 char* entry_name = (char*)entry + sizeof(struct local_hostlist_entry);
425 entry->name = entry_name;
426 entry->addr = init_entry->addr;
427 entry->next = local_hostlist_dynamic;
428 local_hostlist_dynamic = entry;
438 * @param iterator_fn a function that is called for every entry in the local host-list
447 struct local_hostlist_entry *entry = local_hostlist_dynamic;
449 while (entry != NULL) {
451 iterator_fn(entry->name, &entry->addr, iterator_arg);
454 entry = entry->next;
491 struct local_hostlist_entry *entry = local_hostlist_dynamic;
492 while (entry != NULL) {
493 if ((lwip_stricmp(entry->name, hostname) == 0) &&
494 LWIP_DNS_ADDRTYPE_MATCH_IP(dns_addrtype, entry->addr)) {
496 ip_addr_copy(*addr, entry->addr);
500 entry = entry->next;
532 struct local_hostlist_entry *entry = local_hostlist_dynamic;
534 while (entry != NULL) {
535 if (((hostname == NULL) || !lwip_stricmp(entry->name, hostname)) &&
536 ((addr == NULL) || ip_addr_cmp(&entry->addr, addr))) {
539 last_entry->next = entry->next;
541 local_hostlist_dynamic = entry->next;
543 free_entry = entry;
544 entry = entry->next;
548 last_entry = entry;
549 entry = entry->next;
560 * @param hostname hostname of the new entry
561 * @param addr IP address of the new entry
567 struct local_hostlist_entry *entry;
573 entry = (struct local_hostlist_entry *)memp_malloc(MEMP_LOCALHOSTLIST);
574 if (entry == NULL) {
577 entry_name = (char*)entry + sizeof(struct local_hostlist_entry);
580 entry->name = entry_name;
581 ip_addr_copy(entry->addr, *addr);
582 entry->next = local_hostlist_dynamic;
583 local_hostlist_dynamic = entry;
621 /* Walk through name list, return entry if found. If not, return NULL. */
642 * entry (otherwise, answers might arrive late for hostname not on the list
731 * @param idx the DNS table entry index for which to send a request
745 struct dns_table_entry* entry = &dns_table[idx];
748 (u16_t)(entry->server_idx), entry->name));
749 LWIP_ASSERT("dns server out of array", entry->server_idx < DNS_MAX_SERVERS);
750 if (ip_addr_isany_val(dns_servers[entry->server_idx])
752 && !entry->is_mdns
758 /* flush this entry */
759 entry->state = DNS_STATE_UNUSED;
764 p = pbuf_alloc(PBUF_TRANSPORT, (u16_t)(SIZEOF_DNS_HDR + strlen(entry->name) + 2 +
771 hdr.id = lwip_htons(entry->txid);
775 hostname = entry->name;
795 if (LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype)) {
804 pcb_idx = entry->pcb_idx;
810 entry->txid, entry->name, entry->server_idx));
812 if (entry->is_mdns) {
815 if (LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype))
832 dst = &dns_servers[entry->server_idx];
919 * @param idx dns table index of the entry that is resolved or removed
931 /* check that address type matches the request and adapt the table entry */
946 /* flush this entry */
1002 * dns_check_entry() - see if entry has not yet been queried and, if so, sends out a query.
1003 * Check an entry in the dns_table:
1008 * @param i index of the dns_table entry to check
1014 struct dns_table_entry *entry = &dns_table[i];
1018 switch (entry->state) {
1020 /* initialize new entry */
1021 entry->txid = dns_create_txid();
1022 entry->state = DNS_STATE_ASKING;
1023 entry->server_idx = 0;
1024 entry->tmr = 1;
1025 entry->retries = 0;
1027 /* send DNS packet for this entry */
1035 if (--entry->tmr == 0) {
1036 if (++entry->retries == DNS_MAX_RETRIES) {
1037 if ((entry->server_idx + 1 < DNS_MAX_SERVERS) && !ip_addr_isany_val(dns_servers[entry->server_idx + 1])
1039 && !entry->is_mdns
1043 entry->server_idx++;
1044 entry->tmr = 1;
1045 entry->retries = 0;
1047 LWIP_DEBUGF(DNS_DEBUG, ("dns_check_entry: \"%s\": timeout\n", entry->name));
1050 /* flush this entry */
1051 entry->state = DNS_STATE_UNUSED;
1056 entry->tmr = entry->retries;
1059 /* send DNS packet for this entry */
1069 if ((entry->ttl == 0) || (--entry->ttl == 0)) {
1070 LWIP_DEBUGF(DNS_DEBUG, ("dns_check_entry: \"%s\": flush\n", entry->name));
1071 /* flush this entry, there cannot be any related pending entries in this state */
1072 entry->state = DNS_STATE_UNUSED;
1079 LWIP_ASSERT("unknown dns_table entry state:", 0);
1085 * Call dns_check_entry for each entry in dns_table - check all entries.
1103 struct dns_table_entry *entry = &dns_table[idx];
1105 entry->state = DNS_STATE_DONE;
1107 LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": response = ", entry->name));
1108 ip_addr_debug_print(DNS_DEBUG, (&(entry->ipaddr)));
1112 entry->ttl = ttl;
1113 if (entry->ttl > DNS_MAX_TTL) {
1114 entry->ttl = DNS_MAX_TTL;
1116 dns_call_found(idx, &entry->ipaddr);
1118 if (entry->ttl == 0) {
1122 -> flush this entry now */
1123 /* entry reused during callback? */
1124 if (entry->state == DNS_STATE_DONE) {
1125 entry->state = DNS_STATE_UNUSED;
1159 const struct dns_table_entry *entry = &dns_table[i];
1160 if ((entry->state == DNS_STATE_ASKING) &&
1161 (entry->txid == txid)) {
1170 LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": not a response\n", entry->name));
1174 LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": response not match to query\n", entry->name));
1179 if (!entry->is_mdns)
1184 if (!ip_addr_cmp(addr, &dns_servers[entry->server_idx])) {
1189 /* Check if the name in the "question" part match with the name in the entry and
1191 res_idx = dns_compare_name(entry->name, p, SIZEOF_DNS_HDR);
1193 LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": response not match to query\n", entry->name));
1202 (LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype) && (qry.type != PP_HTONS(DNS_RRTYPE_AAAA))) ||
1203 (!LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype) && (qry.type != PP_HTONS(DNS_RRTYPE_A)))) {
1204 LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": response not match to query\n", entry->name));
1212 LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": error in flags\n", entry->name));
1231 if (!LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype))
1250 if (LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype))
1275 if ((entry->reqaddrtype == LWIP_DNS_ADDRTYPE_IPV4_IPV6) ||
1276 (entry->reqaddrtype == LWIP_DNS_ADDRTYPE_IPV6_IPV4)) {
1277 if (entry->reqaddrtype == LWIP_DNS_ADDRTYPE_IPV4_IPV6) {
1290 LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": error in response\n", entry->name));
1322 struct dns_table_entry *entry = NULL;
1340 /* this is a duplicate entry, find a free request entry */
1356 /* search an unused entry, or the oldest one */
1360 entry = &dns_table[i];
1361 /* is it an unused entry ? */
1362 if (entry->state == DNS_STATE_UNUSED) {
1365 /* check if this is the oldest completed entry */
1366 if (entry->state == DNS_STATE_DONE) {
1367 u8_t age = dns_seqno - entry->seqno;
1375 /* if we don't have found an unused entry, use the oldest completed one */
1378 /* no entry can be used now, table is full */
1384 entry = &dns_table[i];
1389 /* find a free request entry */
1398 /* no request entry can be used now, table is full */
1404 /* in this configuration, the entry index is the same as the request index */
1408 /* use this entry */
1409 LWIP_DEBUGF(DNS_DEBUG, ("dns_enqueue: \"%s\": use DNS entry %"U16_F"\n", name, (u16_t)(i)));
1411 /* fill the entry */
1412 entry->state = DNS_STATE_NEW;
1413 entry->seqno = dns_seqno;
1414 LWIP_DNS_SET_ADDRTYPE(entry->reqaddrtype, dns_addrtype);
1419 MEMCPY(entry->name, name, namelen);
1420 entry->name[namelen] = 0;
1423 entry->pcb_idx = dns_alloc_pcb();
1424 if (entry->pcb_idx >= DNS_MAX_SOURCE_PORTS) {
1427 entry->state = DNS_STATE_UNUSED;
1431 LWIP_DEBUGF(DNS_DEBUG, ("dns_enqueue: \"%s\": use DNS pcb %"U16_F"\n", name, (u16_t)(entry->pcb_idx)));
1435 entry->is_mdns = is_mdns;