Diff between 55afc94e94948597b63c2d2f95b6978e73735612 and 2a147a610df53ab6d7623cfcb2b1adce24d24a64

Changed Files

File Additions Deletions Status
src/oui.c +1 -67 modified

Full Patch

diff --git a/src/oui.c b/src/oui.c
index a1193ac..8422986 100644
--- a/src/oui.c
+++ b/src/oui.c
@@ -66,74 +66,8 @@ done:
 	return comp;
 }
 #else
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-
-/* http://standards.ieee.org/regauth/oui/oui.txt */
-
-#ifndef OUIFILE
-#define OUIFILE "/usr/share/hwdata/oui.txt"
-#endif
-
-static char *ouitocomp(const char *oui)
-{
-	struct stat st;
-	char *str, *map, *off, *end;
-	int fd;
-
-	fd = open(OUIFILE, O_RDONLY);
-	if (fd < 0)
-		return NULL;
-
-	if (fstat(fd, &st) < 0) {
-		close(fd);
-		return NULL;
-	}
-
-	str = malloc(128);
-	if (!str) {
-		close(fd);
-		return NULL;
-	}
-
-	memset(str, 0, 128);
-
-	map = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
-	if (!map || map == MAP_FAILED) {
-		free(str);
-		close(fd);
-		return NULL;
-	}
-
-	off = strstr(map, oui);
-	if (off) {
-		off += 18;
-		end = strpbrk(off, "\r\n");
-		strncpy(str, off, end - off);
-	} else {
-		free(str);
-		str = NULL;
-	}
-
-	munmap(map, st.st_size);
-
-	close(fd);
-
-	return str;
-}
-
 char *batocomp(const bdaddr_t *ba)
 {
-	char oui[9];
-
-	sprintf(oui, "%2.2X-%2.2X-%2.2X", ba->b[5], ba->b[4], ba->b[3]);
-
-	return ouitocomp(oui);
+	return NULL;
 }
 #endif