OmniSketch  0.1
Oh my sketch!
OmniSketch::Util::PcapParser< key_len > Class Template Reference

Pcap Parser. More...

#include <parser.h>

Public Member Functions

 PcapParser (const std::string_view &config_file, const std::string_view &parser_path=std::string_view_literals::operator""sv("parser", 6), const int32_t verbose=0)
 Open the config file. More...
 
bool succeed () const
 Return whether the parser config is successfully parsed. More...
 
 ~PcapParser ()
 Release the resources. More...
 
int32_t dumpPcapPacketsInBinary () const
 Dump the pcap/snoop packets in binary. More...
 
int32_t dumpPcapPacketInPcap () const
 Dump the pcap/snoop packets in txt. More...
 

Detailed Description

template<int32_t key_len>
class OmniSketch::Util::PcapParser< key_len >

Pcap Parser.

Template Parameters
key_lenlength of flowkey

Constructor & Destructor Documentation

◆ PcapParser()

template<int32_t key_len>
OmniSketch::Util::PcapParser< key_len >::PcapParser ( const std::string_view &  config_file,
const std::string_view &  parser_path = std::string_view_literals::operator""sv("parser", 6),
const int32_t  verbose = 0 
)

Open the config file.

Parameters
config_filepath to the config file
parser_pathpath into the file (concatenated with '.')
verboseverbose level

◆ ~PcapParser()

template<int32_t key_len>
OmniSketch::Util::PcapParser< key_len >::~PcapParser

Release the resources.

Member Function Documentation

◆ dumpPcapPacketInPcap()

template<int32_t key_len>
int32_t OmniSketch::Util::PcapParser< key_len >::dumpPcapPacketInPcap

Dump the pcap/snoop packets in txt.

Returns
Number of packets parsed (exclude filtered packet)

◆ dumpPcapPacketsInBinary()

template<int32_t key_len>
int32_t OmniSketch::Util::PcapParser< key_len >::dumpPcapPacketsInBinary

Dump the pcap/snoop packets in binary.

Returns
Number of packets parsed (exclude filtered packet)

◆ succeed()

template<int32_t key_len>
bool OmniSketch::Util::PcapParser< key_len >::succeed ( ) const
inline

Return whether the parser config is successfully parsed.