Including System Headers from /usr/include

Hi,

I would like to use Arduino IDE to program an ESP8266 microcontroller, using some header files I generated from ASN.1 code (a language used to describe protocols and structures). These are about 400 C header and source files that use the system headers found in /usr/include on a Unix file system. As there are so many of these files, I am reluctant to change them. However as far as I can see, the headers they use, for example /usr/include/netinet/in.h are not included in the avr-libc modules. Is this correct?

My question is this: is it possible to include header files from /usr/include in an Arduino sketch, for the ESP8266?

Thanks,

Alex

where would the implementation be though? header is just header...

J-M-L:
where would the implementation be though? header is just header...

What do you mean by implementation?

I would like to compile it for and run it on the ESP8266.

/usr/include is C definitions for the HOST C compiler, and you DON'T want to search that directory when cross-compiling for some other chip.

as far as I can see, the headers they use, for example /usr/include/netinet/in.h are not included in the avr-libc modules.

netitnet specifically contains a fair amount of stuff that is specific to unix, that isn't going to be available on either AVR or ESP8266 (it also contains a bunch of stuff that isn't OS-dependent, which is unfortunate.

There have been some prior discussions of SNMP on Arduino. You might want to search for those...

Thanks for your advice. I suspected this might be the case...

SNMP looks interesting although unfortunately my aim is to implement the protocol described by the ASN.1-derived C code on a WiFi network, so although SNMP may be a useful protocol, I don't think it would solve my problem.

Do you know of any libraries for Arduino that can "replace" parts or all of /usr/include, for example to replace netinet/in.h in a like-for-like manner?

No, I don't. (they might exist.)

I would import an inet.h from unix, aggressively edit it to get rid of OS-dependent stuff, and see what errors your attempted compile spits out. It's pretty standard in the unix world to include a long list of things to end up getting ONE constant :frowning: "I included netinet/in.h, which include sys/socket.h and machein/endian.h and sys/appleapiopts.h. when all I really needed was lPPROTO_ICMP"