NicheLite™ TCP/IP Stack*
User Reference

* As adapted for Freescale's 32-bit ColdFire Microprocessors


51 E. Campbell Ave
Suite 160
Campbell, CA.  95008
Copyright © 1995-2006
InterNiche Technologies Inc.
email: Support@iNiche.com
http://www.iniche.com
support: 408.540.1160 ext: 218
fax: 408.540.1161

InterNiche Technologies Inc. has made every effort to assure the accuracy of the information contained in this documentation. We appreciate any feedback you may have for improvements. Please send your comments to support@iniche.com.

The software described in this document is furnished under a license and may be used, or copied, only in accordance with the terms of such license.

Revised: March 31, 2006

Portions of the InterNiche source code are provided under the copyright of the respective owners and are also acknowledged in the appropriate source files:

Copyright © 1995-2006 by InterNiche Technologies, Inc.

All Rights Reserved

Trademarks

NicheLite™, NicheStack™, NicheStack™ and FreeRTOS.com™ are trademarks of InterNiche Technologies, Inc.

All terms mentioned in this document that are known to be service marks, tradenames, trademarks, or registered trademarks are property of their respective holders and have been appropriately capitalized. InterNiche Technologies Inc. cannot attest to the complete accuracy of this information. The use of a term in this document should not be regarded as affecting the validity of any service mark, tradename, trademark, or registered trademark.

Table of Contents

1. OVERVIEW
1.1 Terms and Conventions
1.2 TCP/IP Stack Source Code Organization
1.2.1 Target System Independent Directories
1.2.2 Target System Dependent Directories
1.2.3 Other Product Directories
1.2.4 Target System Include Directory "h"
1.2.5 Portable Files vs. Port Dependent Files
1.3 Overview of NicheLite Stack Source Code Files
1.3.1 Why Not Modify Portable Files?
1.3.2 mip Directory Source Files
1.3.3 net Directory Source Files
1.3.4 h Directory Source Files
1.3.5 mtcp Directory Source Files
1.3.6 misclib Directory Source Files
2. BACKGROUND INFORMATION
2.1 Error Codes
2.2 Data Structures
2.2.1 The netbuf Structure and the Packet Queues
2.2.2 The net Structure, the nets[] Array, and the netlist
2.3 Initialization
2.3.1 Initialization of net Structure IP Addressing Fields
2.3.2 Initialization of the Packet Buffer Queue Sizes
2.3.3 Initialization of the IP and TCP Layers: ip_startup()
2.3.4 Dynamic Internet Configuration with DHCP
2.3.5 Initialization of Application Servers
3. FUNCTIONS (1)
3.1 Port Tailored Functions
port_prep
npalloc()
npfree()
dtrap()
dprintf()
initmsg()
dputchar()
kbhit()
getch()
ENTER_CRIT_SECTION()
EXIT_CRIT_SECTION()
panic()
sysuptime()
3.2
etainit()
make_arp_entry()
arprcv()
3.3
ip_write()
ip2mac()
ip_mymach()
ip_rcv()
parse_ipad()
print_ipad()
pk_alloc()
pk_free()
3.4 ICMP
icmprcv()
icmp_destun()
icmpEcho()
3.5 UDP
udp_send()
udp_alloc()
udp_free()
udpdemux()
udp_open()
udp_close()
3.6 MISCLIB
ns_printf()
4. MINI-SOCKETS TCP API
4.1 TCP API Callbacks
4.2 Similarities to BSD Sockets
4.3 Data Types
M_SOCK
M_CALLBACK
PACKET
sockaddr_in
4.4 Mini-Socket Function Descriptions
m_socket()
m_connect()
m_listen()
tcp_send()
tcp_recv()
m_ioctl()
m_close()
tcp_pktalloc()
tcp_pktfree()
m_send()
m_recv()
5. TFTP
5.1 TFTP Menu Commands
5.2 TFTP State Values
5.3 TFTP Server Packet Types
5.4 TFTP Error Codes
5.5 TFTP Error Text Values Specified by ERRTXT
1. OVERVIEW
1.1 Terms and Conventions
1.2 TCP/IP Stack Source Code Organization
1.2.1 Target System Independent Directories
1.2.2 Target System Dependent Directories
1.2.3 Other Product Directories
1.2.4 Target System Include Directory "h"
1.2.5 Portable Files vs. Port Dependent Files
1.3 Overview of NicheLite Stack Source Code Files
1.3.1 Why Not Modify Portable Files?
1.3.2 mip Directory Source Files
1.3.3 net Directory Source Files
1.3.4 h Directory Source Files
1.3.5 mtcp Directory Source Files
1.3.6 misclib Directory Source Files
2. BACKGROUND INFORMATION
2.1 Error Codes
2.2 Data Structures
2.2.1 The netbuf Structure and the Packet Queues
2.2.2 The net Structure, the nets[] Array, and the netlist
2.3 Initialization
2.3.1 Initialization of net Structure IP Addressing Fields
2.3.2 Initialization of the Packet Buffer Queue Sizes
2.3.3 Initialization of the IP and TCP Layers: ip_startup()
2.3.4 Dynamic Internet Configuration with DHCP
2.3.5 Initialization of Application Servers
3. FUNCTIONS (1)
3.1 Port Tailored Functions
port_prep
npalloc()
npfree()
dtrap()
dprintf()
initmsg()
dputchar()
kbhit()
getch()
ENTER_CRIT_SECTION()
EXIT_CRIT_SECTION()
panic()
sysuptime()
3.2 ARP
etainit()
make_arp_entry()
arprcv()
3.3 IP
ip_write()
ip2mac()
ip_mymach()
ip_rcv()
parse_ipad()
print_ipad()
pk_alloc()
pk_free()
3.4 ICMP
icmprcv()
icmp_destun()
icmpEcho()
3.5 UDP
udp_send()
udp_alloc()
udp_free()
udpdemux()
udp_open()
udp_close()
3.6 MISCLIB
ns_printf()
4. MINI-SOCKETS TCP API
4.1 TCP API Callbacks
4.2 Similarities to BSD Sockets
4.3 Data Types
M_SOCK
M_CALLBACK
PACKET
sockaddr_in
4.4 Mini-Socket Function Descriptions
m_socket()
m_connect()
m_listen()
tcp_send()
tcp_recv()
m_ioctl()
m_close()
tcp_pktalloc()
tcp_pktfree()
m_send()
m_recv()
5. TFTP
5.1 TFTP Menu Commands
5.2 TFTP State Values
5.3 TFTP Server Packet Types
5.4 TFTP Error Codes
5.5 TFTP Error Text Values Specified by ERRTXT
6.0 OVERVIEW
6.1 COMMAND DESCRIPTIONS
6.1.1 The InterNiche Console
6.1.2 Runtime Commands
6.2 GENERAL COMMANDS
6.2.1 Help
6.2.2 General
6.3 DIAGNOSTIC COMMANDS
6.3.1 Statistics - define NET_STATS in ipport.h
6.3.2 DNS - define DNS_CLIENT and NET_STATS in ipport.h
6.3.3 TCP - define INCLUDE_TCP and NET_STATS in ipport.h
6.3.4 Memory - define MEM_BLOCKS in ipport.h

Table of Chapters