* Match & target structure history in 2.4.28 and 2.6.x series
@ 2007-01-11 18:34 Jonas Berlin
2007-01-12 10:22 ` Jan Engelhardt
0 siblings, 1 reply; 5+ messages in thread
From: Jonas Berlin @ 2007-01-11 18:34 UTC (permalink / raw)
To: netfilter-devel
In the hope that it will help people write matches & targets that are compatible with not only the newest version of linux, I wrote a page showing the changes to the match & target structs used in kernel code in the 2.6 series since 2.4.28:
http://xkr47.outerspace.dyndns.org/netfilter/match_and_target_structure_history.html
There has been quite a lot of changes in fact, and often ipv6 changes have appeared later than ipv4 changes.
I also included the transition from ipt_* and ip6t_* structs to xt_* structs in 2.6.16.
I'll try to write some skeleton examples later on how to do the basic backwards compatibility.. if I have time.. meanwhile, you get some idea by looking at this example.. check the #if statements:
http://svn.netfilter.org/cgi-bin/viewcvs.cgi/trunk/patch-o-matic-ng/patchlets/set/linux-2.6/net/ipv4/netfilter/ipt_set.c?view=markup
- xkr47
--
"if I'd make up my own definitions, unrational would be the the end
result after someone unrationalized something i.e. actively worked
to cut down on rationality, whereas irrational would be more a
result of laziness or lack of skill"
- me, 23.11.2006
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Match & target structure history in 2.4.28 and 2.6.x series
2007-01-11 18:34 Match & target structure history in 2.4.28 and 2.6.x series Jonas Berlin
@ 2007-01-12 10:22 ` Jan Engelhardt
2007-01-12 10:28 ` Jonas Berlin
2007-01-12 10:45 ` Jan Engelhardt
0 siblings, 2 replies; 5+ messages in thread
From: Jan Engelhardt @ 2007-01-12 10:22 UTC (permalink / raw)
To: Jonas Berlin; +Cc: netfilter-devel
>In the hope that it will help people write matches & targets that are
>compatible with not only the newest version of linux, I wrote a page
>showing the changes to the match & target structs used in kernel code
>in the 2.6 series since 2.4.28:
You could add 2.6.20-rc4 (to become 2.6.20).
-`J'
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Match & target structure history in 2.4.28 and 2.6.x series
2007-01-12 10:22 ` Jan Engelhardt
@ 2007-01-12 10:28 ` Jonas Berlin
2007-01-12 10:45 ` Jan Engelhardt
1 sibling, 0 replies; 5+ messages in thread
From: Jonas Berlin @ 2007-01-12 10:28 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: netfilter-devel
Jan Engelhardt wrote:
>> In the hope that it will help people write matches & targets that are
>> compatible with not only the newest version of linux, I wrote a page
>> showing the changes to the match & target structs used in kernel code
>> in the 2.6 series since 2.4.28:
>
> You could add 2.6.20-rc4 (to become 2.6.20).
Do you mean I should add "(to become 2.6.20)" after 2.6.20-rc4 ? I have
2.6.20-rc4 in there already.. :)
- xkr47
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Match & target structure history in 2.4.28 and 2.6.x series
2007-01-12 10:22 ` Jan Engelhardt
2007-01-12 10:28 ` Jonas Berlin
@ 2007-01-12 10:45 ` Jan Engelhardt
2007-01-12 10:49 ` Jonas Berlin
1 sibling, 1 reply; 5+ messages in thread
From: Jan Engelhardt @ 2007-01-12 10:45 UTC (permalink / raw)
To: Jonas Berlin; +Cc: netfilter-devel
>>In the hope that it will help people write matches & targets that are
>>compatible with not only the newest version of linux, I wrote a page
>>showing the changes to the match & target structs used in kernel code
>>in the 2.6 series since 2.4.28:
>
>You could add 2.6.20-rc4 (to become 2.6.20).
Oh right. Well, I just thought of this peculiarity in 2.6.20:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
# define nfmark mark
#endif
void foobar(struct sk_buff *skb) {
printk("Mark is %d\n", skb->nfmark);
}
-`J'
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Match & target structure history in 2.4.28 and 2.6.x series
2007-01-12 10:45 ` Jan Engelhardt
@ 2007-01-12 10:49 ` Jonas Berlin
0 siblings, 0 replies; 5+ messages in thread
From: Jonas Berlin @ 2007-01-12 10:49 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: netfilter-devel
Jan Engelhardt wrote:
>>> In the hope that it will help people write matches & targets that are
>>> compatible with not only the newest version of linux, I wrote a page
>>> showing the changes to the match & target structs used in kernel code
>>> in the 2.6 series since 2.4.28:
>> You could add 2.6.20-rc4 (to become 2.6.20).
>
> Oh right. Well, I just thought of this peculiarity in 2.6.20:
>
> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
> # define nfmark mark
> #endif
>
> void foobar(struct sk_buff *skb) {
> printk("Mark is %d\n", skb->nfmark);
> }
Oh right.. well I haven't covered structures other than the *_match and
*_target ones.. I'm sure there's a lot else out there that could/should
be documented in the same way.. :) Maybe I could create a separate page
for sk_buff..?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-01-12 10:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-11 18:34 Match & target structure history in 2.4.28 and 2.6.x series Jonas Berlin
2007-01-12 10:22 ` Jan Engelhardt
2007-01-12 10:28 ` Jonas Berlin
2007-01-12 10:45 ` Jan Engelhardt
2007-01-12 10:49 ` Jonas Berlin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).