# error ip.h:178???



## void** (Nov 11, 2005)

Hi there!

I coded serveral programs using raw sockets under debian. Now i tried to using mac osx but i got these errors:

/usr/include/netinet/ip.h:178: error: parse error before "n_long"
/usr/include/netinet/ip.h:181: error: parse error before "n_long"
/usr/include/netinet/ip.h:183: error: parse error before '}' token
/usr/include/netinet/ip.h:184: error: parse error before '}' token

there are just includes and a null returning main(). I started to google but without a result. Any ideas?


----------



## kainjow (Nov 11, 2005)

I read somewhere that you're missing a 
	
	



```
#include <netinet/ip_systm>
```
? Not sure if that exists on Mac OS X.. since Debian is Linux based and not BSD based (uh I think), you may have to change some things around... but I don't really know much about porting *nix codes around 

Also, at http://archive.netbsd.se/?ml=snort-devel&a=2004-10&t=392066 someone says 





> It looks like it was built on a linux system so the TCP data structures don't map 1-to-1 over to *BSD systems.  It's also missing an include file before netinet/ip.h for the definition of n_long, looks like it needs in_systm.h on OS X.



Take a look at http://www.spymac.com/forums/showthread.php?threadid=134316&goto=lastpost - the exact same problem is described, and with a solution.


----------



## void** (Nov 11, 2005)

Yes, thats what i read 

Now i solved the problem, i think these are the headers you need to include:

#include <arpa/inet.h>
#include <netinet/in_systm.h>
#include <netinet/tcp.h>
#include <netinet/in.h>
#include <netinet/ip.h>

but don´t change the order .... or you´ll get awful errors 
so after hours of searchin the answer i´m tierd of programming, so i´m going to meet a friend and have some beeeeeeeeeeeeeeeeeeeer 

Thx, have a nice weekend


----------

