ifpps: fix typo in help
[netsniff.git] / src / ring_rx.h
blobf1268e99d28a3ba184b759ecc3321d66fd7cc018
1 /*
2 * netsniff-ng - the packet sniffing beast
3 * By Daniel Borkmann <daniel@netsniff-ng.org>
4 * Copyright 2009, 2010 Daniel Borkmann.
5 * Subject to the GPL, version 2.
6 */
8 #ifndef RX_RING_H
9 #define RX_RING_H
11 #include "ring.h"
12 #include "built_in.h"
14 extern void destroy_rx_ring(int sock, struct ring *ring);
15 extern void create_rx_ring(int sock, struct ring *ring);
16 extern void mmap_rx_ring(int sock, struct ring *ring);
17 extern void alloc_rx_ring_frames(struct ring *ring);
18 extern void bind_rx_ring(int sock, struct ring *ring, int ifindex);
19 extern void setup_rx_ring_layout(int sock, struct ring *ring,
20 unsigned int size, int jumbo_support);
22 static inline int user_may_pull_from_rx(struct tpacket2_hdr *hdr)
24 return ((hdr->tp_status & TP_STATUS_USER) == TP_STATUS_USER);
27 static inline void kernel_may_pull_from_rx(struct tpacket2_hdr *hdr)
29 hdr->tp_status = TP_STATUS_KERNEL;
32 #endif /* RX_RING_H */