summaryrefslogtreecommitdiff
path: root/lookup.h
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.h
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.h')
-rw-r--r--lookup.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lookup.h b/lookup.h
index 50a4d86..57c43d6 100644
--- a/lookup.h
+++ b/lookup.h
@@ -12,6 +12,7 @@ enum lookup_type {
LT_PORTS_UDP,
LT_PORTS_TCP,
LT_ETHERTYPES,
+ LT_OUI,
LT_MAX,
};
@@ -21,5 +22,11 @@ extern void lookup_cleanup(enum lookup_type which);
extern char *lookup_port_udp(unsigned int id);
extern char *lookup_port_tcp(unsigned int id);
extern char *lookup_ether_type(unsigned int id);
+extern char *lookup_vendor(unsigned int id);
+
+static inline const char *lookup_vendor_str(unsigned int id)
+{
+ return lookup_vendor(id) ? : "Unknown";
+}
#endif /* LOOKUP_H */