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.
Dependencies: mbed
Fork of webserverBlinky by
Revision 101:0a15de2ca623, committed 2017-07-31
- Comitter:
- nixnax
- Date:
- Mon Jul 31 05:31:01 2017 +0000
- Parent:
- 100:3f3a017684c5
- Child:
- 102:a89c55672170
- Commit message:
- Removed unused lines
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Jul 30 02:22:59 2017 +0000 +++ b/main.cpp Mon Jul 31 05:31:01 2017 +0000 @@ -31,7 +31,6 @@ // See also https://en.wikipedia.org/wiki/Point-to-Point_Protocol_daemon // Ok, enough talking, time to check out some code!! - #include "mbed.h" // The #define below enables/disables a second (OPTIONAL) serial port that prints out interesting diagnostic messages. @@ -169,7 +168,6 @@ return ppp.crc; } - // fill our own receive buffer with characters from the PPP serial port void fillbuf() { @@ -626,11 +624,6 @@ return n; // total byte size of our response } - - - - - void tcpHandler() { // IP header @@ -729,7 +722,6 @@ } // switch // The TCP flag handling is now done - // first we swap sourc and destination TCP addresses and insert the new ack and seq numbers char tempHold[12]; // it's 12 long because we later reuse it when building the TCP pseudo-header @@ -742,7 +734,6 @@ memcpy(dsttcp, tempHold,2); // swap ip port source/dest sendTCP: - acktcp[0]=ack_out>>24; acktcp[1]=ack_out>>16; acktcp[2]=ack_out>>8; @@ -756,7 +747,6 @@ flagbitstcp[1] = flagsOut; // update the TCP flags // increment the ip ident number - ppp.ident++; // get next ident number for our packet ident[0] = ppp.ident>>8; ident[1] = ppp.ident>>0; // insert OUR ident @@ -769,7 +759,6 @@ tcpSize = headerSizeTCP + dataLen; // tcp packet size // the header is all set up, now do the IP and TCP checksums - headercheck[0]=0; // IP header checksum headercheck[1]=0; // IP header checksum headerCheckSum(); // calculate the IP header checksum @@ -786,7 +775,6 @@ memset( pseudoHeader+11, tcpSize, 1); // size of IP data (TCP packet size) // pseudo-header built, now we can calculate TCP checksum - checksumtcp[0]=0; checksumtcp[1]=0; unsigned int pseudoHeaderSum=dataCheckSum((unsigned char *)pseudoHeader,tcpSize+12); // calculate the TCP checksum starting at the pseudo-header @@ -801,10 +789,8 @@ flagsOut = TCP_FLAG_ACK | TCP_FLAG_FIN; // tell them we are also finished goto sendTCP; // send our final packet for this conversation. } - dumpHeaderIP(); dumpHeaderTCP(); - } void dumpDataTCP() @@ -1005,11 +991,10 @@ xx.puts("\x1b[2J\x1b[HReady\n"); // VT100 code for clear screen & home #endif pppInitStruct(); // initialize all the PPP properties - while(1) { scanForConnectString(); // respond to connect command from windows dial up networking while(ppp.online) { wait_for_HDLC_frame(); } } -} +} \ No newline at end of file