I have written kernel(2.4) module to communicate with user application using
"Netlink Socket".
I am getting compilation error "Dereferenc ing 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
6 3689 gpraghuram 1,275
Recognized Expert Top Contributor
Hi,
What is the type of data(skb->data)?
Raghu
Hi,
What is the type of data(skb->data)?
Raghu
Data type is "struct sk_buff"
JosAH 11,448
Recognized Expert MVP
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
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 "dereferenc ing pointer ...." and also some macros are not declared.
Why i cant include these headers file. Plz help me Sir.
Thanking u
Shashidhara HN
JosAH 11,448
Recognized Expert MVP
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 "dereferenc ing 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
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
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 to pass both as "void *buf" so that it can accept any data type.
But since I access the buffer and try to assign its elements to another
I get compile errors (I have pasted at the end).
Now my question is how can I pass the i/p and o/p buffers...
|
by: Neo |
last post by:
Hi Folks,
#include<stdio.h>
int main()
{
int (*p);
int arr;
int i;
|
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 = {0,1,2,4,9};
|
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 integer constant expression with the value 0, or such an expression
cast to type void *, is called a null pointer constant.55)
If a null pointer constant is converted to a pointer type, the resulting
pointer, called a null pointer, is guaranteed...
|
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.
I have a struct like:
struct node {
| |
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 *ipc_graph_pointer;
|
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 = find_task_by_id(getpid());
7. printf("%s",my->comm); error: dereferencing pointer to incomplete
type
|
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), "ctx->statemachine != NULL",
TRUE);
backend_sm_check_globals(check);
|
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 initialization stuff */
struct adapter_struct *adapter = netdev_priv(netdev);
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |