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

Porting TCP/IP

Version 1.4

Programmer’s Guide

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

ARM DUI 0079B

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

Release Information

The following changes have been made to this document.

 

 

Change History

 

 

 

Date

Issue

Change

 

 

 

October 1998

A

First release

 

 

 

June 1999

B

Second release, changes reflect software revision 1.4

 

 

 

Proprietary Notice

ARM, the ARM Powered logo, Thumb, and StrongARM are registered trademarks of ARM Limited.

The ARM logo, AMBA, PrimeCell, Angel, ARMulator, EmbeddedICE, ModelGen, Multi-ICE, ARM7TDMI, ARM7TDMI-S, ARM9TDMI, TDMI, and STRONG are trademarks of ARM Limited.

All other products or services mentioned herein may be trademarks of their respective owners.

Neither the whole nor any part of the information contained in, or the product described in, this document may be adapted or reproduced in any material form except with the prior written permission of the copyright holder.

The product described in this document is subject to continuous development and improvements. All particulars of the product and its use contained in this document are given by ARM in good faith. However, all warranties implied or expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded.

This document is intended only to assist the reader in the use of the product. ARM Ltd shall not be liable for any loss or damage arising from the use of any information in this document, or any error or omission in such information, or any incorrect use of the product.

ii

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

ARM DUI 0079B

Contents

Programmer’s Guide

Preface

 

 

About this book .............................................................................................

viii

 

 

Feedback ........................................................................................................

xi

Chapter 1

Introduction

 

 

1.1

A typical embedded networking stack ..........................................................

1-2

 

1.2

What is PPP? ...............................................................................................

1-4

 

1.3

ARM TCP/IP requirements ...........................................................................

1-7

 

1.4

ARM PPP requirements .............................................................................

1-12

 

1.5

Example package directories .....................................................................

1-16

 

1.6

Sample programs .......................................................................................

1-18

Chapter 2

TCP/IP Porting

 

 

2.1

Porting procedure ........................................................................................

2-2

 

2.2

Portable and nonportable files .....................................................................

2-3

 

2.3

Creating the IP port file ................................................................................

2-4

 

2.4

Coding the glue layer .................................................................................

2-10

 

2.5

Specifying IP addresses ............................................................................

2-14

 

2.6

Testing the TCP/IP port .............................................................................

2-16

Chapter 3

PPP Porting

 

 

3.1

Porting procedure ........................................................................................

3-2

 

3.2

Porting PPP .................................................................................................

3-3

 

3.3

Testing PPP .................................................................................................

3-9

Chapter 4

TCP/IP API Functions

 

 

4.1

Overview of user-provided TCP/IP functions ...............................................

4-2

 

4.2

User-provided TCP and IP functions ............................................................

4-3

 

4.3

Network interfaces .....................................................................................

4-15

Chapter 5

PPP API Functions

 

 

5.1

Overview of user-provided PPP functions ....................................................

5-2

ARM DUI 0079B

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

iii

 

5.2

User-provided PPP functions ......................................................................

5-3

 

5.3

Serial line drivers .......................................................................................

5-10

 

5.4

PPP entry points ........................................................................................

5-18

Chapter 6

Modem Functions

 

 

6.1

dialer.c .........................................................................................................

6-2

 

6.2

login.c ........................................................................................................

6-18

 

6.3

mdmport.c ..................................................................................................

6-24

Chapter 7

DHCP Client Functions

 

 

7.1

DHCP client functions ..................................................................................

7-2

Chapter 8

Low-overhead UDP Functions

 

 

8.1

UDP functions ..............................................................................................

8-2

Chapter 9

Sockets

 

 

9.1

ARM implementation of sockets ..................................................................

9-2

 

9.2

Socket API reference ...................................................................................

9-3

Chapter 10

ARM-specific Functions

 

 

10.1

ARM directories .........................................................................................

10-3

 

10.2

cksum.s .....................................................................................................

10-5

 

10.3

clock.c ........................................................................................................

10-6

 

10.4

delay.s .......................................................................................................

10-7

 

10.5

dtrap.s ........................................................................................................

10-8

 

10.6

except.s .....................................................................................................

10-9

 

10.7

irq.c ..........................................................................................................

10-10

 

10.8

lswap.s .....................................................................................................

10-12

 

10.9

mmu.s ......................................................................................................

10-13

 

10.10

olicom.c ...................................................................................................

10-14

 

10.11

pcmcia.c ..................................................................................................

10-15

 

10.12

stack.s .....................................................................................................

10-16

 

10.13

uart.c description .....................................................................................

10-17

 

10.14

uart.c ring buffer management functions .................................................

10-18

 

10.15

uart.c interface functions .........................................................................

10-22

 

10.16

uart.c debug TTY interface functions .......................................................

10-31

 

10.17

82595.c ....................................................................................................

10-33

Chapter 11

Miscellaneous Library Functions

 

 

11.1

app_ping.c .................................................................................................

11-3

 

11.2

in_utils.c .....................................................................................................

11-4

 

11.3

memman.c ...............................................................................................

11-16

 

11.4

menus.c, menulib.c, and nrmenus.c ........................................................

11-17

 

11.5

nextcarg.c ................................................................................................

11-18

 

11.6

nvfsio.c ....................................................................................................

11-19

 

11.7

nvparms.c ................................................................................................

11-27

iv

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

ARM DUI 0079B

 

11.8

parseip.c ..................................................................................................

11-28

 

11.9

reshost.c ..................................................................................................

11-29

 

11.10

strilib.c ......................................................................................................

11-31

 

11.11

strlib.c .......................................................................................................

11-32

 

11.12

tcp_echo.c ................................................................................................

11-33

 

11.13

ttyio.c ........................................................................................................

11-34

 

11.14

udp_echo.c ..............................................................................................

11-35

 

11.15

userpass.c ................................................................................................

11-36

Chapter 12

Example Applications

 

 

12.1

Overview of the examples ..........................................................................

12-2

 

12.2

Example descriptions .................................................................................

12-5

Appendix A

Error Codes

 

 

A.1

ENP_ error codes ........................................................................................

A-2

 

A.2

Socket error codes.......................................................................................

A-3

ARM DUI 0079B

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

v

vi

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

ARM DUI 0079B

Preface

This preface introduces the ARM TCP/IP and PPP implementations and their documentation. It contains the following sections:

About this book on page viii

Feedback on page xi.

ARM DUI 0079B

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

vii