Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > What's wrong with linux/if.h and net/if.h?

Reply
Thread Tools

What's wrong with linux/if.h and net/if.h?

 
 
fish
Guest
Posts: n/a
 
      01-06-2012
In my project, I include pfring.h, but compile error: some functions
in net/if.h and linux/if.h are redefinition. I found that the pfring.h
include linux/if.h So, I test a program, my test code:

#include <linux/if.h>
#include <net/if.h>

int main(void) {
return 0;
}
It expected compile error. So, what's wrong with linux/if.h and net/
if.h ? Can not I include them at once?

error message:
===========================
In file included from test.c:1:0:
/usr/include/linux/if.h:178:19: error: field 'ifru_addr' has
incomplete type
/usr/include/linux/if.h:179:19: error: field 'ifru_dstaddr' has
incomplete type
/usr/include/linux/if.h:180:19: error: field 'ifru_broadaddr' has
incomplete type
/usr/include/linux/if.h:181:19: error: field 'ifru_netmask' has
incomplete type
/usr/include/linux/if.h:182:20: error: field 'ifru_hwaddr' has
incomplete type
In file included from test.c:2:0:
/usr/include/net/if.h:45:5: error: expected identifier before numeric
constant
/usr/include/net/if.h:112:8: error: redefinition of 'struct ifmap'
/usr/include/linux/if.h:136:8: note: originally defined here
/usr/include/net/if.h:127:8: error: redefinition of 'struct ifreq'
/usr/include/linux/if.h:170:8: note: originally defined here
/usr/include/net/if.h:177:8: error: redefinition of 'struct ifconf'
/usr/include/linux/if.h:219:8: note: originally defined here
 
Reply With Quote
 
 
 
 
Jorgen Grahn
Guest
Posts: n/a
 
      01-06-2012
On Fri, 2012-01-06, fish wrote:
> In my project, I include pfring.h, but compile error: some functions
> in net/if.h and linux/if.h are redefinition. I found that the pfring.h
> include linux/if.h So, I test a program, my test code:

....

Wrong group; try comp.os.linux.networking or
comp.os.linux.development.system.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      01-06-2012
On 01/ 6/12 09:11 PM, fish wrote:
> In my project, I include pfring.h, but compile error: some functions
> in net/if.h and linux/if.h are redefinition. I found that the pfring.h
> include linux/if.h So, I test a program, my test code:
>
> #include<linux/if.h>
> #include<net/if.h>


You really should ask this on a Linux programming group.

--
Ian Collins
 
Reply With Quote
 
Goran
Guest
Posts: n/a
 
      01-06-2012
On Jan 6, 9:11*am, fish <(E-Mail Removed)> wrote:
> In my project, I include pfring.h, but compile error: some functions
> in net/if.h and linux/if.h are redefinition. I found that the pfring.h
> include linux/if.h So, I test a program, my test code:
>
> #include <linux/if.h>
> #include <net/if.h>
>
> int main(void) {
> * * return 0;}
>
> It expected compile error. So, what's wrong with linux/if.h and net/
> if.h ? Can not I include them at once?
>
> error message:
> ===========================
> In file included from test.c:1:0:
> /usr/include/linux/if.h:178:19: error: field 'ifru_addr' has
> incomplete type


Off the top of my head.. ifru_addr is sockaddr, so try including sys/
socket.h (sockaddr should be defined there) before linux/if.h

If that's your problem, then I'd say that linux/if.h is broken. You
should be able to include it anywhere and expect stuff to work.

Goran.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PIX 501 and PAT going to wrong host Concerned Citizen Cisco 0 08-26-2005 02:17 PM
Simulation and realworld problem in design - what is wrong? Preben Holm VHDL 6 04-25-2005 04:25 PM
Is XML Doc wrong or is Schema wrong? (or both) Matthew XML 7 01-07-2005 10:05 PM
Whats wrong with .net passport and IE =?Utf-8?B?S2ViaXNob3AzMQ==?= MCSE 2 10-14-2004 01:59 PM
swinging and nudity is WRONG and immoral Steve Young Digital Photography 10 11-10-2003 04:14 PM



Advertisments