LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-20-2006, 01:37 AM   #1
shrishailnk
Member
 
Registered: Mar 2006
Posts: 47

Rep: Reputation: 15
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
 
Old 03-20-2006, 03:59 AM   #2
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
give me your gcc version , and the prg? code
 
Old 03-20-2006, 04:09 AM   #3
shrishailnk
Member
 
Registered: Mar 2006
Posts: 47

Original Poster
Rep: Reputation: 15
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
 
Old 03-20-2006, 04:16 AM   #4
shrishailnk
Member
 
Registered: Mar 2006
Posts: 47

Original Poster
Rep: Reputation: 15
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
 
Old 03-20-2006, 04:38 AM   #5
shrishailnk
Member
 
Registered: Mar 2006
Posts: 47

Original Poster
Rep: Reputation: 15
#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
 
Old 03-20-2006, 05:08 AM   #6
paragn
Member
 
Registered: Jan 2006
Distribution: Red Hat EL5, Fedora 7
Posts: 259

Rep: Reputation: 30
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
 
Old 03-20-2006, 05:20 AM   #7
paragn
Member
 
Registered: Jan 2006
Distribution: Red Hat EL5, Fedora 7
Posts: 259

Rep: Reputation: 30
hi ,
As i already told you in your other question u cannot use GFP_KERNEL in user program.
 
Old 03-20-2006, 01:42 PM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why skbuff.h different for 2.4 and 2.6 kernels? linux_lover2005 Programming 1 03-20-2006 05:54 AM
Tomcat Related Problem finattack Linux - Networking 0 04-04-2005 04:01 PM
samba related problem-------- pal Linux - Newbie 4 03-13-2005 04:31 AM
How to use skbuff to scan every byte of the payload of an UDP packet? sceadu Programming 0 11-03-2004 10:34 PM
Having a theme related problem BmxFace Linux - General 6 07-01-2003 02:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration