Skip to contentSkip to conversation

How to change a match options

DISCUSSION Juan Torres 3 participants 3 messages Apr 8, 2003 – Apr 10, 2003 netfilter

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

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_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

#2 lore raw
In reply to Juan Torres

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_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.

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