* inet kernel question cont.
@ 2002-09-12 7:47 jnf
0 siblings, 0 replies; only message in thread
From: jnf @ 2002-09-12 7:47 UTC (permalink / raw)
To: linux-c-programming
ok so i have a barbones modules that registers a callback function w/ the kernel for dealing with ip packets via dev_add_pack(), the problem is, that my function never seems to be called and after an exhaustive search of google and general tinkering around, i dont know what the problem is. below is the code, any help would be appreciated.
#define MODULE
#define __KERNEL__
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/netdevice.h>
#include <linux/if_ether.h>
#include <linux/skbuff.h>
#include <linux/kernel.h>
char *dev;
MODULE_PARM(dev,"s");
struct net_device *d;
struct packet_type pproc;
int pprocfunc(struct sk_buff *skb, struct net_device *dv, struct packet_type *pt) {
printk("yey\n");
kfree_skb(skb);
return 0;
}
int __init pproc_mod_init(void) {
(char *)d = dev_get(dev);
pproc.dev = d;
pproc.func = pprocfunc;
pproc.type = htons(ETH_P_IP);
pproc.data = (void *)1;
pproc.next = NULL;
dev_add_pack(&pproc);
printk("in\n");
return 0;
}
void __exit pproc_mod_cleanup(void) {
dev_remove_pack(&pproc);
printk("rmvd\n");
}
module_init(pproc_mod_init);
module_exit(pproc_mod_cleanup);
_____________________________________________________________
Sign up for FREE email from DoItYourself.com at http://doityourself.com
_____________________________________________________________
Promote your group and strengthen ties to your members with email@yourgroup.org by Everyone.net http://www.everyone.net/?btn=tag
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-09-12 7:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-12 7:47 inet kernel question cont jnf
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).