From 2a147a610df53ab6d7623cfcb2b1adce24d24a64 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 15 Sep 2013 20:01:00 -0700 Subject: [PATCH] core: Remove legacy parsing of OUI database --- src/oui.c | 68 +------------------------------------------------------ 1 file changed, 1 insertion(+), 67 deletions(-) diff --git a/src/oui.c b/src/oui.c index a1193ac6f..842298627 100644 --- a/src/oui.c +++ b/src/oui.c @@ -66,74 +66,8 @@ done: return comp; } #else -#include -#include -#include -#include -#include -#include -#include -#include - -/* 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 -- 2.47.3