[syslinux:lwip] undiif: Unneeded debugging functions.

syslinux-bot for Eric W. Biederman ebiederm at xmission.com
Fri Apr 22 20:06:15 PDT 2011


Commit-ID:  7f17eacd8950f8f69b1c4ae6bc921bf70a05c4bb
Gitweb:     http://syslinux.zytor.com/commit/7f17eacd8950f8f69b1c4ae6bc921bf70a05c4bb
Author:     Eric W. Biederman <ebiederm at xmission.com>
AuthorDate: Tue, 12 Apr 2011 14:31:34 -0700
Committer:  Eric W. Biederman <ebiederm at xmission.com>
CommitDate: Tue, 12 Apr 2011 14:41:24 -0700

undiif: Unneeded debugging functions.

Committing so I have these somewhere in case I need them again.

Signed-off-by: Eric W. Biederman <ebiederm at xmission.com>


---
 core/lwip/src/netif/undiif.c |   55 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/core/lwip/src/netif/undiif.c b/core/lwip/src/netif/undiif.c
index 6da8544..f21eb0b 100644
--- a/core/lwip/src/netif/undiif.c
+++ b/core/lwip/src/netif/undiif.c
@@ -158,6 +158,61 @@ static inline bool undi_is_ethernet(struct netif *netif)
    return MAC_type == ETHER_TYPE;
 }
 
+#if 0
+static void print_pbuf(struct pbuf *p)
+{
+   struct pbuf *q;
+   int off;
+
+   for( off = 0, q = p; q != NULL; q = q->next) {
+       unsigned char *byte, *end;
+       byte = q->payload;
+       end = byte + q->len;
+       for (; byte < end; byte++, off++ ) {
+	   if ((off & 0xf) == 0) {
+	       printf("%04x: ", off);
+	   }
+	   printf("%02x ", *byte);
+	   if ((off & 0xf) == 0xf) {
+	       printf("\n");
+	   }
+       }
+   }
+   printf("\n");
+}
+#endif
+
+#if 0
+static void print_arp_pbuf(struct netif *netif, struct pbuf *p)
+{
+  struct arp_hdr *hdr;
+  u8_t *hdr_ptr;
+  int i;
+
+  hdr = p->payload;
+  hdr_ptr = (unsigned char *)(hdr + 1);
+  /* Fixed fields */
+  printf("arp: %04x %04x %04x %04x ",
+	  hdr->hwtype,
+	  hdr->proto,
+	  hdr->_hwlen_protolen);
+  /* Source hardware address */
+  for(i = 0; i < netif->hwaddr_len; i++, hdr_ptr++) {
+    printf("%02x%c", *hdr_ptr,(i +1) == netif->hwaddr_len?' ':':');
+  }
+  /* Source ip address */
+  printf("%d.%d.%d.%d ", hdr_ptr[0], hdr_ptr[1], hdr_ptr[2], hdr_ptr[3]);
+  hdr_ptr += 4;
+  /* Destination hardware address */
+  for(i = 0; i < netif->hwaddr_len; i++, hdr_ptr++) {
+    printf("%02x%c", *hdr_ptr, (i +1) == netif->hwaddr_len?' ':':');
+  }
+  /* Destination ip address */
+  printf("%d.%d.%d.%d ", hdr_ptr[0], hdr_ptr[1], hdr_ptr[2], hdr_ptr[3]);
+  hdr_ptr += 4;
+}
+#endif
+
 /**
  * In this function, the hardware should be initialized.
  * Called from undiif_init().



More information about the Syslinux-commits mailing list