From: Alisha Nigam <mail_to_alisha@yahoo.com>
To: linux-kernel@vger.kernel.org
Subject: TCP/IP stack related prob.
Date: Fri, 11 Apr 2003 00:38:48 -0700 (PDT) [thread overview]
Message-ID: <20030411073848.33517.qmail@web20106.mail.yahoo.com> (raw)
hi all,
i was trying to write a module for printing
the destination header of packets comming to my
machine.
#include<linux/module.h>
#include<linux/skbuff.h>
#define MODULE
#define __KERNEL__
int init_module(struct sk_buff *skb)
{printk("Destination Addr:%s.\n",skb->nh.iph->daddr);
kfree_skb(skb);
return 0;
}
void cleanup_module(void)
{ printk(" Module is removed succesfully\n");
}
then compile it
gcc -c -O -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -DMODULE -D__KERNEL__ -mymodule.o
mymodule.c
i am getting a bundle of errors ......
In file included from /usr/include/linux/fs.h:23,
from
/usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:9,
from /usr/include/linux/skbuff.h:19,
from p10.c:2:
/usr/include/linux/string.h:8:2: warning: #warning
Using kernel header in userland!
In file included from /usr/include/linux/sched.h:14,
from /usr/include/linux/skbuff.h:19,
from p10.c:2:
/usr/include/linux/timex.h:173: field `time' has
incomplete type
In file included from /usr/include/linux/bitops.h:69,
from /usr/include/asm/system.h:7,
from /usr/include/linux/sched.h:16,
from /usr/include/linux/skbuff.h:19,
from p10.c:2:
/usr/include/asm/bitops.h:333:2: warning: #warning
This includefile is not available on all
architectures.
/usr/include/asm/bitops.h:334:2: warning: #warning
Using kernel headers in userspace.
In file included from /usr/include/linux/signal.h:4,
from /usr/include/linux/sched.h:25,
from /usr/include/linux/skbuff.h:19,
from p10.c:2:
/usr/include/asm/signal.h:107: parse error before
"sigset_t"
/usr/include/asm/signal.h:110: parse error before '}'
token
In file included from /usr/include/linux/sched.h:81,
from /usr/include/linux/skbuff.h:19,
from p10.c:2:
/usr/include/linux/timer.h:45: parse error before
"spinlock_t"
/usr/include/linux/timer.h:53: parse error before '}'
token
/usr/include/linux/timer.h:67: parse error before
"tvec_base_t"
/usr/include/linux/timer.h:101: parse error before
"tvec_bases"
/usr/include/linux/timer.h: In function `init_timer':
/usr/include/linux/timer.h:105: dereferencing pointer
to incomplete type
/usr/include/linux/timer.h:105: dereferencing pointer
to incomplete type
/usr/include/linux/timer.h:106: dereferencing pointer
to incomplete type
/usr/include/linux/timer.h: In function
`timer_pending':
/usr/include/linux/timer.h:121: dereferencing pointer
to incomplete type
In file included from /usr/include/linux/highmem.h:5,
from /usr/include/linux/skbuff.h:26,
from p10.c:2:
/usr/include/asm/pgalloc.h:6:24: asm/fixmap.h: No such
file or directory
In file included from /usr/include/linux/highmem.h:5,
from /usr/include/linux/skbuff.h:26,
from p10.c:2:
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:57: parse error before '*'
token
/usr/include/asm/pgalloc.h: In function
`get_pgd_slow':
/usr/include/asm/pgalloc.h:59: `pgd_t' undeclared
(first use in this function)
/usr/include/asm/pgalloc.h:59: (Each undeclared
identifier is reported only once
/usr/include/asm/pgalloc.h:59: for each function it
appears in.)
/usr/include/asm/pgalloc.h:59: `pgd' undeclared (first
use in this function)
/usr/include/asm/pgalloc.h:59: parse error before ')'
token
/usr/include/asm/pgalloc.h:62: `USER_PTRS_PER_PGD'
undeclared (first use in this function)
/usr/include/asm/pgalloc.h:63: `swapper_pg_dir'
undeclared (first use in this function)
/usr/include/asm/pgalloc.h:63: `PTRS_PER_PGD'
undeclared (first use in this function)
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:70: parse error before '*'
token
/usr/include/asm/pgalloc.h: In function
`get_pgd_fast':
/usr/include/asm/pgalloc.h:80: `pgd_t' undeclared
(first use in this function)
/usr/include/asm/pgalloc.h:80: parse error before ')'
token
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:83: parse error before '*'
token
/usr/include/asm/pgalloc.h: In function
`free_pgd_fast':
/usr/include/asm/pgalloc.h:85: `pgd' undeclared (first
use in this function)
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:90: parse error before '*'
token
/usr/include/asm/pgalloc.h: In function
`free_pgd_slow':
/usr/include/asm/pgalloc.h:99: `pgd' undeclared (first
use in this function)
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:103: parse error before '*'
token
/usr/include/asm/pgalloc.h: In function
`pte_alloc_one':
/usr/include/asm/pgalloc.h:105: `pte_t' undeclared
(first use in this function)
/usr/include/asm/pgalloc.h:105: `pte' undeclared
(first use in this function)
/usr/include/asm/pgalloc.h:109: parse error before ')'
token
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:118: parse error before '*'
token
/usr/include/asm/pgalloc.h: In function
`pte_alloc_one_fast':
/usr/include/asm/pgalloc.h:127: `pte_t' undeclared
(first use in this function)
/usr/include/asm/pgalloc.h:127: parse error before ')'
token
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:130: parse error before '*'
token
/usr/include/asm/pgalloc.h: In function
`pte_free_fast':
/usr/include/asm/pgalloc.h:132: `pte' undeclared
(first use in this function)
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:137: parse error before '*'
token
/usr/include/asm/pgalloc.h: In function
`pte_free_slow':
/usr/include/asm/pgalloc.h:139: `pte' undeclared
(first use in this function)
/usr/include/asm/pgalloc.h: In function
`flush_tlb_mm':
/usr/include/asm/pgalloc.h:183: `current' undeclared
(first use in this function)
/usr/include/asm/pgalloc.h: In function
`flush_tlb_page':
/usr/include/asm/pgalloc.h:190: dereferencing pointer
to incomplete type
/usr/include/asm/pgalloc.h:190: `current' undeclared
(first use in this function)
/usr/include/asm/pgalloc.h: In function
`flush_tlb_range':
/usr/include/asm/pgalloc.h:197: `current' undeclared
(first use in this function)
In file included from p10.c:2:
/usr/include/linux/skbuff.h: At top level:
/usr/include/linux/skbuff.h:100: parse error before
"spinlock_t"
/usr/include/linux/skbuff.h:120: parse error before
"atomic_t"
/usr/include/linux/skbuff.h:124: parse error before
'}' token
/usr/include/linux/skbuff.h:183: parse error before
"atomic_t"
/usr/include/linux/skbuff.h:215: parse error before
'}' token
p10.c:3:1: warning: "MODULE" redefined
p10.c:1:1: warning: this is the location of the
previous definition
p10.c:4:1: warning: "__KERNEL__" redefined
p10.c:1:1: warning: this is the location of the
previous definition
p10.c:7: warning: no previous prototype for
`init_module'
p10.c: In function `init_module':
p10.c:7: warning: implicit declaration of function
`printk'
p10.c:7: dereferencing pointer to incomplete type
p10.c:8: warning: implicit declaration of function
`kfree_skb'
p10.c: At top level:
p10.c:12: warning: no previous prototype for
`cleanup_module'
/usr/include/linux/prefetch.h: In function `prefetch':
/usr/include/linux/prefetch.h:43: warning: unused
parameter `x'
/usr/include/linux/prefetch.h: In function
`prefetchw':
/usr/include/linux/prefetch.h:48: warning: unused
parameter `x'
/usr/include/asm/pgalloc.h: In function
`flush_tlb_range':
/usr/include/asm/pgalloc.h:195: warning: unused
parameter `start'
/usr/include/asm/pgalloc.h:195: warning: unused
parameter `end'
/usr/include/asm/pgalloc.h: In function
`flush_tlb_pgtables':
/usr/include/asm/pgalloc.h:233: warning: unused
parameter `mm'
/usr/include/asm/pgalloc.h:234: warning: unused
parameter `start'
/usr/include/asm/pgalloc.h:234: warning: unused
parameter `end'
CAN ANY ONE HELP ME ???????????
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
next reply other threads:[~2003-04-11 7:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-11 7:38 Alisha Nigam [this message]
2003-04-11 7:52 ` Arjan van de Ven
2003-04-11 8:06 ` Alisha Nigam
2003-04-11 8:08 ` Francis Galiegue
2003-04-11 8:34 ` Alisha Nigam
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=20030411073848.33517.qmail@web20106.mail.yahoo.com \
--to=mail_to_alisha@yahoo.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®