20#ifndef BACKENDS_EBPF_RUNTIME_EBPF_PCAP_UTIL_H_
21#define BACKENDS_EBPF_RUNTIME_EBPF_PCAP_UTIL_H_
23#define PCAP_DONT_INCLUDE_PCAP_BPF_H
28typedef uint16_t iface_index;
35 struct pcap_pkthdr pcap_hdr;
40struct pcap_list_array;
41typedef struct pcap_list pcap_list_t;
42typedef struct pcap_list_array pcap_list_array_t;
57pcap_list_t *read_pkts_from_pcap(
const char *pcap_file_name, iface_index index);
66int write_pkts_to_pcap(
const char *pcap_file_name,
const pcap_list_t *pkt_list);
76pcap_list_t *merge_and_delete_lists(pcap_list_array_t *array, pcap_list_t *merged_list);
87pcap_list_array_t *split_and_delete_list(pcap_list_t *input_list, pcap_list_array_t *result_arr);
99pcap_list_t *append_packet(pcap_list_t *pkt_list,
pcap_pkt *pkt);
112pcap_list_array_t *insert_list(pcap_list_array_t *pkt_array, pcap_list_t *pkt_list, uint16_t index);
117pcap_list_t *allocate_pkt_list();
122pcap_list_array_t *allocate_pkt_list_array();
128uint32_t get_pkt_list_length(pcap_list_t *pkt_list);
134uint16_t get_list_array_length(pcap_list_array_t *pkt_list_array);
142pcap_pkt *get_packet(pcap_list_t *list, uint32_t index);
150pcap_list_t *get_list(pcap_list_array_t *list, uint16_t index);
166void delete_list(pcap_list_t *pkt_list);
173void delete_array(pcap_list_array_t *pkt_list_array);
180void sort_pcap_list(pcap_list_t *pkt_list);
188char *generate_pcap_name(
const char *pcap_base,
int index,
const char *suffix);
Definition pcap_util.h:33