Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

Revision:
147:ea6f647725a1
Parent:
131:a9793a9721c7
Child:
153:eaee18d970c4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/base/net/web-net-query.c	Sun Jan 10 11:53:12 2021 +0000
@@ -0,0 +1,29 @@
+#include <string.h>
+
+#include "http.h"
+#include "nr.h"
+
+void WebNetQuery(char* pQuery)
+{
+    while (pQuery)
+    {
+        char* pName;
+        char* pValue;
+        pQuery = HttpQuerySplit(pQuery, &pName, &pValue);
+        int value = HttpQueryValueAsInt(pValue);
+        
+        if (HttpSameStr(pName, "name-to-resolve"))
+        {
+            strncpy(NrTest, pValue, NR_NAME_MAX_LENGTH);
+        }
+        if (HttpSameStr(pName, "request-AAAA"))
+        {
+            NrMakeRequestForAddress6FromName(NrTest);
+        }
+        if (HttpSameStr(pName, "request-A"))
+        {
+            NrMakeRequestForAddress4FromName(NrTest);
+        }
+    }
+}
+