RealtimeCompLab2

Dependencies:   mbed

Fork of PPP-Blinky by Nicolas Nackel

Revision:
64:677b9713a120
Parent:
63:9253b0e1b7d8
Child:
65:23b17c43aa0f
--- a/main.cpp	Sun Jun 04 20:47:53 2017 +0000
+++ b/main.cpp	Sun Jun 04 21:16:50 2017 +0000
@@ -219,16 +219,16 @@
 
 void ipRequestHandler()
 {
-    debug(("IPCP Conf "));
+    debug("IPCP Conf ");
     if ( ppp.pkt.buf[7] != 4 ) {
-        debug(("Rej\n")); // reject if any options are requested
+        debug("Rej\n"); // reject if any options are requested
         ppp.pkt.buf[4]=4;
         sendFrame();
     } else  {
-        debug(("Ack\n"));
+        debug("Ack\n");
         ppp.pkt.buf[4]=2; // ack the minimum
         sendFrame(); // acknowledge
-        debug(("IPCP Ask\n"));
+        debug("IPCP Ask\n");
         // send our own request now
         ppp.pkt.buf[4]=1; // request no options
         ppp.pkt.buf[5]++; // next sequence
@@ -238,17 +238,17 @@
 
 void ipAckHandler()
 {
-    debug(("IPCP Grant\n"));
+    debug("IPCP Grant\n");
 }
 
 void ipNackHandler()
 {
-    debug(("IPCP Nack\n"));
+    debug("IPCP Nack\n");
 }
 
 void ipDefaultHandler()
 {
-    debug(("IPCP Other\n"));
+    debug("IPCP Other\n");
 }
 
 void IPCPframe()
@@ -299,10 +299,10 @@
             if (ch>31 && ch<127) {
                 debug("%c", ch);
             } else {
-                debug(("_"));
+                debug("_");
             }
         }
-        debug(("\n"));
+        debug("\n");
     }
 }
 
@@ -397,10 +397,10 @@
                 if (ch>31 && ch<127) {
                     debug("%c",ch);
                 } else {
-                    debug(("_"));
+                    debug("_");
                 }
             }
-            debug(("\n"));
+            debug("\n");
         }
         sendFrame(); // reply to the ping
 
@@ -659,7 +659,7 @@
     headercheck[1]=0; // IP header checksum
     headerCheckSum(); // calculate the IP header checksum
 
-    // now we have to build a 12-byte TCP "pseudo-header" in front of the TCP header (containing some IP header values) in order to correctly calculate the TCP checksum
+    // now we have to build the so-called 12-byte TCP "pseudo-header" in front of the TCP header (containing some IP header values) in order to correctly calculate the TCP checksum
     // this header  contains the most important parts of the IP header, i.e. source and destination address, protocol number and data length.
 
     char * pseudoHeader = s-12; // mark the start of the TCP pseudo-header
@@ -750,7 +750,7 @@
 
 void otherProtocol()
 {
-    debug(("Other IP protocol"));
+    debug("Other IP protocol");
 }
 
 void IPframe()
@@ -776,16 +776,16 @@
 
 void LCPconfReq()
 {
-    debug(("LCP Config "));
+    debug("LCP Config ");
     if (ppp.pkt.buf[7] != 4) {
         ppp.pkt.buf[4]=4; // allow only no options
-        debug(("Reject\n"));
+        debug("Reject\n");
         sendFrame();
     } else {
         ppp.pkt.buf[4]=2; // ack zero conf
-        debug(("Ack\n"));
+        debug("Ack\n");
         sendFrame();
-        debug(("LCP Ask\n"));
+        debug("LCP Ask\n");
         ppp.pkt.buf[4]=1; // request no options
         sendFrame();
     }
@@ -793,12 +793,12 @@
 
 void LCPconfAck()
 {
-    debug(("LCP Ack\n"));
+    debug("LCP Ack\n");
 }
 
 void LCPend()
 {
-    debug(("LCP End\n"));
+    debug("LCP End\n");
     ppp.online=0; // start hunting for connect string again
     ppp.pkt.buf[4]=6;
     sendFrame(); // acknowledge
@@ -806,7 +806,7 @@
 
 void LCPother()
 {
-    debug(("LCP Other\n"));
+    debug("LCP Other\n");
     dumpFrame();
 }
 
@@ -838,15 +838,15 @@
 void determinePacketType()
 {
     if ( ppp.pkt.buf[0] != 0xff ) {
-        debug(("byte0 != ff\n"));
+        debug("byte0 != ff\n");
         return;
     }
     if ( ppp.pkt.buf[1] != 3    ) {
-        debug(("byte1 !=  3\n"));
+        debug("byte1 !=  3\n");
         return;
     }
     if ( ppp.pkt.buf[3] != 0x21 ) {
-        debug(("byte2 != 21\n"));
+        debug("byte2 != 21\n");
         return;
     }
     int packetType = ppp.pkt.buf[2];
@@ -896,7 +896,7 @@
             strcpy( clientFound, "FOUND!FOUND!" ); // overwrite so we don't find it again
             pc.printf("CLIENTSERVER"); // respond to PC
             ppp.online=1; // we can stop looking for the string
-            debug(("Connect string found\n"));
+            debug("Connect string found\n");
         }
     }
 }