RealtimeCompLab2
Dependencies: mbed
Fork of PPP-Blinky by
Diff: PPP-Blinky/ppp-blinky.h
- Revision:
- 153:7993def8663f
- Parent:
- 152:025c73b6c0a9
- Child:
- 154:18b2bd92f557
--- a/PPP-Blinky/ppp-blinky.h Fri Sep 01 15:25:04 2017 +0000 +++ b/PPP-Blinky/ppp-blinky.h Fri Sep 01 15:44:06 2017 +0000 @@ -6,11 +6,12 @@ void initializePpp(); int connectedPpp(); -void scanForConnectString(); +void waitForPcConnectString(); void waitForPppFrame(); void determinePacketType(); -typedef struct { // ff 03 00 21 +/// structure of a PPP header +typedef struct { // [ff 03 00 21] unsigned int pppAddress : 8, // always 0xff pppControl : 8, // always 03 pppProtocol : 16; // 2100 for IP (byte reversed, should be 0021) @@ -41,6 +42,7 @@ unsigned int dstAdr; // destination IP address } ipHeaderType; +/// structure of TCP header when ip header is 20 bytes long typedef struct { ipHeaderType ip; // first part of TCP header is IP header unsigned int srcAdr : 16, // byte reversed @@ -61,9 +63,10 @@ unsigned int tcpOptions[10]; // 10 words of options possible } tcpHeaderType1; +/// structure of TCP header when ip header is 24 bytes long typedef struct { - ipHeaderType ip; - unsigned int options; + ipHeaderType ip; // first part of TCP header is IP header + unsigned int options; // extra 4 bytes in IP header unsigned int srcAdr : 16, // byte reversed dstAdr : 16; // byte reversed unsigned int seqTcp;