PUD: add uplink dumping
authorFerry Huberts <f.huberts@mindef.nl>
Tue, 2 Aug 2011 10:07:01 +0000 (12:07 +0200)
committerFerry Huberts <f.huberts@mindef.nl>
Tue, 18 Oct 2011 10:08:27 +0000 (12:08 +0200)
Signed-off-by: Ferry Huberts <f.huberts@mindef.nl>
lib/pud/Makefile
lib/pud/src/dump.h
lib/pud/src/receiver.c

index 5f631e7..f46dbcc 100644 (file)
@@ -6,6 +6,7 @@ include $(TOPDIR)/Makefile.inc
 
 #CFLAGS += -DPUD_DUMP_GPS_PACKETS_RX_NON_OLSR
 #CFLAGS += -DPUD_DUMP_GPS_PACKETS_TX_OLSR
+#CFLAGS += -DPUD_DUMP_GPS_PACKETS_TX_UPLINK
 
 #CFLAGS += -DPUD_DUMP_GPS_PACKETS_RX_OLSR
 #CFLAGS += -DPUD_DUMP_GPS_PACKETS_TX_NON_OLSR
index 126959b..002f875 100644 (file)
@@ -4,6 +4,7 @@
 #if defined(PUD_DUMP_GPS_PACKETS_RX_NON_OLSR) || \
        defined(PUD_DUMP_GPS_PACKETS_RX_OLSR) || \
        defined(PUD_DUMP_GPS_PACKETS_TX_OLSR) || \
+       defined(PUD_DUMP_GPS_PACKETS_TX_UPLINK) || \
        defined(PUD_DUMP_GPS_PACKETS_TX_NON_OLSR) || \
        defined(PUD_DUMP_GPS_PACKETS)
 
index 3210db1..705d875 100644 (file)
@@ -28,6 +28,7 @@
 
 /* Debug includes */
 #if defined(PUD_DUMP_GPS_PACKETS_TX_OLSR) || \
+       defined(PUD_DUMP_GPS_PACKETS_TX_UPLINK) || \
        defined(PUD_DUMP_AVERAGING)
 #include "olsr.h"
 #endif
@@ -252,6 +253,15 @@ static void txToAllOlsrInterfaces(TimedTxInterface interfaces) {
                                        pudError(true, "Could not send to uplink"
                                                        " (aligned_size=%u)", aligned_size);
                                }
+#ifdef PUD_DUMP_GPS_PACKETS_TX_UPLINK
+                               else {
+                                       olsr_printf(0, "%s: packet sent to uplink (%d bytes)\n",
+                                                       PUD_PLUGIN_ABBR, aligned_size);
+                                       dump_packet((unsigned char *)&uplinkWireFormat,
+                                                       (sizeof(uplinkWireFormat) -
+                                                        sizeof(uplinkWireFormat.txBuffer)) + aligned_size);
+                               }
+#endif
                        }
                }