libiptc and adding a simple SNAT rule
Hello -
I'm building an app that will dynamically modify rules in the POSTROUTING chain in the nat table (SNAT). I can iterate through the list and remove chain entries ok so far, and I have some example code that successfully appends a 'blank' rule to the chain.
But when I try to iptc_append_entry a simple but specific rule I've created in my app to the chain, I get an error on the iptc_commit.
In my app, I can compare (what should be) an identical rule as created by running /sbin/iptables vs. the struct ipt_entry I'm trying to append and the only difference I see is a difference in the target offset size. Evidently, I'm supposed to add some data to the end of the struct ipt_entry.
So my question: What am I supposed to tack on to the end of the struct ipt_entry when constructing and appending a non multi-range SNAT rule?
Thanks.
Signature · 4 lines
Shaun McIntyre [email protected] (760) 230-1131 voice (619) 665-1424 cell