-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpcap.h
48 lines (38 loc) · 989 Bytes
/
pcap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// Created by postolka on 13.6.19.
//
#ifndef DPDK_TCP_GENERATOR_PCAP_H
#define DPDK_TCP_GENERATOR_PCAP_H
#include <stdint.h>
#include <rte_mbuf.h>
struct app_config;
struct pcap_global_hdr {
uint32_t magic_number;
uint16_t version_major;
uint16_t version_minor;
int32_t thiszone;
uint32_t sigfigs;
uint32_t snaplen;
uint32_t network;
};
struct pcap_packet_hdr {
uint32_t ts_sec;
uint32_t ts_usec;
uint32_t incl_len;
uint32_t orig_len;
};
struct pcap_list_entry {
uint8_t *pcap_payload;
uint32_t payload_len;
struct pcap_list_entry *next;
};
struct pcap_list {
struct pcap_list_entry *first;
struct pcap_list_entry *last;
struct pcap_list_entry *current;
};
struct pcap_list_entry *pcap_list_get(const struct pcap_list *list);
void pcap_list_next(struct pcap_list *list);
void pcap_list_destroy_all(struct pcap_list *pcap_lists);
int pcap_parse(struct app_config *config);
#endif //DPDK_TCP_GENERATOR_PCAP_H