Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

Committer:
andrewboyson
Date:
Thu Jan 21 13:33:44 2021 +0000
Revision:
153:eaee18d970c4
Parent:
147:ea6f647725a1
Child:
154:306e328871ee
Added button to test resolution of a name from an address.

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 103:91194cc19bbb 6
andrewboyson 147:ea6f647725a1 7 void WebNetQuery(char* pQuery)
andrewboyson 103:91194cc19bbb 8 {
andrewboyson 103:91194cc19bbb 9 while (pQuery)
andrewboyson 103:91194cc19bbb 10 {
andrewboyson 103:91194cc19bbb 11 char* pName;
andrewboyson 103:91194cc19bbb 12 char* pValue;
andrewboyson 103:91194cc19bbb 13 pQuery = HttpQuerySplit(pQuery, &pName, &pValue);
andrewboyson 103:91194cc19bbb 14 int value = HttpQueryValueAsInt(pValue);
andrewboyson 103:91194cc19bbb 15
andrewboyson 147:ea6f647725a1 16 if (HttpSameStr(pName, "name-to-resolve"))
andrewboyson 103:91194cc19bbb 17 {
andrewboyson 147:ea6f647725a1 18 strncpy(NrTest, pValue, NR_NAME_MAX_LENGTH);
andrewboyson 103:91194cc19bbb 19 }
andrewboyson 147:ea6f647725a1 20 if (HttpSameStr(pName, "request-AAAA"))
andrewboyson 103:91194cc19bbb 21 {
andrewboyson 147:ea6f647725a1 22 NrMakeRequestForAddress6FromName(NrTest);
andrewboyson 103:91194cc19bbb 23 }
andrewboyson 147:ea6f647725a1 24 if (HttpSameStr(pName, "request-A"))
andrewboyson 147:ea6f647725a1 25 {
andrewboyson 147:ea6f647725a1 26 NrMakeRequestForAddress4FromName(NrTest);
andrewboyson 147:ea6f647725a1 27 }
andrewboyson 153:eaee18d970c4 28 if (HttpSameStr(pName, "request-PTR"))
andrewboyson 153:eaee18d970c4 29 {
andrewboyson 153:eaee18d970c4 30 NrTestNameFromAddress();
andrewboyson 153:eaee18d970c4 31 }
andrewboyson 103:91194cc19bbb 32 }
andrewboyson 103:91194cc19bbb 33 }
andrewboyson 103:91194cc19bbb 34