2 * netsniff-ng - the packet sniffing beast
3 * Copyright 2009, 2010 Daniel Borkmann.
4 * Subject to the GPL, version 2.
14 extern void ring_rx_setup(struct ring
*ring
, int sock
, size_t size
, int ifindex
,
15 struct pollfd
*poll
, bool v3
, bool jumbo_support
,
17 extern void destroy_rx_ring(int sock
, struct ring
*ring
);
18 extern void sock_rx_net_stats(int sock
, unsigned long seen
);
20 static inline int user_may_pull_from_rx(struct tpacket2_hdr
*hdr
)
22 return ((hdr
->tp_status
& TP_STATUS_USER
) == TP_STATUS_USER
);
25 static inline int user_may_pull_from_rx_block(struct block_desc
*pbd
)
27 return ((pbd
->h1
.block_status
& TP_STATUS_USER
) == TP_STATUS_USER
);
30 static inline void kernel_may_pull_from_rx(struct tpacket2_hdr
*hdr
)
32 hdr
->tp_status
= TP_STATUS_KERNEL
;
35 static inline void kernel_may_pull_from_rx_block(struct block_desc
*pbd
)
37 pbd
->h1
.block_status
= TP_STATUS_KERNEL
;
40 #endif /* RX_RING_H */