linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jnf <xjnfx@doityourself.com>
To: linux-c-programming@vger.kernel.org
Subject: inet kernel question cont.
Date: Thu, 12 Sep 2002 00:47:21 -0700 (PDT)	[thread overview]
Message-ID: <20020912074723.1055B396E@sitemail.everyone.net> (raw)

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

                 reply	other threads:[~2002-09-12  7:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20020912074723.1055B396E@sitemail.everyone.net \
    --to=xjnfx@doityourself.com \
    --cc=linux-c-programming@vger.kernel.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 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).