PcapPlusPlus  Next
OUILookup.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "MacAddress.h"
4 
5 #include <unordered_map>
6 #include <vector>
7 
9 
12 namespace pcpp
13 {
20  class OUILookup
21  {
22  private:
25  struct MaskedFilter
26  {
27  int mask;
28  std::unordered_map<uint64_t, std::string> vendorMap;
29  };
30 
32  struct VendorData
33  {
34  std::string vendorName;
35  std::vector<MaskedFilter> maskedFilter;
36  };
37 
40  typedef std::unordered_map<uint64_t, VendorData> OUIVendorMap;
41 
43  OUIVendorMap vendorMap;
44 
45  template <typename T> int64_t internalParser(T& jsonData);
46 
47  public:
52  int64_t initOUIDatabaseFromJson(const std::string& path = "");
53 
57  std::string getVendorName(const pcpp::MacAddress& addr);
58  };
59 } // namespace pcpp
Definition: MacAddress.h:21
Definition: OUILookup.h:21
int64_t initOUIDatabaseFromJson(const std::string &path="")
std::string getVendorName(const pcpp::MacAddress &addr)
The main namespace for the PcapPlusPlus lib.