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
http-net-html.c@14:c3c43c8faf0e, 2018-12-29 (annotated)
- Committer:
- andrewboyson
- Date:
- Sat Dec 29 19:01:39 2018 +0000
- Revision:
- 14:c3c43c8faf0e
- Child:
- 29:4d649264d6b6
Simplified and tidied. Most things now called HTTP rather than HTML.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| andrewboyson | 14:c3c43c8faf0e | 1 | #include "http.h" |
| andrewboyson | 14:c3c43c8faf0e | 2 | #include "http-base.h" |
| andrewboyson | 14:c3c43c8faf0e | 3 | #include "page.h" |
| andrewboyson | 14:c3c43c8faf0e | 4 | #include "nav.h" |
| andrewboyson | 14:c3c43c8faf0e | 5 | #include "net.h" |
| andrewboyson | 14:c3c43c8faf0e | 6 | #include "mac.h" |
| andrewboyson | 14:c3c43c8faf0e | 7 | #include "ip4.h" |
| andrewboyson | 14:c3c43c8faf0e | 8 | #include "ip6.h" |
| andrewboyson | 14:c3c43c8faf0e | 9 | #include "ar4.h" |
| andrewboyson | 14:c3c43c8faf0e | 10 | #include "ar6.h" |
| andrewboyson | 14:c3c43c8faf0e | 11 | #include "nr4.h" |
| andrewboyson | 14:c3c43c8faf0e | 12 | #include "nr6.h" |
| andrewboyson | 14:c3c43c8faf0e | 13 | #include "ndp.h" |
| andrewboyson | 14:c3c43c8faf0e | 14 | #include "ndp.h" |
| andrewboyson | 14:c3c43c8faf0e | 15 | #include "dhcp.h" |
| andrewboyson | 14:c3c43c8faf0e | 16 | #include "slaac.h" |
| andrewboyson | 14:c3c43c8faf0e | 17 | |
| andrewboyson | 14:c3c43c8faf0e | 18 | #define WIDTH 16 |
| andrewboyson | 14:c3c43c8faf0e | 19 | |
| andrewboyson | 14:c3c43c8faf0e | 20 | void HttpNetHtml() |
| andrewboyson | 14:c3c43c8faf0e | 21 | { |
| andrewboyson | 14:c3c43c8faf0e | 22 | HttpOk("text/html; charset=UTF-8", "no-cache", NULL, NULL); |
| andrewboyson | 14:c3c43c8faf0e | 23 | PageAddHeader(NavSite, "Net", "settings.css", NULL); |
| andrewboyson | 14:c3c43c8faf0e | 24 | NavAdd(NET_PAGE); |
| andrewboyson | 14:c3c43c8faf0e | 25 | PageAddH1(NavSite, "Net"); |
| andrewboyson | 14:c3c43c8faf0e | 26 | |
| andrewboyson | 14:c3c43c8faf0e | 27 | PageAddH2("Ethernet"); |
| andrewboyson | 14:c3c43c8faf0e | 28 | PageAddLabelledMac ("MAC", WIDTH, MacLocal); |
| andrewboyson | 14:c3c43c8faf0e | 29 | |
| andrewboyson | 14:c3c43c8faf0e | 30 | PageAddH2("IP4 DHCP"); |
| andrewboyson | 14:c3c43c8faf0e | 31 | PageAddLabelledIp4 ("IP4 address", WIDTH, DhcpLocalIp); |
| andrewboyson | 14:c3c43c8faf0e | 32 | PageAddLabelledValue("Domain", WIDTH, DhcpDomainName); |
| andrewboyson | 14:c3c43c8faf0e | 33 | PageAddLabelledValue("Host name", WIDTH, DhcpHostName); |
| andrewboyson | 14:c3c43c8faf0e | 34 | PageAddLabelledIp4 ("NTP server", WIDTH, DhcpNtp); |
| andrewboyson | 14:c3c43c8faf0e | 35 | PageAddLabelledIp4 ("DNS server", WIDTH, DhcpDnsServer); |
| andrewboyson | 14:c3c43c8faf0e | 36 | PageAddLabelledIp4 ("DHCP server", WIDTH, DhcpServer); |
| andrewboyson | 14:c3c43c8faf0e | 37 | PageAddLabelledIp4 ("Router", WIDTH, DhcpRouter); |
| andrewboyson | 14:c3c43c8faf0e | 38 | PageAddLabelledIp4 ("Subnet mask", WIDTH, DhcpSubnetMask); |
| andrewboyson | 14:c3c43c8faf0e | 39 | PageAddLabelledIp4 ("Broadcast IP", WIDTH, DhcpBroadcastIp); |
| andrewboyson | 14:c3c43c8faf0e | 40 | PageAddLabelledInt ("Lease time IP", WIDTH, DhcpLeaseTime); |
| andrewboyson | 14:c3c43c8faf0e | 41 | PageAddLabelledInt ("Renewal T1", WIDTH, DhcpRenewalT1); |
| andrewboyson | 14:c3c43c8faf0e | 42 | PageAddLabelledInt ("Renewal T2", WIDTH, DhcpRenewalT2); |
| andrewboyson | 14:c3c43c8faf0e | 43 | PageAddLabelledInt ("Elapsed", WIDTH, DhcpGetElapsedLife()); |
| andrewboyson | 14:c3c43c8faf0e | 44 | |
| andrewboyson | 14:c3c43c8faf0e | 45 | PageAddH2("IP6 NDP"); |
| andrewboyson | 14:c3c43c8faf0e | 46 | PageAddLabelledInt ("Hop limit", WIDTH, NdpHopLimit); |
| andrewboyson | 14:c3c43c8faf0e | 47 | PageAddLabelledOnOff("Managed address", WIDTH, NdpManagedConfiguration); |
| andrewboyson | 14:c3c43c8faf0e | 48 | PageAddLabelledOnOff("Other configuration", WIDTH, NdpOtherConfiguration); |
| andrewboyson | 14:c3c43c8faf0e | 49 | PageAddLabelledMac ("Router MAC", WIDTH, NdpRouterMac); |
| andrewboyson | 14:c3c43c8faf0e | 50 | PageAddLabelledInt ("Prefix length", WIDTH, NdpPrefixLength); |
| andrewboyson | 14:c3c43c8faf0e | 51 | PageAddLabelledOnOff("Prefix flag L", WIDTH, NdpPrefixFlagL); |
| andrewboyson | 14:c3c43c8faf0e | 52 | PageAddLabelledOnOff("Prefix flag A", WIDTH, NdpPrefixFlagA); |
| andrewboyson | 14:c3c43c8faf0e | 53 | PageAddLabelledInt ("Prefix valid secs", WIDTH, NdpPrefixValidLifetime); |
| andrewboyson | 14:c3c43c8faf0e | 54 | PageAddLabelledInt ("Prefix preferred secs", WIDTH, NdpPrefixPreferredLifetime); |
| andrewboyson | 14:c3c43c8faf0e | 55 | PageAddLabelledIp6 ("Prefix", WIDTH, NdpPrefix); |
| andrewboyson | 14:c3c43c8faf0e | 56 | PageAddLabelledInt ("DNS life secs", WIDTH, NdpDnsLifetime); |
| andrewboyson | 14:c3c43c8faf0e | 57 | PageAddLabelledIp6 ("DNS server", WIDTH, NdpDnsServer); |
| andrewboyson | 14:c3c43c8faf0e | 58 | PageAddLabelledInt ("Lease time", WIDTH, NdpLifetime); |
| andrewboyson | 14:c3c43c8faf0e | 59 | PageAddLabelledInt ("Elapsed", WIDTH, NdpGetElapsedLife()); |
| andrewboyson | 14:c3c43c8faf0e | 60 | PageAddLabelledIp6 ("SLAAC", WIDTH, SlaacLinkLocalIp); |
| andrewboyson | 14:c3c43c8faf0e | 61 | PageAddLabelledInt ("MTU", WIDTH, NdpMtu); |
| andrewboyson | 14:c3c43c8faf0e | 62 | |
| andrewboyson | 14:c3c43c8faf0e | 63 | PageAddH2("ARP 4"); HttpAddText("<code>"); Ar4SendHttp(); HttpAddText("</code>\r\n"); |
| andrewboyson | 14:c3c43c8faf0e | 64 | PageAddH2("DNS 4"); HttpAddText("<code>"); Nr4SendHttp(); HttpAddText("</code>\r\n"); |
| andrewboyson | 14:c3c43c8faf0e | 65 | PageAddH2("ARP 6"); HttpAddText("<code>"); Ar6SendHttp(); HttpAddText("</code>\r\n"); |
| andrewboyson | 14:c3c43c8faf0e | 66 | PageAddH2("DNS 6"); HttpAddText("<code>"); Nr6SendHttp(); HttpAddText("</code>\r\n"); |
| andrewboyson | 14:c3c43c8faf0e | 67 | |
| andrewboyson | 14:c3c43c8faf0e | 68 | PageAddEnd(); |
| andrewboyson | 14:c3c43c8faf0e | 69 | |
| andrewboyson | 14:c3c43c8faf0e | 70 | } |