From: Jonas Berlin <xkr47@outerspace.dyndns.org>
To: LAAROUCHI Youssef <laarouchi_yous@yahoo.fr>
Cc: netfilter-devel@lists.netfilter.org, laarouch@enseirb.fr
Subject: Re: Iptables and kernel modules
Date: Sun, 03 Jul 2005 21:09:08 +0000 [thread overview]
Message-ID: <42C853F4.6010702@outerspace.dyndns.org> (raw)
In-Reply-To: <20050701004115.34697.qmail@web26507.mail.ukl.yahoo.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoting LAAROUCHI Youssef on 2005-07-01 00:41 UTC:
> Hi,
>
> I've created a kernel module to modify the format of
> exchanged IP packets... This module is correctly inserted
> into the kernel. I then want to make this module receive
> the packets by using the following command :
>
> #iptables -t mangle -A INPUT -p icmp --icmp-type 38 -j
> puzClient
>
> This command returns an error asking for .so file... The
> problem is that I don't know the format of .so files.. I
> have generated one .so file by adding -shared in the link
> command, but it doesn't solve the problem. I have undefined
> symbols error.
You need to create a userspace helper for your kernel module. If your
kernel module is named ipt_puzClient.c, the userspace helper should be
named libipt_puzClient.c and be placed in the iptables source tree in
the extensions/ directory. There are also a few more files in the same
directory that you need to create, see sections 9-12 in the
README.newpatchs in patch-o-matic-ng e.g.
http://svn.netfilter.org/cgi-bin/viewcvs.cgi/trunk/patch-o-matic-ng/README.newpatches?rev=4018&view=auto
You can look at libipt_MARK.c for an example..
> So can you specify to me how the .so files are generated ?
After you get the files in place and your kernel has been configured to
compile your module, compile iptables and it should detect that it needs
to create libipt_puzClient.so and create it for you.
> and what is the necessary format to generate a ipt_target
> so file. And eventually, can we make iptables working
> directly with kernel modules without using .so files ? ?
Everything's possible, but that wouldn't be very nice. Creating the .so
file shouldn't be too hard as soon as you understand how to do it. I
think you can copy-paste a lot from libipt_MARK.c to get going..
> Thanks,
>
> Youssef
Good luck! :)
- --
- - xkr47
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFCyFPyxyF48ZTvn+4RAtJiAJ98X0JbIrbm0sgpe2kSgv2uzq8xogCeMrJL
BBwA6+jInSxYcFbAfpmgPpI=
=7P8r
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2005-07-03 21:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-01 0:41 Iptables and kernel modules LAAROUCHI Youssef
2005-07-03 21:09 ` Jonas Berlin [this message]
2005-07-11 13:16 ` bandwidth saving idea Oscar Mechanic
2005-07-11 13:26 ` Eric Leblond
2005-07-11 14:38 ` Oscar Mechanic
2005-07-11 14:49 ` Eric Leblond
2005-07-11 15:02 ` Amin Azez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42C853F4.6010702@outerspace.dyndns.org \
--to=xkr47@outerspace.dyndns.org \
--cc=laarouch@enseirb.fr \
--cc=laarouchi_yous@yahoo.fr \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.