Before you compile the portable TCP/IP stack files you should create a version of the file
that is appropriate for your target system. An inspection of the NicheStack source code will show that many of the C language source files include a file named
.
is intended to contain not only the IP layer's port dependent definitions, but all the architectural definitions for all the IP related code. CPU architectures (big vs. little endian), compiler idiosyncrasies and optional features (DHCP, multiple interfaces, IP routing support) are controlled in this file.
is one of the target system include files that are copied to the h directory and thus should not be edited directly. See the section titled
for instructions on how to deal with files of this type.
. Remember, the modifications described in this section should be made to the file named ipport.h_h that exists in your target system dependent directory, not to any file named
.
Some aspects of a particular target system cannot be easily localized into a single source code directory. These are represented in include files that are included by source files contained in both target system independent and target system dependent directories.
ipport.h_h
, which is discussed in greater detail later, is the most widely included example of files of this type but there are others.
Different versions of these target system include files are appropriate for different target systems. Therefore each target system dependent directory contains a set of these files that is appropriate for that specific target system. For example, the
dosmain
directory contains a version of
ipport.h_h
that is appropriate for 16 bit real mode DOS targets and the
net186
directory contains a different version of
ipport.h_h
that is appropriate for Net186 board targets. In order to avoid compilation problems that could be introduced by the presence of multiple include files with the same name in the same source tree, these target system include files, as they exist in the target system directories, are named using the file name suffix
.h_h
instead of the conventional
.h
.
For development environments using "make" or a similar utility, the makefile in each of these target system directories should copies the
.h_h
versions of these files from that target directory to a directory named
h
, changing the extension from
.h_h
to
.h
in the process. Thus when the C compiler encounters a directive to include, for example,
ipport.h
in a source file, there is only one instance of
ipport.h
in the source tree and therefore the same
ipport.h
will be included by each source file that includes it, independent of the include search path that has been specified to the compiler.
This scheme has some ramifications for porting engineers. The principal one being that if, during the course of a port, it is found to be necessary to modify one of these target system include files, the place to make the modification is NOT in the
.h
version of the file that resides in the
h
directory, but in the
.h_h
version of the file that resides in the target system dependent directory. All files that end up in the
/h
directory should be considered to be transient files like object files. No modifications should be made to them directly.
Modifications made to the
.h
include files that reside in the
h
directory
WILL BE LOST.
For example, if you were porting the stack to an AMD Net186 target system and found it necessary to modify a defined constant in
ipport.h
, the file in which to make the change would be
/net186/ipport.h_h
, not
/h/ipport.h
.
This documentation suggests that I edit the ipport.h_h in my target system dependent directory. However the only other version of ipport.h_h I've found on my computer lives in the quartus install path. Editing this file has no effect on the ipport.h that gets included in my project.
So my question becomes. Where can I find this ipport.h_h file?