Table of Contents


1 Introduction

2 TCP/IP Engine

2.1 TCP/IP Configuration
IP Addresses Set Manually
IP Addresses Set Dynamically
Sizes for TCP/IP I/O Buffers
2.2 TCP Socket Interface
Number of Sockets
Passive Open
Active Open
Delay a Connection
TCP Socket Functions
2.3 UDP Socket Interface
Dynamic C 7.05 (and later)
UDP Interface Prior to Dynamic C 7.05
Porting Programs from the older UDP API to the new UDP API
2.4 DNS Lookups
Configuration Macros for DNS Lookups
2.5 Skeleton Program
TCP/IP Stack Initialization
Packet Processing
TCP/IP Daemon Computing Time
2.6 State-Based Program Design
Blocking vs. Non-Blocking
2.7 Multitasking and TCP/IP
µC/OS-II
Cooperative Multitasking
2.8 Function Reference
arpcache_create
arpcache_flush
arpcache_hwa
arpcache_load
arpcache_search
_arp_resolve
arpresolve_check
arpresolve_ipaddr
arpresolve_start
_chk_ping
dhcp_acquire
dhcp_get_timezone
dhcp_release
getdomainname
gethostid
gethostname
getpeername
getsockname
htonl
htons
inet_addr
inet_ntoa
ntohl
ntohs
paddr
pd_getaddress
_ping
psocket
resolve
resolve_cancel
resolve_name_check
resolve_name_start
rip
router_add
router_del_all
router_delete
router_for
router_print
router_printall
_send_ping
setdomainname
sethostid
sethostname
sock_abort
sock_bytesready
sock_close
sock_dataready
sockerr
sock_error
sock_established
sock_fastread
sock_fastwrite
sock_flush
sock_flushnext
sock_getc
sock_gets
sock_init
sock_mode
sock_perror
sock_preread
sock_putc
sock_puts
sock_rbleft
sock_rbsize
sock_rbused
sock_read
sock_recv
sock_recv_from
sock_recv_init
sock_resolved
sock_set_tos
sock_set_ttl
sockstate
sock_tbleft
sock_tbsize
sock_tbused
sock_tick
sock_wait_closed
sock_wait_established
sock_wait_input
sock_write
sock_yield
tcp_clearreserve
tcp_config
tcp_extlisten
tcp_extopen
tcp_keepalive
tcp_listen
tcp_open
tcp_reserveport
tcp_tick
udp_bypass_arp
udp_close
udp_extopen
udp_open
udp_peek
udp_recv
udp_recvfrom
udp_send
udp_sendto
udp_waitopen
udp_waitsend
2.9 Macros

3 Server Utility Library

3.1 Data Structures for Zserver.lib
ServerSpec Structure
ServerAuth Structure
FormVar Structure
3.2 Constants Used in Zserver.lib
ServerSpec Type Field
ServerSpec Vartype Field
Servermask field
Configuration Macros
3.3 HTML Forms
3.4 Function Reference
sauth_adduser
sauth_authenticate
sauth_getuserid
sauth_getusername
sauth_getwriteaccess
sauth_removeuser
sauth_setpassword
sauth_setwriteaccess
sspec_addform
sspec_addfsfile
sspec_addfunction
sspec_addfv
sspec_addrootfile
sspec_addvariable
sspec_addxmemfile
sspec_addxmemvar
sspec_aliasspec
sspec_checkaccess
sspec_findfv
sspec_findname
sspec_findnextfile
sspec_getfileloc
sspec_getfiletype
sspec_getformtitle
sspec_getfunction
sspec_getfvdesc
sspec_getfventrytype
sspec_getfvlen
sspec_getfvname
sspec_getfvnum
sspec_getfvopt
sspec_getfvoptlistlen
sspec_getfvreadonly
sspec_getfvspec
sspec_getlength
sspec_getname
sspec_getpreformfunction
sspec_getrealm
sspec_gettype
sspec_getusername
sspec_getvaraddr
sspec_getvarkind
sspec_getvartype
sspec_needsauthentication
sspec_readfile
sspec_readvariable
sspec_remove
sspec_restore
sspec_save
sspec_setformepilog
sspec_setformfunction
sspec_setformprolog
sspec_setformtitle
sspec_setfvcheck
sspec_setfvdesc
sspec_setfventrytype
sspec_setfvfloatrange
sspec_setfvlen
sspec_setfvname
sspec_setfvoptlist
sspec_setfvrange
sspec_setfvreadonly
sspec_setpreformfunction
sspec_setrealm
sspec_setsavedata
sspec_setuser

