Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

Committer:
andrewboyson
Date:
Sun Jan 24 15:06:33 2021 +0000
Revision:
155:4df4ed4b65a2
Parent:
154:306e328871ee
Modified to allow name resolution testing over IPv6 and IPv4 with DNS, MDNS or LLMNR.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 147:ea6f647725a1 1 #include <string.h>
andrewboyson 147:ea6f647725a1 2
andrewboyson 103:91194cc19bbb 3 #include "http.h"
andrewboyson 147:ea6f647725a1 4 #include "nr.h"
andrewboyson 153:eaee18d970c4 5 #include "nrtest.h"
andrewboyson 155:4df4ed4b65a2 6 #include "eth.h"
andrewboyson 155:4df4ed4b65a2 7 #include "dns.h"
andrewboyson 103:91194cc19bbb 8
andrewboyson 147:ea6f647725a1 9 void WebNetQuery(char* pQuery)
andrewboyson 103:91194cc19bbb 10 {
andrewboyson 103:91194cc19bbb 11 while (pQuery)
andrewboyson 103:91194cc19bbb 12 {
andrewboyson 103:91194cc19bbb 13 char* pName;
andrewboyson 103:91194cc19bbb 14 char* pValue;
andrewboyson 103:91194cc19bbb 15 pQuery = HttpQuerySplit(pQuery, &pName, &pValue);
andrewboyson 155:4df4ed4b65a2 16 HttpQueryUnencode(pValue);
andrewboyson 103:91194cc19bbb 17 int value = HttpQueryValueAsInt(pValue);
andrewboyson 103:91194cc19bbb 18
andrewboyson 147:ea6f647725a1 19 if (HttpSameStr(pName, "name-to-resolve"))
andrewboyson 103:91194cc19bbb 20 {
andrewboyson 147:ea6f647725a1 21 strncpy(NrTest, pValue, NR_NAME_MAX_LENGTH);
andrewboyson 103:91194cc19bbb 22 }
andrewboyson 155:4df4ed4b65a2 23 if (HttpSameStr(pName, "request-ipv6-mdns"))
andrewboyson 103:91194cc19bbb 24 {
andrewboyson 155:4df4ed4b65a2 25 NrTestSendRequest(ETH_IPV6, DNS_PROTOCOL_MDNS);
andrewboyson 103:91194cc19bbb 26 }
andrewboyson 155:4df4ed4b65a2 27 if (HttpSameStr(pName, "request-ipv6-llmnr"))
andrewboyson 155:4df4ed4b65a2 28 {
andrewboyson 155:4df4ed4b65a2 29 NrTestSendRequest(ETH_IPV6, DNS_PROTOCOL_LLMNR);
andrewboyson 155:4df4ed4b65a2 30 }
andrewboyson 155:4df4ed4b65a2 31 if (HttpSameStr(pName, "request-ipv6-udns"))
andrewboyson 147:ea6f647725a1 32 {
andrewboyson 155:4df4ed4b65a2 33 NrTestSendRequest(ETH_IPV6, DNS_PROTOCOL_UDNS);
andrewboyson 155:4df4ed4b65a2 34 }
andrewboyson 155:4df4ed4b65a2 35 if (HttpSameStr(pName, "request-ipv4-mdns"))
andrewboyson 155:4df4ed4b65a2 36 {
andrewboyson 155:4df4ed4b65a2 37 NrTestSendRequest(ETH_IPV4, DNS_PROTOCOL_MDNS);
andrewboyson 147:ea6f647725a1 38 }
andrewboyson 155:4df4ed4b65a2 39 if (HttpSameStr(pName, "request-ipv4-llmnr"))
andrewboyson 153:eaee18d970c4 40 {
andrewboyson 155:4df4ed4b65a2 41 NrTestSendRequest(ETH_IPV4, DNS_PROTOCOL_LLMNR);
andrewboyson 155:4df4ed4b65a2 42 }
andrewboyson 155:4df4ed4b65a2 43 if (HttpSameStr(pName, "request-ipv4-udns"))
andrewboyson 155:4df4ed4b65a2 44 {
andrewboyson 155:4df4ed4b65a2 45 NrTestSendRequest(ETH_IPV4, DNS_PROTOCOL_UDNS);
andrewboyson 153:eaee18d970c4 46 }
andrewboyson 103:91194cc19bbb 47 }
andrewboyson 103:91194cc19bbb 48 }
andrewboyson 103:91194cc19bbb 49