A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.
Dependents: oldheating gps motorhome heating
Diff: resolve/nr4.c
- Revision:
- 128:79052cb4a41c
- Parent:
- 116:60521b29e4c9
- Child:
- 132:db2174b36a6d
--- a/resolve/nr4.c Fri Mar 08 18:43:56 2019 +0000 +++ b/resolve/nr4.c Mon Mar 11 16:42:45 2019 +0000 @@ -7,9 +7,10 @@ #include "net.h" #include "mac.h" #include "ip4addr.h" +#include "dhcp.h" #include "dns.h" -#include "dhcp.h" #include "dnsquery.h" +#include "dnslabel.h" #include "http.h" bool Nr4Trace = false; @@ -55,7 +56,7 @@ for (int i = 0; i < RECORDS_COUNT; i++) { if (records[i].state == STATE_EMPTY) continue; - if (DnsHostNamesEquate(records[i].name, name)) return i; + if (DnsLabelIsSame(records[i].name, name)) return i; } return -1; } @@ -65,7 +66,7 @@ { if (records[i].state == STATE_EMPTY) continue; if (records[i].ip) continue; - if (DnsHostNamesEquate(records[i].name, name)) return i; + if (DnsLabelIsSame(records[i].name, name)) return i; } return -1; } @@ -180,8 +181,8 @@ { if (Nr4Trace) { - if (DnsHostNamesEquate(name, records[i].name)) LogTimeF("NR - confirm existing "); - else LogTimeF("NR - replace name for existing ip "); + if (DnsLabelIsSame(name, records[i].name)) LogTimeF("NR - confirm existing "); + else LogTimeF("NR - replace name for existing ip "); Ip4AddressLog(ip); Log(" == '"); Log(name); @@ -247,7 +248,7 @@ { if (records[i].state == STATE_EMPTY) continue; if (!records[i].ip) continue; - if (!DnsHostNamesEquate(records[i].name, name)) continue; + if (!DnsLabelIsSame(records[i].name, name)) continue; uint32_t age = MsTimerCount - records[i].elapsed; if (age <= newest) { @@ -262,7 +263,7 @@ { if (records[i].state == STATE_EMPTY) continue; if (!records[i].ip) continue; - if (!DnsHostNamesEquate(records[i].name, name)) return true; + if (!DnsLabelIsSame(records[i].name, name)) return true; } return false; }