aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/lib/print_addrs.c
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-12-14 13:13:25 -0800
committerJosh Blum <josh@joshknows.com>2010-12-14 13:13:25 -0800
commit546e877ea461404550f01a1066242c2f2610ad9d (patch)
tree839e6f3904342af8f6f35e71fd8b8604409e4dbc /firmware/microblaze/lib/print_addrs.c
parent3ed60b62eaf2d907ec7797f61ca60420bfd2ee5b (diff)
parent4d9b9ae7e9fe36bf7c1e2e60a37845e9cc4ecee3 (diff)
downloaduhd-546e877ea461404550f01a1066242c2f2610ad9d.tar.gz
uhd-546e877ea461404550f01a1066242c2f2610ad9d.tar.bz2
uhd-546e877ea461404550f01a1066242c2f2610ad9d.zip
Merge branch 'packet_router' into next
Diffstat (limited to 'firmware/microblaze/lib/print_addrs.c')
-rw-r--r--firmware/microblaze/lib/print_addrs.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/firmware/microblaze/lib/print_addrs.c b/firmware/microblaze/lib/print_addrs.c
new file mode 100644
index 000000000..29601c47c
--- /dev/null
+++ b/firmware/microblaze/lib/print_addrs.c
@@ -0,0 +1,32 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#include "nonstdio.h"
+
+void
+print_mac_addr(const unsigned char addr[6])
+{
+ for(size_t i = 0; i < 6; i++){
+ if(i) putchar(':');
+ puthex8(addr[i]);
+ }
+}
+
+void print_ip_addr(const void *t){
+ uint8_t *p = (uint8_t *)t;
+ printf("%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
+}