summaryrefslogtreecommitdiff
path: root/lookup.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-11-16 08:46:00 +0100
committerTobias Klauser <tklauser@distanz.ch>2015-11-16 08:46:00 +0100
commit04b2adac4e5d460f39454b59ed4f2d3374cb796b (patch)
treecaf1aeb824fcfeba9437dea02741dd9921ad718b /lookup.c
parent7cec7def47bf55762c422508bac1b6e2e142b24e (diff)
lookup: Use lookup module for OUI lookup as well
Do not needlessly duplicate code between the oui and the lookup module. Instead, add an additional lookup table for OUIs to the lookup module. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'lookup.c')
-rw-r--r--lookup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lookup.c b/lookup.c
index 30d6da9..a8dfe20 100644
--- a/lookup.c
+++ b/lookup.c
@@ -21,6 +21,7 @@ static const char * const lookup_files[] = {
[LT_PORTS_UDP] = ETCDIRE_STRING "/udp.conf",
[LT_PORTS_TCP] = ETCDIRE_STRING "/tcp.conf",
[LT_ETHERTYPES] = ETCDIRE_STRING "/ether.conf",
+ [LT_OUI] = ETCDIRE_STRING "/oui.conf",
};
struct lookup_entry {
@@ -150,3 +151,8 @@ char *lookup_port_tcp(unsigned int id)
{
return __do_lookup_inline(id, &lookup_tables[LT_PORTS_TCP]);
}
+
+char *lookup_vendor(unsigned int id)
+{
+ return __do_lookup_inline(id, &lookup_tables[LT_OUI]);
+}