Specifications
54 
Figure 16 Mandatory programming sentences 
The  provided  TCP/IP  stack  is  specifically  written  to  utilize  the  Realtek 
RTL8019AS  Network  Interface  Controller.    Since  the  network  controller  being 
used is not that Realtek model, the MAC.c file will need to be modified. 
The stack utilized the SRAM on the NIC as a holding buffer, until a higher level 
module reads it. It will also perform the IP checksum calculations in the SRAM of 
the  NIC.    This  MAC  layer  also  manages  its  own  transmit  queue.    Using  this 
queue, the caller can transmit a message and request the MAC to reserve it so 
// Declare this file as main application file 
#define THIS_IS_STACK_APPLICATION 
#include “StackTsk.h” 
#include “Tick.h” 
#include “dhcp.h” // Only if DHCP is used. 
#include “http.h” // Only if HTTP is used. 
#include “ftp.h” // Only if FTP is used. 
// Other application specific include files 
... 
// Main entry point 
void main(void) 
{ 
// Perform application specific initialization 
... 
// Initialize Stack components. 
// If StackApplication is used, initialize it too. 
TickInit(); 
StackInit(); 
HTTPInit(); // Only if HTTP is used. 
FTPInit(); // Only if FTP is used. 
// Enter into infinite program loop 
while(1) 
{ 
// Update tick count. Can be done via interrupt. 
TickUpdate(); 
// Let Stack Manager perform its task. 
StackTask(); 
// Let any Stack application perform its task. 
HTTPServer(); // Only if HTTP is used. 
FTPServer(); // Only if FTP is used. 
// Application logic resides here. 
DoAppSpecificTask(); 
} 
} 










