aboutsummaryrefslogtreecommitdiffstats
path: root/gethwaddr.c
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-02-19 23:17:53 +0000
committerJonathan McCrohan <jmccrohan@gmail.com>2012-02-19 23:17:53 +0000
commit33f058f0e67357543c0b1619f4f45779d054a6bf (patch)
treeeebb2cf2edeeb1ed314967c923021804c7f4d3b0 /gethwaddr.c
parent61f929e6b38829afcdc8577be74594ca73a91bde (diff)
downloadverteco-33f058f0e67357543c0b1619f4f45779d054a6bf.tar.gz
Remove debug/testing files.
Diffstat (limited to 'gethwaddr.c')
-rw-r--r--gethwaddr.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/gethwaddr.c b/gethwaddr.c
deleted file mode 100644
index ceac2cd..0000000
--- a/gethwaddr.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <string.h>
-
-int main(int argc, char *argv[]) {
- int s;
- struct ifreq ifr;
-
- s = socket(PF_INET, SOCK_DGRAM, 0);
- memset(&ifr, 0x00, sizeof(ifr));
- strcpy(ifr.ifr_name, "eth0");
- ioctl(s, SIOCGIFHWADDR, &ifr);
- close(s);
-
- unsigned char mac_address[6];
- sprintf(mac_address, "%.2X%.2X%.2X%.2X%.2X%.2X",
- (unsigned char) ifr.ifr_hwaddr.sa_data[0],
- (unsigned char) ifr.ifr_hwaddr.sa_data[1],
- (unsigned char) ifr.ifr_hwaddr.sa_data[2],
- (unsigned char) ifr.ifr_hwaddr.sa_data[3],
- (unsigned char) ifr.ifr_hwaddr.sa_data[4],
- (unsigned char) ifr.ifr_hwaddr.sa_data[5]);
- printf("%s", mac_address);
-
-}