Network Control Initialization Procedure (NETCTRL)
4-20
6) Under normal operation, the network does not shutdown until the
NC_NetStop() function is called. At some point after a call to
NC_NetStop(), the original NC_NetStart() thread calls the user supplied
callback function for the “stop” operation. In this callback function, the
application shuts down any operation it initiated in the “start” callback
function and frees any allocated resources. After the “stop” callback
function returns, TCP/IP stack functionality is no longer available.
7) The original call to NC_NetStart() returns with the return value as set by
the return parameter passed in the call to NC_NetStop(). The application
can immediately reboot the TCP/IP stack by calling NC_NetStart() again
with or without reloading a new configuration. This is useful for a reboot”
command.
When the system is ready for a final shutdown, the following actions are per-
formed:
8) When NC_NetStart() returns and the session is over, call the CfgFree()
function to free the configuration handle created with CfgNew().
9) After all resources have been freed, call the NC_SystemClose() function
to complete the system shutdown.
4.3.3
Function Overview
The system initialization access functions (in functional order) are as follows:
NC_SytemOpen()
Initiate a system session
NC_SystemClose()
Full system shutdown
NC_NetStart()
Start the network with a supplied configuration
NC_NetStop()
Halt the network, and pass a return code the
caller of the NC_NetStart() function.
4.3.4
Network Control (NC) API Functions
Start Network
NC_NetStart
Syntax
int NC_NetStart( HANDLE hCfg,
void (*NetStartCb)(), void (*NetStopCb)(),
void (*NetIPCb)(IPN,uint,uint) );
Parameter(s)
hCfg
Handle to network configuration
NetStartCb
Pointer to callback function called when network is started
NetStopCb
Pointer to callback function called when network is stopped