1
6
7
8
9
10
11
12
13
14
15
16
17
18
19
23
24
25
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
52
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/* ... */
#pragma once
#include <stdio.h>
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
#define PCAP_DEFAULT_VERSION_MAJOR 0x02
#define PCAP_DEFAULT_VERSION_MINOR 0x04
#define PCAP_DEFAULT_TIME_ZONE_GMT 0x00
/* ... */
typedef struct pcap_file_t *pcap_file_handle_t;
/* ... */
typedef enum {
PCAP_LINK_TYPE_LOOPBACK = 0,
PCAP_LINK_TYPE_ETHERNET = 1,
PCAP_LINK_TYPE_TOKEN_RING = 6,
PCAP_LINK_TYPE_ARCNET = 7,
PCAP_LINK_TYPE_SLIP = 8,
PCAP_LINK_TYPE_PPP = 9,
PCAP_LINK_TYPE_FDDI = 10,
PCAP_LINK_TYPE_ATM = 100,
PCAP_LINK_TYPE_RAW_IP = 101,
PCAP_LINK_TYPE_BSD_SLIP = 102,
PCAP_LINK_TYPE_BSD_PPP = 103,
PCAP_LINK_TYPE_CISCO_HDLC = 104,
PCAP_LINK_TYPE_802_11 = 105,
PCAP_LINK_TYPE_BSD_LOOPBACK = 108,
PCAP_LINK_TYPE_LOCAL_TALK = 114,
PCAP_LINK_TYPE_USBPCAP = 249,
}{ ... } pcap_link_type_t;
/* ... */
typedef struct {
FILE *fp;
unsigned int major_version;
unsigned int minor_version;
unsigned int time_zone;
struct {
unsigned int little_endian: 1;
}{ ... } flags;
}{ ... } pcap_config_t;
/* ... */
esp_err_t pcap_new_session(const pcap_config_t *config, pcap_file_handle_t *ret_pcap);
/* ... */
esp_err_t pcap_del_session(pcap_file_handle_t pcap);
/* ... */
esp_err_t pcap_write_header(pcap_file_handle_t pcap, pcap_link_type_t link_type);
/* ... */
esp_err_t pcap_capture_packet(pcap_file_handle_t pcap, void *payload, uint32_t length, uint32_t seconds, uint32_t microseconds);
/* ... */
esp_err_t pcap_print_summary(pcap_file_handle_t pcap, FILE *print_file);
#ifdef __cplusplus
}{...}
#endif