-
Notifications
You must be signed in to change notification settings - Fork 15
/
npfring.h
41 lines (27 loc) · 835 Bytes
/
npfring.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
#ifndef PFRING_H
#define PFRING_H 1
#include <pcap/pcap.h>
#include <stdint.h>
#include <stdio.h>
#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