473,382 Members | 1,225 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Dereferencing pointer to incomplete type

I have written kernel(2.4) module to communicate with user application using
"Netlink Socket".
I am getting compilation error "Dereferencing pointer to incomplete type"
in kernel module for "nlh = (struct nlmsghdr *) skb->data" line and also
not able include "net/sock.h" header file.

plz help me how can solve this


Thanks
shashidhara
Jul 1 '08 #1
6 3628
gpraghuram
1,275 Expert 1GB
Hi,
What is the type of data(skb->data)?

Raghu
Jul 1 '08 #2
Hi,
What is the type of data(skb->data)?

Raghu

Data type is "struct sk_buff"
Jul 1 '08 #3
JosAH
11,448 Expert 8TB
Data type is "struct sk_buff"
And what is the type of your variable 'skb'? Because that's the one you're dereferencing
and the compiler objects agains that becasuse it seems to an incomplete type,
i.e. it is declared but not defined somewhere.

kind regards,

Jos
Jul 1 '08 #4
data type is "struct sk_buff".
This is defined in linux/skbuff.h header file.

I am not able to include linux/skbuff.h and net/sock.h header files.
If i include these header files ,i will get many errors like "dereferencing pointer ...." and also some macros are not declared.

Why i cant include these headers file. Plz help me Sir.


Thanking u
Shashidhara HN
Jul 1 '08 #5
JosAH
11,448 Expert 8TB
data type is "struct sk_buff".
This is defined in linux/skbuff.h header file.

I am not able to include linux/skbuff.h and net/sock.h header files.
If i include these header files ,i will get many errors like "dereferencing pointer ...." and also some macros are not declared.

Why i cant include these headers file. Plz help me Sir.
You have to find *other* .h files that define the structures and types and include
the linux/skbuff.h etc. files themselves. Always try to find the files highest in the
hierarchy, i.e. stay away as much as possible from the 'linux' subdirectory.
'grep' and 'man' are your friends here.

kind regards,

Jos
Jul 1 '08 #6
You have to find *other* .h files that define the structures and types and include
the linux/skbuff.h etc. files themselves. Always try to find the files highest in the
hierarchy, i.e. stay away as much as possible from the 'linux' subdirectory.
'grep' and 'man' are your friends here.

kind regards,

Jos

Thanks a lot sir, I got It.

--
Shashidhara HN
Jul 2 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Pushkar Pradhan | last post by:
I have some functions which take as i/p a buffer (it can be float, char, or 16 bit, int etc.). The result is another o/p buffer, its type is also flexible (it could be a float, char etc.). I try...
22
by: Neo | last post by:
Hi Folks, #include<stdio.h> int main() { int (*p); int arr; int i;
204
by: Alexei A. Frounze | last post by:
Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include <stdio.h> int aInt2 = {0,1,2,4,9,16}; int aInt3 =...
41
by: Alexei A. Frounze | last post by:
Seems like, to make sure that a pointer doesn't point to an object/function, NULL (or simply 0) is good enough for both kind of pointers, data pointers and function pointers as per 6.3.2.3: 3 An...
5
by: Steven | last post by:
Hello, I get the following message during compilation: `dereferencing pointer to incomplete type' It stems from the compare function I use with qsort() and I am not quite sure how to fix it....
8
by: friend.05 | last post by:
I have three files. graph.h: My header file where I have typedef for my structure and function delcaration typedef struct _ipc_actors ipc_graph_actors; typedef ipc_graph_type...
4
by: Pritam | last post by:
line 7: error: dereferencing pointer to incomplete type 1. #include<stdio.h> 2. #include<sys/stat.h> 3. #include<stdlib.h> 4. void execname() { 5. struct task_struct *my; 6. my =...
5
by: tejesh | last post by:
I am trying to compile the following code int backend_sm_run(struct interface_data *ctx) { xsup_assert((ctx != NULL), "ctx != NULL", TRUE); xsup_assert((ctx->statemachine != NULL),...
5
by: Anuz | last post by:
Hi all, While compiling a driver, I am getting this error: error: dereferencing pointer to incomplete type int __kc_adapter_clean(struct net_device *netdev, int *budget) { /*some...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.