raw socket programming

Harti Brandt brandt at fokus.fraunhofer.de
Mon Jul 7 07:49:08 PDT 2003


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
-- 
harti brandt,
http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private
brandt at fokus.fraunhofer.de, harti at freebsd.org


More information about the freebsd-hackers mailing list