linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH wpan-tools 1/4] wpan-ping: hide packet dump behind DEBUG flag
@ 2015-11-30 11:21 Stefan Schmidt
  2015-11-30 11:21 ` [PATCH wpan-tools 2/4] iwpan/wpan-ping: add some missing static attributes Stefan Schmidt
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Stefan Schmidt @ 2015-11-30 11:21 UTC (permalink / raw)
  To: linux-wpan; +Cc: Alexander Aring, Stefan Schmidt

This was disabled by default and we are now hiding it behind a more generic
DEBUG flag and keep it off by default.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 wpan-ping/wpan-ping.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/wpan-ping/wpan-ping.c b/wpan-ping/wpan-ping.c
index b454ddb..08211c3 100644
--- a/wpan-ping/wpan-ping.c
+++ b/wpan-ping/wpan-ping.c
@@ -49,6 +49,8 @@
 /* Set the dispatch header to not 6lowpan for compat */
 #define NOT_A_6LOWPAN_FRAME 0x00
 
+#define DEBUG 0
+
 enum {
 	IEEE802154_ADDR_NONE = 0x0,
 	IEEE802154_ADDR_SHORT = 0x2,
@@ -195,6 +197,7 @@ static int get_interface_info(struct config *conf) {
 	return 0;
 }
 
+#if DEBUG
 static void dump_packet(unsigned char *buf, int len) {
 	int i;
 
@@ -204,6 +207,7 @@ static void dump_packet(unsigned char *buf, int len) {
 	}
 	printf("\n");
 }
+#endif
 
 static int generate_packet(unsigned char *buf, struct config *conf, unsigned int seq_num) {
 	int i;
@@ -347,7 +351,9 @@ static void init_server(struct config *conf, int sd) {
 			perror("recvfrom");
 			continue;
 		}
-		//dump_packet(buf, len);
+#if DEBUG
+		dump_packet(buf, len);
+#endif
 		/* Send same packet back */
 		len = sendto(sd, buf, len, 0, (struct sockaddr *)&src, addrlen);
 		if (len < 0) {
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-12-01 20:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-30 11:21 [PATCH wpan-tools 1/4] wpan-ping: hide packet dump behind DEBUG flag Stefan Schmidt
2015-11-30 11:21 ` [PATCH wpan-tools 2/4] iwpan/wpan-ping: add some missing static attributes Stefan Schmidt
2015-11-30 11:21 ` [PATCH wpan-tools 3/4] wpan-ping: remove unused parameter from init_server() Stefan Schmidt
2015-11-30 11:21 ` [PATCH wpan-tools 4/4] wpan-ping: make sure we do not leak conf during wrong options exit Stefan Schmidt
2015-12-01 20:01 ` [PATCH wpan-tools 1/4] wpan-ping: hide packet dump behind DEBUG flag Stefan Schmidt
2015-12-01 20:19   ` Alexander Aring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).