Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(ARM).Porting TCP-IP programmer's guide.Ver 1.4.pdf
Скачиваний:
31
Добавлен:
23.08.2013
Размер:
2.79 Mб
Скачать

Example Applications

12.2Example descriptions

The following sections contain detailed descriptions of each example application.

The four demonstration projects that are shipped with the sources are:

chargen a simple server application

loopback demonstrates the use of the loopback drivers for benchmarking

maildemo an implementation of a simple SMTP client that sends an email message

menus an interactive menus system that is useful for debugging during porting work.

12.2.1chargen

The chargen project provides a simple demonstration of how to implement a server. The chargen server listens for connections on TCP port 19. When a connection is established, chargen continuously sends lines of test data (a swirling printer test pattern, with line numbers). When the connection is closed, the chargen server returns to waiting for connections.

12.2.2loopback

The loopback project is provided only for benchmarking purposes and requires a UNIX-like shell, such as bash, to produce useful results. When built, 16 .axf files are created. These represent all the permutations of ARM versus Thumb, PPP versus MAC, big-endian versus little-endian, and TCP versus UDP.

The shell script runtest runs armsd on each of these .axf files, with the armsd.ini file, to obtain performance measurements. When completed, runtest creates a file, results.txt, containing a table of results. This table can be processed using the Perl script process.pl to obtain a table of throughput figures for the various combinations of ARM/Thumb, PPP/MAC, big-endian/little-endian, and TCP/UDP. The figures in the table are a measurement of throughput in Kbits per second per MHz of CPU.

ARM DUI 0079B

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

12-5

Example Applications

12.2.3maildemo

The maildemo project demonstrates how to write a simple client program. This client:

connects to the SMTP port (TCP port 25) of a known mail server

exchanges some messages with the sendmail that is listening on that port

sends an email message to a preconfigured destination.

The mail server’s IP address and the To: and From: addresses of the email message are configured by modifying the values defined near the top of \maildemo\main.c before you build the project.

12.2.4menus

The menus project is intended as a debugging aid during your porting. It presents a menu of options that allow you to exercise different sections of the stack in a controlled manner.

The menus project cannot be used with the debug console because menus relies on being able to poll the keyboard for data and RDI does not support this operation. To work around this limitation, the UART driver is used as a debug interface by including ttyio.c and uart.c in the project, and by configuring ipport.h to map the print functions onto those implemented as functions in ttyio.c and uart.c.

12-6

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

ARM DUI 0079B