Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 Jul 2003 06:01:03 +0300
From:      Alin-Adrian Anton <aanton@reversedhell.net>
To:        Harti Brandt <brandt@fokus.fraunhofer.de>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: raw socket programming SOLVED
Message-ID:  <3F0790EF.10407@reversedhell.net>
In-Reply-To: <20030707164832.L49607@beagle.fokus.fraunhofer.de>
References:  <0193271C683D5844A478A359271B8F66147AD8@DC1.dynatec.com> <3F07860E.9060702@reversedhell.net> <20030707162900.B49607@beagle.fokus.fraunhofer.de> <3F078DC9.3080708@reversedhell.net> <20030707164832.L49607@beagle.fokus.fraunhofer.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Harti Brandt wrote:

>On Sun, 6 Jul 2003, Alin-Adrian Anton wrote:
>
>AA>Harti Brandt wrote:
>AA>
>AA>>On Sun, 6 Jul 2003, Alin-Adrian Anton wrote:
>AA>>
>AA>>AA>>>In file included from raw.c:7:
>AA>>AA>>>/usr/include/netinet/ip.h:156: syntax error before `n_long'
>AA>>AA>>>/usr/include/netinet/ip.h:159: syntax error before `n_long'
>AA>>
>AA>>You may want to include <netinet/in_systm.h>
>AA>>
>AA>>harti
>AA>>
>AA>>
>AA>
>AA>Yes, indeed this solves the n_long problem. This is how my include list
>AA>looks now:
>AA>
>AA>#include <sys/types.h>
>AA>#include <sys/socket.h>
>AA>#include <stdio.h>
>AA>#include <string.h>
>AA>#include <errno.h>
>AA>#include <netinet/in_systm.h>
>AA>#include <netinet/ip.h>
>AA>#include <netinet/in.h>
>AA>#include <unistd.h>
>AA>#include <netinet/tcp.h>
>AA>
>AA>And this is what I get when trying to compile:
>AA>
>AA>beast# cc -o raw raw.c
>AA>In file included from raw.c:7:
>AA>/usr/include/netinet/ip.h:73: field `ip_src' has incomplete type
>AA>/usr/include/netinet/ip.h:73: field `ip_dst' has incomplete type
>AA>/usr/include/netinet/ip.h:158: field `ipt_addr' has incomplete type
>AA>beast#
>
>Try to swap ip.h and in.h (in.h declares struct in_addr).
>
>harti
>  
>
Yes, it works now, with these includes:
-------------------------------
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>

#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>

#include <unistd.h>
#include <netinet/tcp.h>
-------------------------------

Thank you very much everybody!

Best Regards,
Alin.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F0790EF.10407>