Embedded Web Server for the CR16
National Semiconductor
Jeff Wright
18
3.
Copy the protocol number to its transport layer interface for multiplexing purposes
4.
Flag the Application layer(s) that data has been received
5.
Delay itself by one tick to allow the application layer protocol(s) to run.
IPs API
Segment
Header
Segment
Pseudo Header
(not transmitted)
HTTP Header (RAM)
Embedded Web
page (FLASH)
"HTTP/1.0 200 OK\r\n
"Content-Type: text/html\r\n
Content-Length: ";
const UCHAR CBall_htm[] =
"\r\n\r\n<html>"
"\r\n<head><title>About the
CB</title>
...
"\r\n</html>\r\n\r\n";
PSEUDO_T TPTxPHd {...}
PSEUDO_T TPTxPHd {...}
TPTxPHd {...}
{...}
TCP_T TCPTxSeg {...}
IPAPI_T TNetIface {
}
IP
TCP
TCPAPI_T TCPapi {
}
HTTP
(TCPs API)
Figure 10. Application/TCP interlayer communication
B. The Transport Layer UDP
UDP is supported to facilitate limited NetBIOS, DNS, and WINS services. These applications
use UDP to send and receive service requests and responses. The User Datagram Protocol is
significantly simpler than its big brother TCP. In contrast, UDP is by definition a
connectionless transport protocol. This means that UDP establishes no connection with the
peer prior to sending or receiving datagrams, and that no state information is maintained to
ensure reliable delivery of these datagrams. The UDP layer interfaces with applications in a
manner similar to TCP. Its interface structure is defined in Figure 11.
typedef struct udpapi_t{
UWORD LocPort; /* Our Port number */
UWORD ForPort;
/* Peers Port number
*/
QUADB_T LocIP; /* Structure holding local and Dest IP */
QUADB_T ForIP;
/* addresses
*/
UWORD Cmd; /* Application Command
*/
UWORD Status; /* Holds the Status of the UDP */
UBYTE *RxBuf; /* Pointers to the Rx and Tx buffers */
UWORD RxCount; /* Number of bytes recd */