From 5e4005162b804c5501fccf4d066c5b1b99c38b89 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 19 Aug 2024 18:33:18 +0200 Subject: Add PF_RING support. (#38) --- npfring.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 npfring.h (limited to 'npfring.h') diff --git a/npfring.h b/npfring.h new file mode 100644 index 000000000..4536b892e --- /dev/null +++ b/npfring.h @@ -0,0 +1,41 @@ +#ifndef PFRING_H +#define PFRING_H 1 + +#include +#include +#include + +#include "config.h" + +struct npfring +{ + void * pfring_desc; + uint8_t pfring_buffer[PFRING_BUFFER_SIZE]; +}; + +struct npfring_stats +{ + uint64_t recv; + uint64_t drop; + uint64_t shunt; +}; + +void npfring_print_version(FILE * const out); + +int npfring_init(char const * device_name, uint32_t caplen, struct npfring * result); + +void npfring_close(struct npfring * npf); + +int npfring_set_bpf(struct npfring * npf, char const * bpf_filter); + +int npfring_datalink(struct npfring * npf); + +int npfring_enable(struct npfring * npf); + +int npfring_get_selectable_fd(struct npfring * npf); + +int npfring_recv(struct npfring * npf, struct pcap_pkthdr * pf_hdr); + +int npfring_stats(struct npfring * npf, struct npfring_stats * stats); + +#endif -- cgit v1.2.3