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
Diff: PPP-Blinky/ppp-blinky.h
- Revision:
- 155:9c6a1d249e26
- Parent:
- 154:18b2bd92f557
- Child:
- 156:163c23249731
diff -r 18b2bd92f557 -r 9c6a1d249e26 PPP-Blinky/ppp-blinky.h --- a/PPP-Blinky/ppp-blinky.h Fri Sep 01 20:23:03 2017 +0000 +++ b/PPP-Blinky/ppp-blinky.h Fri Sep 01 23:04:41 2017 +0000 @@ -39,24 +39,32 @@ /// structure of TCP header typedef struct { - unsigned int srcAdrR : 16; // byte reversed - unsigned int dstAdrR : 16; // byte reversed - unsigned int seqTcpR; // byte reversed - unsigned int ackTcpR; // byte reversed - unsigned int resvd1 : 4; // reserved - unsigned int offset : 4; // tcp header length [5..15] + unsigned int srcAdrR : 16; // byte reversed + unsigned int dstAdrR : 16; // byte reversed + unsigned int seqTcpR; // byte reversed + unsigned int ackTcpR; // byte reversed + // a special union for the flag bits union { - unsigned int flags : 8; // 8 tcp flag bits struct { - unsigned int f:1, // fin - s:1, // syn - r:1, // rst - p:1, // psh - a:1, // ack - u:1; // urg + unsigned int resvd1 : 4; // reserved + unsigned int offset : 4; // tcp header length [5..15] + unsigned int flagFin: 1, // fin + flagSyn : 1, // syn + flagRst : 1, // rst + flagPsh : 1, // psh + flagAck : 1, // ack + flagUrg : 1, // urg + flagEce : 1, // ece + flagCwr : 1; // cwr + unsigned int windowR : 16; // byte reversed }; + struct { + unsigned int : 8; // already dealt with first 8 bits + unsigned int flagsTcp : 8; // second 8 bits are the tcp flags + }; + }; - unsigned int windowR : 16; // byte reversed + // end of a special union for the flag bits unsigned int checksumR : 16; // byte reversed unsigned int urgentPointerR : 16; // byte reversed; unsigned int tcpOptions[10]; // up to 10 words of options possible