|
|
| 38 |
class PcapHelper |
38 |
class PcapHelper |
| 39 |
{ |
39 |
{ |
| 40 |
public: |
40 |
public: |
| 41 |
// |
41 |
/** |
| 42 |
// These are the data link types that will be written to the pcap file. We |
42 |
* This enumeration holds the data link types that will be written to the pcap file. |
| 43 |
// don't include pcap-bpf.h to avoid an explicit dependency on the real pcap |
43 |
* |
| 44 |
// and we don't make an enumeration of all of the values to make it easy to |
44 |
* We don't include pcap-bpf.h to avoid an explicit dependency on the real pcap |
| 45 |
// pass new values in. |
45 |
* and we don't make an enumeration of all of the values to make it easy to |
| 46 |
// |
46 |
* pass new values in. |
| 47 |
enum { |
47 |
* |
|
|
48 |
* For a list of Data Link Types see http://www.tcpdump.org/linktypes.html |
| 49 |
*/ |
| 50 |
enum DataLinkType { |
| 48 |
DLT_NULL = 0, |
51 |
DLT_NULL = 0, |
| 49 |
DLT_EN10MB = 1, |
52 |
DLT_EN10MB = 1, |
| 50 |
DLT_PPP = 9, |
53 |
DLT_PPP = 9, |
|
|
| 101 |
* @param tzCorrection time zone correction to be applied to timestamps of packets |
104 |
* @param tzCorrection time zone correction to be applied to timestamps of packets |
| 102 |
* @returns a smart pointer to the Pcap file |
105 |
* @returns a smart pointer to the Pcap file |
| 103 |
*/ |
106 |
*/ |
| 104 |
Ptr<PcapFileWrapper> CreateFile (std::string filename, std::ios::openmode filemode, |
107 |
Ptr<PcapFileWrapper> CreateFile (std::string filename, |
| 105 |
uint32_t dataLinkType, uint32_t snapLen = std::numeric_limits<uint32_t>::max (), int32_t tzCorrection = 0); |
108 |
std::ios::openmode filemode, |
|
|
109 |
DataLinkType dataLinkType, |
| 110 |
uint32_t snapLen = std::numeric_limits<uint32_t>::max (), |
| 111 |
int32_t tzCorrection = 0); |
| 106 |
/** |
112 |
/** |
| 107 |
* @brief Hook a trace source to the default trace sink |
113 |
* @brief Hook a trace source to the default trace sink |
| 108 |
* |
114 |
* |