From: Álvaro Neira Ayuso <alvaroneay@xxxxxxxxx> This patch allows to stablish the number of the queue that we want to read the packets. Signed-off-by: Alvaro Neira Ayuso <alvaroneay@xxxxxxxxx> --- utils/nfqnl_test.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/utils/nfqnl_test.c b/utils/nfqnl_test.c index 4decd50..8272fa1 100644 --- a/utils/nfqnl_test.c +++ b/utils/nfqnl_test.c @@ -85,8 +85,18 @@ int main(int argc, char **argv) struct nfq_q_handle *qh; int fd; int rv; + int queue = 0; char buf[4096] __attribute__ ((aligned)); + if (argc == 2) { + queue = atoi(argv[1]); + if (queue > 65535) { + fprintf(stderr, "queue number is bigger than 65535\n"); + exit(1); + } + } + printf("opening library handle\n"); h = nfq_open(); if (!h) { @@ -106,8 +116,8 @@ int main(int argc, char **argv) exit(1); } - printf("binding this socket to queue '0'\n"); - qh = nfq_create_queue(h, 0, &cb, NULL); + printf("binding this socket to queue '%d'\n", queue); + qh = nfq_create_queue(h, queue, &cb, NULL); if (!qh) { fprintf(stderr, "error during nfq_create_queue()\n"); exit(1); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html