File tree 2 files changed +27
-3
lines changed 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -67,17 +67,26 @@ local function damage(payload)
67
67
return " accept" , replace
68
68
end
69
69
70
- local payload
70
+ local h = nfq .open ()
71
+ nfq .unbind_pf (h , " inet" )
72
+ nfq .bind_pf (h , " inet" )
73
+
74
+ local q = nfq .create_queue (h , 0 )
75
+ nfq .set_mode (q , copy , 0xffff )
71
76
72
- nfq .loop (function (nfqdata )
77
+ local payload
78
+ nfq .catch (h , function (nfqdata )
73
79
print (" nfqdata" , nfqdata )
74
80
75
81
local payload = nfq .get_payload (nfqdata )
76
82
77
83
print (h (payload ))
78
84
79
85
-- return setttl(payload)
80
- return damage (payload )
86
+ return " accept " , damage (payload )
81
87
-- return "drop"
82
88
end )
83
89
90
+ nfq .destroy_queue (q )
91
+ nfq .close (h )
92
+
Original file line number Diff line number Diff line change @@ -28,6 +28,21 @@ THE POSSIBILITY OF SUCH DAMAGE.
28
28
/*-
29
29
** nfq - a binding to netfilter's queue subsystem
30
30
31
+ Example usage:
32
+
33
+ h = nfq.open()
34
+ nfq.unbind_pf(h, "inet")
35
+ nfq.bind_pf(h, "inet")
36
+
37
+ q = nfq.create_queue(h, 0)
38
+ nfq.set_mode(q, copy, 0xffff)
39
+
40
+ nfq.catch(h, function(nfqdata)
41
+ print(string.format("%q", nfq.get_payload(nfqdata)))
42
+ end)
43
+
44
+ nfq.destroy_queue(q)
45
+ nfq.close(h)
31
46
*/
32
47
33
48
/*
You can’t perform that action at this time.
0 commit comments