Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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
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
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
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.