* xtables-addons - problem including nf_nat.h in userspace plugin
@ 2010-11-21 21:47 Marek Kierdelewicz
2010-11-22 13:52 ` Jan Engelhardt
0 siblings, 1 reply; 4+ messages in thread
From: Marek Kierdelewicz @ 2010-11-21 21:47 UTC (permalink / raw)
To: netfilter-devel
Hi,
I'm writing a new netfilter module and I'm using xtables-addons
infrastructure version 1.31 as described in paragraph 2.9.1 of
"Writing Netfilter modules" ebook[1].
Iptables userspace plugin for the module needs definition of "struct
nf_nat_multi_range", so I added following line to libxt_xxxx.c:
#include <net/netfilter/nf_nat.h>
Unfortunately I get following message during make:
warning: net/netfilter/nf_nat.h: No such file or directory
... and compilation fails.
I was able to make it work by copying nf_nat.h and nf_conntrack_tuple.h
to extension directory in xtables-addons tree and by modifying include
in libxt_xxxx.c to "nf_nat.h", but this doesn't seem to be the proper
way of doing things.
How can I make it work without copying header files to xtables-addons
tree?
Please CC me in reply as I'm not subscribed to netfilter-devel. Thx!
[1] http://jengelh.medozas.de/documents/Netfilter_Modules.pdf
Best regards,
Marek
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: xtables-addons - problem including nf_nat.h in userspace plugin
2010-11-21 21:47 xtables-addons - problem including nf_nat.h in userspace plugin Marek Kierdelewicz
@ 2010-11-22 13:52 ` Jan Engelhardt
2010-11-22 15:11 ` Patrick McHardy
2010-11-22 21:52 ` Marek Kierdelewicz
0 siblings, 2 replies; 4+ messages in thread
From: Jan Engelhardt @ 2010-11-22 13:52 UTC (permalink / raw)
To: Marek Kierdelewicz; +Cc: Netfilter Developer Mailing List, Patrick McHardy
On Sunday 2010-11-21 22:47, Marek Kierdelewicz wrote:
>
>I'm writing a new netfilter module and I'm using xtables-addons[...]
>Iptables userspace plugin for the module needs definition of "struct
>nf_nat_multi_range", so I added following line to libxt_xxxx.c:
>#include <net/netfilter/nf_nat.h>
>Unfortunately I get following message during make:
>warning: net/netfilter/nf_nat.h: No such file or directory
>... and compilation fails.
>I was able to make it work by copying nf_nat.h and nf_conntrack_tuple.h
>to extension directory in xtables-addons tree and by modifying include
>in libxt_xxxx.c to "nf_nat.h", but this doesn't seem to be the proper
>way of doing things.
Well, iptables also copies them rather than properly relying on
something from <linux/*>. Yes, it's not proper. Patrick should know
the details about the what and why.
As for xt-a, preferable location is
linux-src/include/net/netfilter/nf_nat.h ->
xtables-addons/include/net/netfilter/nf_nat.h
Then #include <net/...> should work.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: xtables-addons - problem including nf_nat.h in userspace plugin
2010-11-22 13:52 ` Jan Engelhardt
@ 2010-11-22 15:11 ` Patrick McHardy
2010-11-22 21:52 ` Marek Kierdelewicz
1 sibling, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2010-11-22 15:11 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Marek Kierdelewicz, Netfilter Developer Mailing List
On 22.11.2010 14:52, Jan Engelhardt wrote:
>
> On Sunday 2010-11-21 22:47, Marek Kierdelewicz wrote:
>>
>> I'm writing a new netfilter module and I'm using xtables-addons[...]
>> Iptables userspace plugin for the module needs definition of "struct
>> nf_nat_multi_range", so I added following line to libxt_xxxx.c:
>> #include <net/netfilter/nf_nat.h>
>> Unfortunately I get following message during make:
>> warning: net/netfilter/nf_nat.h: No such file or directory
>> ... and compilation fails.
>> I was able to make it work by copying nf_nat.h and nf_conntrack_tuple.h
>> to extension directory in xtables-addons tree and by modifying include
>> in libxt_xxxx.c to "nf_nat.h", but this doesn't seem to be the proper
>> way of doing things.
>
> Well, iptables also copies them rather than properly relying on
> something from <linux/*>. Yes, it's not proper. Patrick should know
> the details about the what and why.
Mainly to allow to compile new extensions before the kernel headers
are updated. Including files from include/net is wrong though, they
should be moved to include/linux instead.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: xtables-addons - problem including nf_nat.h in userspace plugin
2010-11-22 13:52 ` Jan Engelhardt
2010-11-22 15:11 ` Patrick McHardy
@ 2010-11-22 21:52 ` Marek Kierdelewicz
1 sibling, 0 replies; 4+ messages in thread
From: Marek Kierdelewicz @ 2010-11-22 21:52 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Netfilter Developer Mailing List, Patrick McHardy
Hi,
>As for xt-a, preferable location is
>linux-src/include/net/netfilter/nf_nat.h ->
>xtables-addons/include/net/netfilter/nf_nat.h
>Then #include <net/...> should work.
Thx! That worked great.
Best regards,
Marek
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-22 21:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-21 21:47 xtables-addons - problem including nf_nat.h in userspace plugin Marek Kierdelewicz
2010-11-22 13:52 ` Jan Engelhardt
2010-11-22 15:11 ` Patrick McHardy
2010-11-22 21:52 ` Marek Kierdelewicz
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).