[Twisted-Python] twisted linux netfilter_log protocol

David Stainton dstainton415 at gmail.com
Wed Oct 2 00:14:26 MDT 2013


Hi,

I am wondering how I should combine various twisted interfaces
in a way that makes sense. It probably shows here... that I'm new to
twisted.

The Linux iptables can log packets to the netfilter_log which can give
access to user space.
I wrote a simple twisted Reader (IReadDescriptor implementation) that is
working functional code...
https://gist.github.com/david415/6789612

But since these are packets it returns... should I implement a "read only
Protocol"?
The protocol's dataReceive() method could be called from the NFLogReader's
doRead() method.
Does this mean that NFLogReader would be responsible for calling
buildProtocol to construct the NFLogProtocol?
In the normal Twisted examples the buildProtocol seems to be called from
the react loop..
Should I pass the protocol factory and the reader to the service?

If I want to drop privileges right after retrieving the filedescriptor for
netfilter_log, shall I use a Twisted Service/Application to drop the root
privs to a non-superuser?
Should the privileges be dropped by the privilegedStartService() method?
The manual says that method is for preparing to drop services...

What I want out of all of this is the most high performance and general
solution to utilizing netfilter_log in twisted...


David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131001/f6c5e33d/attachment.html>


More information about the Twisted-Python mailing list