From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 7 08:09:00 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E08AA37B401 for ; Mon, 7 Jul 2003 08:09:00 -0700 (PDT) Received: from grouse.mail.pas.earthlink.net (grouse.mail.pas.earthlink.net [207.217.120.116]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C37943F75 for ; Mon, 7 Jul 2003 08:09:00 -0700 (PDT) (envelope-from dgobeille@earthlink.net) Received: from cpe-66-87-106-157.il.sprintbbd.net ([66.87.106.157] helo=earthlink.net) by grouse.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 19ZXbp-0006gd-00; Mon, 07 Jul 2003 08:08:53 -0700 Message-ID: <3F098D11.2070802@earthlink.net> Date: Mon, 07 Jul 2003 10:09:05 -0500 From: "David A. Gobeille" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alin-Adrian Anton 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> <3F0790EF.10407@reversedhell.net> In-Reply-To: <3F0790EF.10407@reversedhell.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: raw socket programming SOLVED X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2003 15:09:01 -0000 Alin-Adrian Anton wrote: > 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 >> 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 >> AA>#include >> AA>#include >> AA>#include >> AA>#include >> AA>#include >> AA>#include >> AA>#include >> AA>#include >> AA>#include >> 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 > #include > #include > #include > #include > > #include > #include > #include > > #include > #include > ------------------------------- > > Thank you very much everybody! > > Best Regards, > Alin. Shouldn't the #included files themselves #include headers they are dependant on? With the use of #ifndef and #define in the headers to keep them from being #included more than once? It seems silly(more work) for the programmer to have to arrange everything in a specific order. -- Dave