How to change a match options
Hi, I want to make my own match, but before, to understand how it works, I'm modifying an existing match, ipt_multiport to be precise, so, I have changed the ipt_multiport.c file. But now I want to change the match writing options (for example, to add a new option similar than -dport, or to make that it wouldn't be necessary to write any option) So I need to know which file I have to modify to change the "writing options" of a match.
Thanks a lot.
Juan
Dear Juan
I am also a beginner on developing an iptables extension. I guess you can add options by modifying struct option. In my dscp match file, I have this struct.
static struct option opts[] = {
{ "dscp", 1, 0, 'F' },
{ "dscp-class", 1, 0, 'G' },
{ 0 }
};
Got it?
Regards,
philip
Quoted 12 lines · Juan Torres
Hi, I want to make my own match, but before, to understand how it works, I’m modifying an existing match,
ipt_multiportto be precise, so, I have changed theipt_multiport.cfile. But now I want to change the match writing options (for example, to add a new option similar than –dport, or to make that it wouldn’t be necessary to write any option) So I need to know which file I have to modify to change the “writing options” of a match.Thanks a lot.
Juan
Hello Juan,
Quoted 7 lines · Juan Torres
Hi, I want to make my own match, but before, to understand how it works, I'm modifying an existing match,
ipt_multiportto be precise, so, I have changed theipt_multiport.cfile. But now I want to change the match writing options (for example, to add a new option similar than -dport, or to make that it wouldn't be necessary to write any option) So I need to know which file I have to modify to change the "writing options" of a match.
You will find what you're looking for in the netfilter-hacking-HOWTO:
http://www.netfilter.org/documentation/HOWTO/netfilter-hacking-HOWTO.html
Have a nice day,
Fabrice.
--
Fabrice MARIE
"Silly hacker, root is for administrators"
-Unknown