Skip to contentSkip to conversation

Netfilter ContextID

DISCUSSION Jerry Alexander 2 participants 2 messages Oct 4, 2005 – Oct 10, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

Dear Netfilter-devel:

Working on implementing packetswitching.
Of course Iptables/Netfilter looks like the
correct medium to do so.
Loaded things up and iptables could
Add(append), subtract(delete) and move(replace) UDP/IP connections.
Wrote a base module using nf_register_hook at PREROUTING
to gather packet stats.
My problem is this. My manager wants a "ContextId"
generated during the a add,subtract,move commands. Of course this would have to be unique(using a hashing algorithm which uses the IP address and the Port Number).
Right now this looks like it would need to be generated in the
kernel module. But this would require all the Append/delete/Replace
command functions moved to the kernel function also!!
Hoping someone can point me in the right direction on how
this would be done using Iptables and Netfilter.

Thanks,
Jerry

#1 lore raw

What is the purpose of this contextid?

If iptables itself is not going to make use of it, why not re-calculate it on demand when you read rules back using iptables -L?

Or if you need to be able to store abritrary cookie values, there is a comment module for iptables which allows you to store up to 255 bytes of text.

How to do this really depends on the purpose of this context and what else is supposed to respond to it.

Sam

Quoted 25 lines · Jerry Alexander

Dear Netfilter-devel:

Working on implementing packetswitching.
Of course Iptables/Netfilter looks like the
correct medium to do so.
Loaded things up and iptables could
Add(append), subtract(delete) and move(replace) UDP/IP connections.
Wrote a base module using nf_register_hook at PREROUTING
to gather packet stats.
My problem is this. My manager wants a "ContextId"
generated during the a add,subtract,move commands. Of course this would have to be unique(using a hashing algorithm which uses the IP address and the Port Number).
Right now this looks like it would need to be generated in the
kernel module. But this would require all the Append/delete/Replace
command functions moved to the kernel function also!!
Hoping someone can point me in the right direction on how
this would be done using Iptables and Netfilter.

Thanks,
Jerry