Minor README format changes

This commit is contained in:
Matt 2011-05-13 10:02:54 -07:00
parent 324ac43316
commit f4f0828066
1 changed files with 16 additions and 9 deletions

View File

@ -5,12 +5,14 @@ NetfilterQueue
NetfilterQueue provides access to packets matched by an iptables rule in
Linux. Packets so matched can be accepted, dropped, altered, or given a mark.
Libnetfilter_queue (the netfilter library, not this module) is part of the `Netfilter project <http://netfilter.org/projects/libnetfilter_queue/>`_.
Libnetfilter_queue (the netfilter library, not this module) is part of the
`Netfilter project <http://netfilter.org/projects/libnetfilter_queue/>`_.
Example
=======
The following script prints a short description of each packet before accepting it. ::
The following script prints a short description of each packet before accepting
it. ::
from netfilterqueue import QueueHandler
@ -33,7 +35,8 @@ To send packets destined for your LAN to the script, type something like::
Installation
============
NetfilterQueue is a C extention module that links against libnetfilter_queue. Before installing, ensure you have:
NetfilterQueue is a C extention module that links against libnetfilter_queue.
Before installing, ensure you have:
1. A C compiler
@ -62,7 +65,8 @@ To install from source::
cd NetfilterQueue-0.2
python setup.py install
Setup will use Cython if it is installed, regenerating the .c source from the .pyx before compiling the .so.
Setup will use Cython if it is installed, regenerating the .c source from the
.pyx before compiling the .so.
API
===
@ -72,7 +76,8 @@ API
``NetfilterQueue.COPY_META``
``NetfilterQueue.COPY_PACKET``
These constants specify how much of the packet should be given to the script- nothing, metadata, or the whole packet.
These constants specify how much of the packet should be given to the
script- nothing, metadata, or the whole packet.
QueueHandler objects
--------------------
@ -97,7 +102,8 @@ handle() method. Handle() is called for each packet that appears in the queue.
``QueueHandler.handle(packet)``
Handle a single packet from the queue. You must call either
``packet.accept()`` or ``packet.drop()``.
``packet.accept()`` or ``packet.drop()``. If you don't override this
method, all packets will be accepted.
Packet objects
--------------
@ -177,8 +183,8 @@ More details coming soon...
* Probably other stuff is omitted too
* When a packet has been marked, we use nfq_set_verdict_mark rather than
nfq_set_verdict2. Apparently nfq_set_verdict_mark
`is broken <http://netfilter.org/projects/libnetfilter_queue/doxygen/group__Queue.html#ga1986d6387c5aa2a837c02e87ae3b45ff>`_,
nfq_set_verdict2. Apparently nfq_set_verdict_mark is
`broken <http://netfilter.org/projects/libnetfilter_queue/doxygen/group__Queue.html#ga1986d6387c5aa2a837c02e87ae3b45ff>`_,
although it works for me.
Source
@ -191,4 +197,5 @@ License
Copyright (c) 2011, Kerkhoff Technologies, Inc. All rights reserved.
`BSD <https://github.com/kti/python-netfilterqueue/blob/master/LICENSE.txt>`_ licensed.
`BSD <https://github.com/kti/python-netfilterqueue/blob/master/LICENSE.txt>`_
licensed.