Specifications

Note: There is no error checking in this example. In a real application, you might need to return -1 on
error.
The prototype is defined in <iniche path>/src/nios2/osport.h. You can include this header file as follows:
#include "osport.h"
You can find other details of the OS porting layer in the osport.c file in the NicheStack TCP/IP Stack
component directory, <iniche path>/src/nios2/.
Related Information
Using the NicheStack TCP/IP Stack - Nios II Edition Tutorial
For more information about how to use TK_NEWTASK() in an application.
Configuring the NicheStack TCP/IP Stack in a Nios II Program
The NicheStack TCP/IP Stack has many options that you can configure using #define directives in the
file ipport.h. The Nios II EDS allows you to configure certain options (that is, modify the #defines in
system.h) without editing source code. The most commonly accessed options are available through a set of
BSP options, identifiable by the prefix altera_iniche.
Some less-frequently-used options are not accessible through the BSP settings. If you need to modify these
options, you must edit the ipport.h file manually.
You can find ipport.h in the debug/system_description directory for your BSP project.
The following sections describe the features that you can configure using the Nios II SBT. Both develop‐
ment flows provide a default value for each feature. In general, these values provide a good starting point,
and you can later fine-tune the values to meet the needs of your system.
NicheStack TCP/IP Stack General Settings
The ARP, UDP, and IP protocols are always enabled.
Table 11-1: Protocol Options
Option Description
TCP Enables and disables the TCP.
Table 11-2: Global Options
Option Description
Use DHCP to
automatically
assign IP address
If this option is turned on, the component uses DHCP to
acquire an IP address. If this option is turned off, you
must assign a static IP address.
Enable statistics If this option is turned on, the stack keeps counters of
packets received, errors, etc. The counters are defined in
mib structures defined in various header files in directory
<iniche path>/src/downloads/30src/h.
For details about mib structures, refer to the NicheStack
documentation.
11-8
Configuring the NicheStack TCP/IP Stack in a Nios II Program
NII5V2
2015.05.14
Altera Corporation
Ethernet and the NicheStack TCP/IP Stack - Nios II Edition
Send Feedback