Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

base/net/web-net-query.c

Committer:
andrewboyson
Date:
2021-01-21
Revision:
153:eaee18d970c4
Parent:
147:ea6f647725a1
Child:
154:306e328871ee

File content as of revision 153:eaee18d970c4:

#include <string.h>

#include "http.h"
#include "nr.h"
#include "nrtest.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);
        }
        if (HttpSameStr(pName, "request-PTR"))
        {
            NrTestNameFromAddress();
        }
    }
}