4 HTTP Server

4.1 HTTP Server Data Structures
HttpSpec
HttpType
HttpRealm
HttpState
4.2 Configuration Macros
Customizing HTTP headers
4.3 Sample Programs
Serving Static Web Pages
Dynamic Web Pages Without HTML Forms
Web Pages With HTML Forms
HTML Forms Using Zserver.lib
4.4 Function Reference
cgi_redirectto
cgi_sendstring
http_addfile
http_contentencode
http_date_str
http_delfile
http_finderrbuf
http_findname
http_handler
http_init
http_nextfverr
http_parseform
http_setcookie
http_urldecode
shtml_addfunction
shtml_addvariable
shtml_delfunction
shtml_delvariable

5 FTP Client

5.1 Configuration Macros
5.2 Functions
ftp_client_setup
ftp_client_tick
ftp_client_filesize
ftp_client_xfer
ftp_data_handler
ftp_last_code
5.3 Sample FTP Transfer

6 FTP Server

6.1 Configuration Macros
6.2 File Handlers
Replacing the Default Handlers
File Handlers Specification
ftp_dflt_open
ftp_dflt_getfilesize
ftp_dflt_read
ftp_dflt_write
ftp_dflt_close
ftp_dflt_list
ftp_dflt_cd
ftp_dflt_pwd
ftp_dflt_mdtm
ftp_dflt_delete
6.3 Functions
ftp_init
ftp_set_anonymous
ftp_tick
6.4 Sample FTP Server
6.5 Getting Through a Firewall
6.6 FTP Server Commands
6.7 Reply Codes to FTP Commands

7 TFTP Client

BOOTP/DHCP
Data Structure for TFTP
Function Reference
tftp_init
tftp_initx
tftp_tick
tftp_tickx
tftp_exec

8 SMTP Mail Client

8.1 Sample Conversation
8.2 Configuration
8.3 Functions
smtp_sendmail
smtp_sendmailxmem
smtp_mailtick
smtp_status
8.4 Sample Sending of an E-mail

9 POP3 Client

9.1 Configuration
9.2 Three Steps to Receive E-mail.
9.3 Call-Back Function
Normal call-back
POP_PARSE_EXTRA call-back
9.4 Functions
pop3_init
pop3_getmail
pop3_tick
9.5 Sample Receiving of E-mail
Sample Conversation

10 Telnet

10.1 Telnet (Dynamic C 7.05 and later)
Setup
Function Reference (Dynamic C 7.05 and later)
vserial_close
vserial_init
vserial_keepalive
vserial_listen
vserial_open
vserial_tick
Sample Program (Dynamic C 7.05 and later)
10.2 Telnet (pre-Dynamic C 7.05)
Configuration Macros
Function Reference
telnet_init
telnet_tick
telnet_close
An Example Telnet Server

11 General Purpose Console

11.1 Introduction
11.2 Console Features
Using other Dynamic C Libraries
11.3 Login Name and Password
11.4 Console Commands and Messages
Console Command Data Structure
Console Command Array
Console Commands
Console Error Messages
11.5 Console I/O Interface
How to Include an I/O Method
Predefined I/O Methods
Multiple I/O Streams
11.6 Console Execution
File System Initialization
Serial Buffers
Using TCP/IP
Required Console Functions
console_init
console_tick
Useful Console Function
con_backup
con_backup_bytes
con_backup_reserve
con_chk_timeout
con_load_backup
con_reset_io
con_set_backup_lx
con_set_files_lx
con_set_user_idle
con_set_timeout
con_set_user_timeout
console_disable
console_enable
Console Execution Choices
11.7 Backup System
Data Structure for Backup System
Array Definition for Backup System
11.8 Console Macros
11.9 Sample Program

12 PPP Driver

12.1 PPP Libraries
12.2 Operation Details
The Modem Interface
Flow Control
Serial Port C
12.3 Software Implementation Overview
Defining Network Parameters
Configuration Options
Authentication
Link Teardown
12.4 Functions
CofModemExpect
CofModemHangup
CofModemInit
CofModemSend
CofPPPshutdown
CofPPPstart
ModemClose
ModemConnected
ModemExpect
ModemHangup
ModemInit
ModemOpen
ModemReady
ModemRinging
ModemSend
ModemStartPPP
PPPclose
PPPinit
PPPflowcontrolOff
PPPflowcontrolOn
PPPstart
PPPnegotiateIP
PPPnegotiateDNS
PPPsetAuthenticatee
PPPsetAuthenticator
PPPshutdown
ResetPPP

Index