Problems including kernel header files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First, hi to everybody, since this is my first post to the list. 

I am programming with the netfilter framework, and have faced a problem i can 
solve. I am trying to use the structure rt_key defined in 
/usr/src/linux/include/net/route.h
The problem is that i am not able to include that file correctly. I'll 
explain what i have:

My file to compile, ruta.c:
#define MODULE
#define __KERNEL__

#include <net/route.h>

unsigned int main()
{
     struct rt_key entradaTabla;
     return 0;
}


Trying to compile:
[root@daniel Antonio4]# gcc ruta.c
ruta.c: In function `main':
ruta.c:8: storage size of `entradaTabla' isn't known

This way, it doesn look in the correct directrory, and it picks route.h from 
/usr/include/net.


Trying again:
[root@daniel Antonio4]# gcc -I/usr/src/linux/include ruta.c
In file included from /usr/src/linux/include/net/dst.h:12,
                 from /usr/src/linux/include/net/route.h:27,
                 from ruta.c:4:
/usr/src/linux/include/net/neighbour.h:56: warning: `struct neighbour' 
declared inside parameter list
/usr/src/linux/include/net/neighbour.h:56: warning: its scope is only this 
definition or declaration, which is probably not what you want.
/usr/src/linux/include/net/neighbour.h:102: `MAX_ADDR_LEN' undeclared here 
(not in a function)
/usr/src/linux/include/net/neighbour.h:102: size of array `ha' has 
non-integer type
/usr/src/linux/include/net/neighbour.h:166: field `gc_task' has incomplete 
type


In this second way it seems to pick the correct header file, but it gives me 
those errors. I have no clue about what to do now, so any idea would be 
really appreciated.

Thanks in advance,
Antonio.
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux