nfq: NFQNL_MSG_VERDICT_BATCH support
Florian Westphal
maintainerPATCH 1/1 nfq: NFQNL_MSG_VERDICT_BATCH support
add nfq_set_verdict_batch() and nfq_set_verdict_batch2 (to also set the nfmark of all packets).
verdicts sent by the _batch variant will affect all queued skbs whose id is smaller or equal to the given id.
This facility is available from Linux 3.1 onwards.
While at it, add notes on use of NF_STOLEN and NF_REPEAT verdicts.
--- include/libnetfilter_queue/libnetfilter_queue.h | 9 +++ include/libnetfilter_queue/linux_nfnetlink_queue.h | 1 + src/libnetfilter_queue.c | 57 +++++++++++++++++--- 3 files changed, 60 insertions(+), 7 deletions(-)
include/libnetfilter_queue/libnetfilter_queue.h +9 -0
@@ -69,6 +69,15 @@ extern int nfq_set_verdict2(struct nfq_q_handle *qh,u_int32_t datalen, const unsigned char *buf); +extern int nfq_set_verdict_batch (struct nfq_q_handle *qh, +u_int32_t id, +u_int32_t verdict); + +extern int nfq_set_verdict_batch2 (struct nfq_q_handle *qh, +u_int32_t id, +u_int32_t verdict, +u_int32_t mark); + extern __attribute__((deprecated)) int nfq_set_verdict_mark(struct nfq_q_handle *qh, u_int32_t id,
include/libnetfilter_queue/linux_nfnetlink_queue.h +1 -0
@@ -11,6 +11,7 @@ enum nfqnl_msg_types {NFQNL_MSG_PACKET ,/* packet from kernel to userspace */ NFQNL_MSG_VERDICT ,/* verdict from userspace to kernel */ NFQNL_MSG_CONFIG ,/* connect to a particular queue */ +NFQNL_MSG_VERDICT_BATCH ,/* batch verdict from userspace to kernel */ NFQNL_MSG_MAX };
src/libnetfilter_queue.c +50 -7
104 lines not on this page · raw message
Signature · 1 line
1.7.3.4
Pablo Neira Ayuso
maintainerQuoted 7 lines · Florian Westphal
add
nfq_set_verdict_batch()andnfq_set_verdict_batch2(to also set the nfmark of all packets).verdicts sent by the
_batchvariant will affect all queued skbs whose id is smaller or equal to the given id.This facility is available from Linux 3.1 onwards.
Thanks Florian.
Quoted 1 line
While at it, add notes on use of
NF_STOLENandNF_REPEATverdicts.
I'm going to split this patch into two chunks. This doesn't really belong here.