LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   problem related to skbuff.h (https://www.linuxquestions.org/questions/linux-networking-3/problem-related-to-skbuff-h-426468/)

shrishailnk 03-20-2006 12:37 AM

problem related to skbuff.h
 
i tried to compile a simple prg with skbuff.h
(the prg has a printf thats all)

but i'm getting following errors
Any solutions Please

In file included from /usr/include/linux/sched.h:13,
from /usr/include/linux/skbuff.h:19,
from sk.c:2:
/usr/include/linux/times.h:5: error: syntax error before "clock_t"
/usr/include/linux/times.h:7: error: syntax error before "tms_cutime"
/usr/include/linux/times.h:8: error: syntax error before "tms_cstime"
In file included from /usr/include/linux/sched.h:14,
from /usr/include/linux/skbuff.h:19,
from sk.c:2:
/usr/include/linux/timex.h:56: error: syntax error before "and"
In file included from /usr/include/linux/timex.h:126,
from /usr/include/linux/sched.h:14,
from /usr/include/linux/skbuff.h:19,
from sk.c:2:
/usr/include/asm/timex.h:33: error: syntax error before "cacheflush_time"
/usr/include/asm/timex.h:35: error: syntax error before "get_cycles"
In file included from /usr/include/linux/sched.h:14,
from /usr/include/linux/skbuff.h:19,
from sk.c:2:
/usr/include/linux/timex.h:147: error: 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 sk.c:2:
/usr/include/asm/bitops.h:327:2: warning: #warning This includefile is not available on all architectures.
/usr/include/asm/bitops.h:328:2: warning: #warning Using kernel headers in userspace: atomicity not guaranteed
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 sk.c:2:
/usr/include/asm/signal.h:107: error: syntax error before "sigset_t"
/usr/include/asm/signal.h:110: error: syntax error before '}' token
In file included from /usr/include/linux/signal.h:5,
from /usr/include/linux/sched.h:25,
from /usr/include/linux/skbuff.h:19,
from sk.c:2:
/usr/include/asm/siginfo.h:26: error: syntax error before "pid_t"
/usr/include/asm/siginfo.h:38: error: syntax error before "pid_t"
/usr/include/asm/siginfo.h:41: error: syntax error before '}' token
/usr/include/asm/siginfo.h:45: error: syntax error before "pid_t"
/usr/include/asm/siginfo.h:48: error: syntax error before "_utime"
/usr/include/asm/siginfo.h:49: error: syntax error before "_stime"
/usr/include/asm/siginfo.h:62: error: syntax error before '}' token
/usr/include/asm/siginfo.h:63: error: syntax error before '}' token
In file included from /usr/include/linux/sched.h:78,
from /usr/include/linux/skbuff.h:19,
from sk.c:2:
/usr/include/linux/time.h:10: error: syntax error before "time_t"
/usr/include/linux/time.h:12: error: syntax error before '}' token
/usr/include/linux/time.h:18: error: syntax error before "time_t"
/usr/include/linux/time.h:44: error: field `it_interval' has incomplete type
/usr/include/linux/time.h:45: error: field `it_value' has incomplete type
/usr/include/linux/time.h:49: error: field `it_interval' has incomplete type
/usr/include/linux/time.h:50: error: field `it_value' has incomplete type
In file included from /usr/include/linux/sched.h:80,
from /usr/include/linux/skbuff.h:19,
from sk.c:2:
/usr/include/linux/resource.h:22: error: field `ru_utime' has incomplete type
/usr/include/linux/resource.h:23: error: field `ru_stime' has incomplete type
In file included from /usr/include/linux/sched.h:81,
from /usr/include/linux/skbuff.h:19,
from sk.c:2:
/usr/include/linux/timer.h:32: error: field `vec' has incomplete type
/usr/include/linux/timer.h:37: error: field `vec' has incomplete type
/usr/include/linux/timer.h:45: error: syntax error before "spinlock_t"
/usr/include/linux/timer.h:53: error: syntax error before '}' token
/usr/include/linux/timer.h:63: error: field `list' has incomplete type
/usr/include/linux/timer.h:67: error: syntax error before "tvec_base_t"
/usr/include/linux/timer.h:101: error: syntax error before "tvec_bases"
/usr/include/linux/timer.h: In function `init_timer':
/usr/include/linux/timer.h:105: error: dereferencing pointer to incomplete type
/usr/include/linux/timer.h:105: error: dereferencing pointer to incomplete type
/usr/include/linux/timer.h:106: error: dereferencing pointer to incomplete type
/usr/include/linux/timer.h: In function `timer_pending':
/usr/include/linux/timer.h:121: error: dereferencing pointer to incomplete type
In file included from /usr/include/linux/highmem.h:5,
from /usr/include/linux/skbuff.h:26,
from sk.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 sk.c:2:
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:57: error: syntax error before '*' token
/usr/include/asm/pgalloc.h: In function `get_pgd_slow':
/usr/include/asm/pgalloc.h:59: error: `pgd_t' undeclared (first use in this function)
/usr/include/asm/pgalloc.h:59: error: (Each undeclared identifier is reported only once
/usr/include/asm/pgalloc.h:59: error: for each function it appears in.)
/usr/include/asm/pgalloc.h:59: error: `pgd' undeclared (first use in this function)
/usr/include/asm/pgalloc.h:59: error: syntax error before ')' token
/usr/include/asm/pgalloc.h:62: error: `USER_PTRS_PER_PGD' undeclared (first use in this function)
/usr/include/asm/pgalloc.h:63: error: `swapper_pg_dir' undeclared (first use in this function)
/usr/include/asm/pgalloc.h:63: error: `PTRS_PER_PGD' undeclared (first use in this function)
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:70: error: syntax error before '*' token
/usr/include/asm/pgalloc.h: In function `get_pgd_fast':
/usr/include/asm/pgalloc.h:80: error: `pgd_t' undeclared (first use in this function)
/usr/include/asm/pgalloc.h:80: error: syntax error before ')' token
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:83: error: syntax error before '*' token
/usr/include/asm/pgalloc.h: In function `free_pgd_fast':
/usr/include/asm/pgalloc.h:85: error: `pgd' undeclared (first use in this function)
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:90: error: syntax error before '*' token
/usr/include/asm/pgalloc.h: In function `free_pgd_slow':
/usr/include/asm/pgalloc.h:99: error: `pgd' undeclared (first use in this function)
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:103: error: syntax error before '*' token
/usr/include/asm/pgalloc.h: In function `pte_alloc_one':
/usr/include/asm/pgalloc.h:105: error: `pte_t' undeclared (first use in this function)
/usr/include/asm/pgalloc.h:105: error: `pte' undeclared (first use in this function)
/usr/include/asm/pgalloc.h:109: error: syntax error before ')' token
/usr/include/asm/pgalloc.h:113: error: `_SC_CLK_TCK' undeclared (first use in this function)
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:118: error: syntax error before '*' token
/usr/include/asm/pgalloc.h: In function `pte_alloc_one_fast':
/usr/include/asm/pgalloc.h:127: error: `pte_t' undeclared (first use in this function)
/usr/include/asm/pgalloc.h:127: error: syntax error before ')' token
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:130: error: syntax error before '*' token
/usr/include/asm/pgalloc.h: In function `pte_free_fast':
/usr/include/asm/pgalloc.h:132: error: `pte' undeclared (first use in this function)
/usr/include/asm/pgalloc.h: At top level:
/usr/include/asm/pgalloc.h:137: error: syntax error before '*' token
/usr/include/asm/pgalloc.h: In function `pte_free_slow':
/usr/include/asm/pgalloc.h:139: error: `pte' undeclared (first use in this function)
/usr/include/asm/pgalloc.h: In function `flush_tlb_mm':
/usr/include/asm/pgalloc.h:183: error: `current' undeclared (first use in this function)
/usr/include/asm/pgalloc.h: In function `flush_tlb_page':
/usr/include/asm/pgalloc.h:190: error: dereferencing pointer to incomplete type
/usr/include/asm/pgalloc.h:190: error: `current' undeclared (first use in this function)
/usr/include/asm/pgalloc.h: In function `flush_tlb_range':
/usr/include/asm/pgalloc.h:197: error: `current' undeclared (first use in this function)
In file included from sk.c:2:
/usr/include/linux/skbuff.h: At top level:
/usr/include/linux/skbuff.h:100: error: syntax error before "spinlock_t"
/usr/include/linux/skbuff.h:120: error: syntax error before "atomic_t"
/usr/include/linux/skbuff.h:124: error: syntax error before '}' token
/usr/include/linux/skbuff.h:133: error: field `stamp' has incomplete type
/usr/include/linux/skbuff.h:183: error: syntax error before "atomic_t"
/usr/include/linux/skbuff.h:215: error: syntax error before '}' token

rch 03-20-2006 02:59 AM

give me your gcc version , and the prg? code

shrishailnk 03-20-2006 03:09 AM

i can tell u something but i dont know much abt it.
len : when u recv a pkt ,len field is set to size of complete input packet ,
as headers are removed and added len field will be changed accordingly.

data_len: is the num of bytes in fragment chain and in unmapped page buffers
and is normally zero

shrishailnk 03-20-2006 03:16 AM

can we allocate an sk_buff in a user program using alloc_skb()
If yes,
i'm getting many errors in header files (skbuff.h & slab.h)
and also "GFP_KERNEL" undefined

can u please help me

shrishailnk 03-20-2006 03:38 AM

#include<stdio.h>
#include<linux/slab.h>
#include<linux/skbuff.h>

int main( )
{
struct sk_buff *skb;
skb=(struct sk_buff *)alloc_skb(100,GFP_KERNEL);

if(skb)
printf("allocation success");

return 0;
}
gcc version : 3.3.2
I want to allocate an sk_buff and to mess with it
i forgot to mention : im having "GFP_KERNEL" undeclared first use in the function

paragn 03-20-2006 04:08 AM

hi,
u can use GFP_KERNEL only in Kernel Module. As its written in /usr/src/kernel-2.6.15/include/linux/slab.h which is kernel code and no user space implementaion for GFP_KERNEL

paragn 03-20-2006 04:20 AM

hi ,
As i already told you in your other question u cannot use GFP_KERNEL in user program.

david_ross 03-20-2006 12:42 PM

Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php

I've merged your threads.


All times are GMT -5. The time now is 03:22 AM.