<div dir="ltr">Hi,<br><br>I am wondering how I should combine various twisted interfaces<br>in a way that makes sense. It probably shows here... that I'm new to twisted.<div><br></div><div>The Linux iptables can log packets to the netfilter_log which can give access to user space.</div>
<div>I wrote a simple twisted Reader (IReadDescriptor implementation) that is working functional code...<br><a href="https://gist.github.com/david415/6789612">https://gist.github.com/david415/6789612</a></div><div><br></div>
<div>But since these are packets it returns... should I implement a "read only Protocol"?<br><div><div>The protocol's dataReceive() method could be called from the NFLogReader's doRead() method.</div></div>
<div><div>Does this mean that NFLogReader would be responsible for calling buildProtocol to construct the NFLogProtocol?</div><div>In the normal Twisted examples the buildProtocol seems to be called from the react loop..</div>
<div><div>Should I pass the protocol factory and the reader to the service?</div></div><div><br></div>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?<br>
Should the privileges be dropped by the privilegedStartService() method?<br>The manual says that method is for preparing to drop services...<br><br></div><div>What I want out of all of this is the most high performance and general solution to utilizing netfilter_log in twisted...</div>
<div><br></div><div><br></div><div>David</div></div></div>