Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

Revision:
89:615fb951df69
Parent:
88:2857259fc2b4
--- a/net/http-net6-ajax.c	Wed Apr 10 10:06:14 2019 +0000
+++ b/net/http-net6-ajax.c	Thu Apr 11 09:45:36 2019 +0000
@@ -2,13 +2,38 @@
 
 #include "http.h"
 #include "http-server.h"
+#include "ndp.h"
+#include "slaac.h"
 #include "ar6.h"
 #include "nr6.h"
 
 void HttpNet6Ajax()
 {
     HttpOk("text/plain; charset=UTF-8", "no-cache", NULL, NULL);
+    
+    char nibble;
+    nibble = 0;
+    if (NdpManagedConfiguration) nibble |= 1; //4
+    if (NdpOtherConfiguration  ) nibble |= 2; //4
+    if (NdpPrefixFlagL         ) nibble |= 4; //4
+    if (NdpPrefixFlagA         ) nibble |= 8; //4
+    HttpAddNibbleAsHex(nibble);                                                            HttpAddChar('\n');
+    HttpAddInt32AsHex(NdpHopLimit);                                                        HttpAddChar('\n');
+    for (char* p = NdpRouterMac; p < NdpRouterMac + 6; p++) HttpAddByteAsHex(*p);          HttpAddChar('\n');
+    HttpAddInt32AsHex(NdpPrefixLength);                                                    HttpAddChar('\n');
+    HttpAddInt32AsHex(NdpPrefixValidLifetime);                                             HttpAddChar('\n');
+    HttpAddInt32AsHex(NdpPrefixPreferredLifetime);                                         HttpAddChar('\n');
+    for (char* p = NdpPrefix; p < NdpPrefix + 16; p++) HttpAddByteAsHex(*p);               HttpAddChar('\n');
+    HttpAddInt32AsHex(NdpDnsLifetime);                                                     HttpAddChar('\n');
+    for (char* p = NdpDnsServer; p < NdpDnsServer + 16; p++) HttpAddByteAsHex(*p);         HttpAddChar('\n');
+    HttpAddInt32AsHex(NdpGetLease());                                                      HttpAddChar('\n');
+    HttpAddInt32AsHex(NdpGetElapsedLife());                                                HttpAddChar('\n');
+    for (char* p = SlaacLinkLocalIp; p < SlaacLinkLocalIp + 16; p++) HttpAddByteAsHex(*p); HttpAddChar('\n');
+    HttpAddInt32AsHex(NdpMtu);                                                             HttpAddChar('\n');
+    HttpAddChar('\f');
+    
     Ar6SendAjax();
     HttpAddChar('\f');
+    
     Nr6SendAjax();
 }