Lab2_web / Mbed 2 deprecated webserverBlinky

Dependencies:   mbed

Fork of webserverBlinky by RealTimeCompLab2

Files at this revision

API Documentation at this revision

Comitter:
nixnax
Date:
Sat Sep 02 18:14:26 2017 +0000
Parent:
161:d59f778bc8ab
Child:
163:d1b4328e9f08
Commit message:
swapIPAddresses()

Changed in this revision

PPP-Blinky/ppp-blinky.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/PPP-Blinky/ppp-blinky.cpp	Sat Sep 02 17:58:39 2017 +0000
+++ b/PPP-Blinky/ppp-blinky.cpp	Sat Sep 02 18:14:26 2017 +0000
@@ -155,7 +155,6 @@
 // the standard hdlc frame start/end character. It's the tilde character "~"
 #define FRAME_7E (0x7e)
 
-
 /// a structure to keep all our ppp globals in
 struct pppType {
     pppHeaderType * ppp; // pointer to ppp struct
@@ -522,10 +521,10 @@
 /// swap the IP source and destination addresses
 void swapIpAddresses()
 {
-    char tempHold[4];
-    memcpy(tempHold, ppp.pkt.buf+16,4); // tempHold <- source IP
-    memcpy(ppp.pkt.buf+16, ppp.pkt.buf+20,4); // source <- dest
-    memcpy(ppp.pkt.buf+20, tempHold,4); // dest <- tempHold
+    unsigned int tempHold;
+    tempHold = ppp.ip->srcAdrR; // tempHold <- source IP
+    ppp.ip->srcAdrR = ppp.ip->dstAdrR; // source <- dest
+    ppp.ip->dstAdrR = tempHold; // dest <- tempHold*/
 }
 
 /// swap the IP source and destination ports