Common stuff for all my devices' web server pages: css, login, log, ipv4, ipv6, firmware update, clock, reset info etc.

Dependents:   oldheating gps motorhome heating

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers web-trace-ajax.c Source File

web-trace-ajax.c

00001 #include  <stdint.h>
00002 
00003 #include       "http.h"
00004 #include        "log.h"
00005 #include        "net.h"
00006 #include       "link.h"
00007 #include        "dns.h"
00008 #include    "dnsname.h"
00009 #include   "dnsquery.h"
00010 #include   "dnsreply.h"
00011 #include  "dnsserver.h"
00012 #include        "ntp.h"
00013 #include       "dhcp.h"
00014 #include         "ns.h"
00015 #include         "nr.h"
00016 #include      "echo4.h"
00017 #include      "echo6.h"
00018 #include      "dest6.h"
00019 #include         "ra.h"
00020 #include         "rs.h"
00021 #include        "ar4.h"
00022 #include        "ar6.h"
00023 #include        "arp.h"
00024 #include        "ip4.h"
00025 #include        "ip6.h"
00026 #include        "udp.h"
00027 #include        "tcp.h"
00028 #include        "web.h"
00029 #include       "tftp.h"
00030 #include  "ntpclient.h"
00031 
00032 void WebTraceAjax()
00033 {
00034     HttpOk("text/plain; charset=UTF-8", "no-cache", NULL, NULL);
00035     char nibble;
00036     
00037     nibble = 0; //0
00038     if ( DnsSendRequestsViaIp4) nibble |= 2;
00039     if ( NtpClientQuerySendRequestsViaIp4) nibble |= 4;
00040     if (TftpSendRequestsViaIp4) nibble |= 8;
00041     HttpAddNibbleAsHex(nibble);
00042     
00043     HttpAddByteAsHex(NetTraceHost[0]);  //1, 2
00044     HttpAddByteAsHex(NetTraceHost[1]);  //3, 4
00045     
00046     nibble = 0; //5
00047     if (NetTraceStack   ) nibble |= 1;
00048     if (NetTraceNewLine ) nibble |= 2;
00049     if (NetTraceVerbose ) nibble |= 4;
00050     if (LinkTrace       ) nibble |= 8;
00051     HttpAddNibbleAsHex(nibble);
00052     
00053     nibble = 0; //6
00054     if (DnsNameTrace    ) nibble |= 1;
00055     if (DnsQueryTrace   ) nibble |= 2;
00056     if (DnsReplyTrace   ) nibble |= 4;
00057     if (DnsServerTrace  ) nibble |= 8;
00058     HttpAddNibbleAsHex(nibble);
00059     
00060     nibble = 0; //7
00061     if (NtpTrace        ) nibble |= 1;
00062     if (DhcpTrace       ) nibble |= 2;
00063     if (NsTraceRecvSol  ) nibble |= 4;
00064     if (NsTraceRecvAdv  ) nibble |= 8;
00065     HttpAddNibbleAsHex(nibble);
00066     
00067     nibble = 0; //8
00068     if (NsTraceSendSol  ) nibble |= 1;
00069     if (Nr4Trace        ) nibble |= 2;
00070     if (NrTrace         ) nibble |= 4;
00071     if (NtpClientTrace  ) nibble |= 8;
00072     HttpAddNibbleAsHex(nibble);
00073     
00074     nibble = 0; //9
00075     if (Echo4Trace      ) nibble |= 4;
00076     if (Echo6Trace      ) nibble |= 8;
00077     HttpAddNibbleAsHex(nibble);
00078     
00079     nibble = 0; //10
00080     if (Dest6Trace      ) nibble |= 1;
00081     if (RaTrace         ) nibble |= 2;
00082     if (RsTrace         ) nibble |= 4;
00083     if (Ar4Trace        ) nibble |= 8;
00084     HttpAddNibbleAsHex(nibble);
00085     
00086     nibble = 0; //11
00087     if (Ar6Trace        ) nibble |= 1;
00088     if (ArpTrace        ) nibble |= 2;
00089     if (Ip4Trace        ) nibble |= 4;
00090     if (Ip6Trace        ) nibble |= 8;
00091     HttpAddNibbleAsHex(nibble);
00092     
00093     nibble = 0; //12
00094     if (UdpTrace        ) nibble |= 1;
00095     if (TcpTrace        ) nibble |= 2;
00096     if (WebTrace        ) nibble |= 4;
00097     if (TftpTrace       ) nibble |= 8;
00098     HttpAddNibbleAsHex(nibble);
00099 }
00100