Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
net/http-net-html.c
- Committer:
- andrewboyson
- Date:
- 2019-03-08
- Revision:
- 59:309e78f243dd
- Parent:
- 41:b62b2b46f530
- Child:
- 77:4689596a2f3f
File content as of revision 59:309e78f243dd:
#include "http.h"
#include "http-server.h"
#include "page.h"
#include "net.h"
#include "mac.h"
#include "ip4.h"
#include "ip6.h"
#include "ar4.h"
#include "ar6.h"
#include "nr4.h"
#include "nr6.h"
#include "ndp.h"
#include "ndp.h"
#include "dhcp.h"
#include "slaac.h"
#define WIDTH 16
void HttpNetHtml()
{
HttpOk("text/html; charset=UTF-8", "no-cache", NULL, NULL);
PageAddHeader(PageSite, "Net", "settings.css", NULL);
PageAddNav(NET_PAGE);
PageAddH1(PageSite, "Net");
PageAddH2("Ethernet");
PageAddLabelledMac (WIDTH, "MAC", MacLocal);
PageAddH2("IP4 DHCP");
PageAddLabelledIp4 (WIDTH, "IP4 address", DhcpLocalIp);
PageAddLabelledValue(WIDTH, "Domain", DhcpDomainName);
PageAddLabelledValue(WIDTH, "Host name", DhcpHostName);
PageAddLabelledIp4 (WIDTH, "NTP server", DhcpNtpIp);
PageAddLabelledIp4 (WIDTH, "DNS server", DhcpDnsServerIp);
PageAddLabelledIp4 (WIDTH, "DHCP server", DhcpServerIp);
PageAddLabelledIp4 (WIDTH, "Router", DhcpRouterIp);
PageAddLabelledIp4 (WIDTH, "Subnet mask", DhcpSubnetMask);
PageAddLabelledIp4 (WIDTH, "Broadcast IP", DhcpBroadcastIp);
PageAddLabelledInt (WIDTH, "Lease time IP", DhcpLeaseTime);
PageAddLabelledInt (WIDTH, "Renewal T1", DhcpRenewalT1);
PageAddLabelledInt (WIDTH, "Renewal T2", DhcpRenewalT2);
PageAddLabelledInt (WIDTH, "Elapsed", DhcpGetElapsedLife());
PageAddH2("IP6 NDP");
PageAddLabelledInt (WIDTH, "Hop limit", NdpHopLimit);
PageAddLabelledOnOff(WIDTH, "Managed address", NdpManagedConfiguration);
PageAddLabelledOnOff(WIDTH, "Other configuration", NdpOtherConfiguration);
PageAddLabelledMac (WIDTH, "Router MAC", NdpRouterMac);
PageAddLabelledInt (WIDTH, "Prefix length", NdpPrefixLength);
PageAddLabelledOnOff(WIDTH, "Prefix flag L", NdpPrefixFlagL);
PageAddLabelledOnOff(WIDTH, "Prefix flag A", NdpPrefixFlagA);
PageAddLabelledInt (WIDTH, "Prefix valid secs", NdpPrefixValidLifetime);
PageAddLabelledInt (WIDTH, "Prefix preferred secs", NdpPrefixPreferredLifetime);
PageAddLabelledIp6 (WIDTH, "Prefix", NdpPrefix);
PageAddLabelledInt (WIDTH, "DNS life secs", NdpDnsLifetime);
PageAddLabelledIp6 (WIDTH, "DNS server", NdpDnsServer);
PageAddLabelledInt (WIDTH, "Lease time", NdpGetLease());
PageAddLabelledInt (WIDTH, "Elapsed", NdpGetElapsedLife());
PageAddLabelledIp6 (WIDTH, "SLAAC", SlaacLinkLocalIp);
PageAddLabelledInt (WIDTH, "MTU", NdpMtu);
PageAddH2("ARP 4"); HttpAddText("<code>"); Ar4SendHttp(); HttpAddText("</code>\r\n");
PageAddH2("DNS 4"); HttpAddText("<code>"); Nr4SendHttp(); HttpAddText("</code>\r\n");
PageAddH2("ARP 6"); HttpAddText("<code>"); Ar6SendHttp(); HttpAddText("</code>\r\n");
PageAddH2("DNS 6"); HttpAddText("<code>"); Nr6SendHttp(); HttpAddText("</code>\r\n");
PageAddEnd();
}