PcapPlusPlus  24.09
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 
14 namespace pcpp
15 {
24  class OUILookup
25  {
26  private:
31  struct MaskedFilter
32  {
33  int mask;
34  std::unordered_map<uint64_t, std::string> vendorMap;
35  };
36 
38  struct VendorData
39  {
40  std::string vendorName;
41  std::vector<MaskedFilter> maskedFilter;
42  };
43 
48  typedef std::unordered_map<uint64_t, VendorData> OUIVendorMap;
49 
51  OUIVendorMap vendorMap;
52 
53  template <typename T> int64_t internalParser(T& jsonData);
54 
55  public:
62  int64_t initOUIDatabaseFromJson(const std::string& path = "");
63 
69  std::string getVendorName(const pcpp::MacAddress& addr);
70  };
71 } // namespace pcpp
Definition: MacAddress.h:25
Definition: OUILookup.h:25
int64_t initOUIDatabaseFromJson(const std::string &path="")
std::string getVendorName(const pcpp::MacAddress &addr)
The main namespace for the PcapPlusPlus lib.