File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 17
17
from netfilterqueue import NetfilterQueue
18
18
19
19
def print_and_accept(pkt):
20
- print pkt
20
+ print( pkt)
21
21
pkt.accept()
22
22
23
23
nfqueue = NetfilterQueue()
@@ -107,18 +107,27 @@ Objects of this type are passed to your callback.
107
107
``Packet.get_payload() ``
108
108
Return the packet's payload as a string.
109
109
110
+ ``Packet.set_payload(payload) ``
111
+ Set the packet payload. ``payload `` is bytes.
112
+
110
113
``Packet.get_payload_len() ``
111
114
Return the size of the payload.
112
115
113
116
``Packet.set_mark(mark) ``
114
117
Give the packet a kernel mark. ``mark `` is a 32-bit number.
115
118
119
+ ``Packet.get_mark() ``
120
+ Get the mark already on the packet.
121
+
116
122
``Packet.accept() ``
117
123
Accept the packet.
118
124
119
125
``Packet.drop() ``
120
126
Drop the packet.
121
-
127
+
128
+ ``Packet.repeat() ``
129
+ Iterate the same cycle once more.
130
+
122
131
Callback objects
123
132
----------------
124
133
@@ -182,7 +191,6 @@ More details coming soon...
182
191
change ``DEF BufferSize = 4096 `` in ``netfilterqueue.pyx ``, and rebuild.
183
192
* Full libnetfilter_queue API is not yet implemented:
184
193
185
- * Omits ``packet.set_payload() `` for altering packet data
186
194
* Omits methods for getting information about the interface a packet has
187
195
arrived on or is leaving on
188
196
* Probably other stuff is omitted too
You can’t perform that action at this time.
0 commit comments