SWSSOCK CONFIGURATION
=====================

Author: Lawrence Rust (lvr@softsystem.co.uk)
Last Modified: 02-Feb-10


All SwsSock runtime configuration data are contained in the text file
sws_sock.ini.  This file must be placed in the same directory as the executable
program.  The general format of this file is:

[section]
key = value


ADAPTER SETTINGS
================

Each adapter has its own section:

[PacketDriverInterface1]
; The 1st DOS (16 and 32 bit) Ethernet adapter.

[PacketDriverInterface2]
; The 2nd DOS (16 and 32 bit) Ethernet adapter.

[Packet32DriverInterface1]
; The 1st Windows LAN adapter.

[Packet32DriverInterface2
; The 2nd Windows LAN adapter.

[PacketXeth0]
; The 1st Linux LAN adapter.

[PacketXeth1]
; The 2nd Linux LAN adapter.

[Win32Comms1]
; The 1st Windows serial port.
;port = COM1             ; Win32 device name

[Win32Comms2]
; The 2nd Windows serial port.
;port = COM2             ; Win32 device name

[PcComms1]
; The 1st DOS serial port.
;port = 1                ; COM port number (1..8) or port base address

[PcComms2]
; The 2nd DOS serial port.
;port = 2                ; COM port number (1..8) or port base address

[PosixComms1]
; The 1st Linux serial port.
;port=/dev/ttyS0

[PosixComms2]
; The 2nd Linux serial port.
;port=/dev/ttyS1


All adapters
------------
ipaddress = 192.168.0.63    ; static IP address. leave unset for dhcp, 0= glean
ipsubnet =  255.255.255.0   ; If 0 or unset defaults to IP class
ipgateway = 192.168.0.63    ; IP gateway/router, 0= proxy arp
dhcp=1                      ; !0 to enable DHCP if no static IP - default 0


Windows LAN adapters
--------------------
disable = 0     ; !0 to disable

DJGPP/DOS Ethernet adapters
-----------------------
rxmode= 3 ; 1= rxoff,2= rxon, 3= +bcast, 4= +mcast, 5= +all-mcast, 6= all pkts
mac_address= xx-xx-xx-xx-xx-xx
txasync= 0      ; Non-zero to enable asynchronous sends.
                ; Requires packet driver support
rxq= 160        ; Rx packet queue length

Linux LAN adapters
--------------------
disable= 0      ; Non-zero to disable


All serial adapters
-------------------
baud = 38400            ; Supported baud rate up to 115200
bits = 7|8              ; Data bits
parity = none|odd|even  ; Parity
stop = 1|2              ; Stop bits

; PPP setup
modem=hayes             ; null, hayes or msdirect
modeminit= Q0V1W1S95=47 ; Valid Hayes command string
rings=2                 ; No. rings before modem auto-answer
connect= session        ; Connect at startup using settings in [session]
demand= session         ; 'Dial on demand' connection using settings in [session]

Windows serial adapter
----------------------
duplex = 1              ; 0 for half duplex operation signalled by RTS
cts = 0                 ; !0 to suspend Tx whwen CTS is lowered
dsr = 0                 ; !0 to suspend Tx whwen DSR is lowered
dtr = enable|disable|handshake  ; enable= raise DTR, disable= lower DTR,
                        ; handshake= Lower DTR when input buffer is full.
DOS serial adapters
-------------------
irq = 3                 ; Interrupt line
rxfifo= 14              ; Receive FIFO depth 1..14, 0= disable
txfifo= 8               ; Transmit FIFO depth 1..15, 0- disable
duplex = 1              ; 0 for half duplex operation signalled by RTS
cts = 0                 ; !0 to suspend Tx whwen CTS is lowered
dsr = 0                 ; !0 to suspend Tx whwen DSR is lowered
dtr = enable|disable|handshake  ; enable= raise DTR, disable= lower DTR,
                        ; handshake= Lower DTR when input buffer is full.
rts = disable           ; enable, disable, handshake RTS output

Linux serial adapters
---------------------
port=/dev/ttyS0         ; Device name
error= discard          ; discard, nul or ignore
rtscts= 0               ; 1= enable rtc/cts h/w handshake
dtr= 0                  ; 1= require dtr input
rts= 0                  ; 1= assert rts


PPP session settings
--------------------

[session]               ; session name set by connect= or demand=

protocol= ppp           ; ppp or slip
dial=01234567           ; Client dial string, empty for a server
                        ; NB client sessions are one off connections.
auth=chap               ; chap or pap.  Optional PPP authentiation
timeout=60000           ; Client/server connection timeout in milliseconds
idle=120                ; Link idle (no Tx activity) timeout in seconds
vjslots=15              ; No. VJ compression slots, 0= disable
login=0                 ; !0 for terminal login
username=name           ; Authentication user name
password=passwd         ; Authentication password or blank
ipaddress=192.168.3.63  ; Optional IP address, if none PPP will negotiate.
ipsubnet =255.255.255.0 ; Optional IP subnet, default is 255.255.255.255
ipgateway=192.168.3.62  ; Optional gateway address, given to PPP client


PPP server settings
-------------------

[p2p_users]

; Users authorised to connect to a server session
user= password
guest=


DOS PLATFORM
============

The 32-bit DJGPP and 16-bit DOS targets provide common settings in:

[djgpp] or [dos]

driver= SwsVpkt         ; Name of external program to run during startup
                        ; Convenient to install the packet driver
stack=                  ; Default thread stack size.
                        ; 32768 for DJGPP or 5120 on 16-bit
yield= 0                ; Non zero to yield the CPU to a DPMI/Windows host.
                        ; Improves host efficiency but may drop packets

[PacketDriverInterface]

buffer=70000            ; Rx buffer size


Win32 PLATFORM
==============

[Packet32DriverInterface]
rxbuffers = 48  ; No. of receive buffers
txbuffers = 16  ; No. of transmit buffers
disable = 0     ; !0 to disable


Linux PLATFORM
==============

[Posix]
;Signal sent to service DPCs
signal = 10 ;SIGUSR1

[PacketX]
;AsyncIO signal
signal = 29 ;SIGIO
disable= 0
rxbuffers= 32

[PosixComms]
;AsyncIO signal
signal = 29 ;SIGIO


SERVICES
========

DNS client
----------

[dns]
server= 192.168.0.1     ; DNS client's default server hostname or IPv4
                        ; On Windows, if this is left unset then the startup
                        ; code queries for the current preferred DNS server
server2= 192.168.0.2    ; SwsSock library
hostname= SwsVpkt       ; SwsSock library

[hosts]
myhost= 192.168.0.1    ; Known hostname


DHCP client
-----------

[dhcp]
enable=0                ; 0= disable DHCP

NB it is wise to disable DHCP when running on a Windows host otherwise the host
DHCP client may become confused.


TCP/IP STACK
============

[buffer]
handles=126             ; No. buffer handles
large_size=1514         ; Size of a large buffer
large_count=36          ; No. large buffers
small_size=64           ; Size of a small buffer
small_count=90          ; No. small buffers

[timer]
count=51                ; No. timers

[event]
count=96                ; No. events

[dpc]
count=32                ; No. pending deferred procedure calls

[enet]
;802p3=1                ; Use 802.3 packets
txq=32                  ; Max no. pending transmits
sendself                ; !0 to transmit self-addressed packets

[arp]
count=16                ; ARP cache size
timeout=120             ; secs ARP cache timeout
response=2000           ; Millisecs max reply

[ppp]
;txbuffer=1600          ; PPP transmit buffer size
;rxbuffer=1600          ; PPP receive buffer size
retryterm=2             ; Terminate request retries
retrycfg=10             ; Configure request retries
retrynak=10             ; Configure nak's until reject
retryms=3000            ; Retry interval in milliseconds

[slip]
;txbuffer=1600          ; SLIP transmit buffer size
;rxbuffer=1600          ; SLIP receive buffer size

[loopback]
enable=1                ; !0 to enable the loopback interface

[ip]
;ttl=64                 ; Default Time To Live
;reassembly_timeout=60  ; secs
;reassembly=2           ; No. re-assembly buffers
;reassembly_max=0       ; Size of largest fragmented datagram
;maxfrag=1500           ; Max fragement size >=52
;txq=32                 ; Max no. pending sends
;noproto=1              ; 0 to send ICMP protocol not reachable
;routed=1               ; Non-zeo to enable multi-homed routing

route_cache = 64       ; No. entries in route cache
; Routing table
; Set next to 0 to send directly
;        dst         subnet         next     adapter
;route1=192.168.3.0  255.255.0.0    0.0.0.0  Win32Comms1
;route2=192.168.1.0  255.255.255.0  0.0.0.0  Packet32DriverInterface2

[igmp]
version=2               ; IGMP version 1 or 2, 0- disable

[icmp]
echo_server=1           ; 0 to disable the ICMP 'ping' server

[rawip]
;sockets= 4             ; Max no. sockets
;buffers= 4             ; Max no. datagrams queued per socket

[udp]
;sockets= 4             ; Max no. sockets
;buffers= 4             ; Max no. datagrams queued per socket
;checksum= 1            ; 0 to disable UDP checksum checks
;noport=1               ; 0 to send ICMP port unreachable
;loport=1024            ; Min port number
;hiport=5000            ; Max port number

[tcp]
;sockets=2              ; Max no. sockets
;rto= 3000              ; Initial retransmit timeout, milliseconds
;rtomin= 200            ; Min retransmit timeout
;rtomax= 240000         ; Max retransmit timeout
synfail=12000           ; Millisecs timeout for connection established
segfail=21000           ; Millisecs timeout for retrying segment
timewait=240000         ; Millsecs delay before re-using port
ackwait=20              ; Millisecs timeout fot piggy-backing an ACK
;rcvbuf=65536           ; Rx buffer (sets Rx window)
;sndbuf=16384           ; Tx buffer
mss=0                   ; Maximum segment size, 0= MTU of local subnet
;prealloc=0             ; !0 to preallocate buffers
noport=0                ; 0 to send RST if port not reachable
ttl= 60                 ; Default TTL
;loport=1024            ; Min port number
;hiport=5000            ; Max port number


APPLICATIONS
============

[ntp]
server= europe.pool.ntp.org
;server= pool.ntp.org
port= 123


MAIL SERVER
-----------

[smtp]
idle_time = 120 ; secs
max_conn= 3
log= ;
maxsize= 0 ; bytes, 0= unlimited
UpnpExtPort=0 ;25

deny_defer= 1
deny_unnamed= 0
deny_badhello= 0
deny_dynamicip= 0
verify_sender= 1

; The default MX for relaying
; Blank or absent to use DNS MX
;default_mx= user:passwd+myisp.com

; The MX to always use for relaying
; Blank or absent to use [smtp_mx] entries followed by default_mx then DNS
;relay_mx= smtp.myisp.com

script=     ; program to run after data
hostname =  ; hostname
greeting= ESMTP
bye= closing

[smtp_relay]
; Host IPs permitted to relay
ip4= 192.168.1.16/28
ip4= 127.0.0.1

[smtp_mx]
; Domains with special handling
; Blank to use DNS MX
; Absent to use default_mx
myisp.com=
domain.com= smtp.myisp

[smtp_users]
;mailbox                   inbox                           quota
Postmaster                 ./inet/inbox/postmaster        1000000
@localhost                 ./inet/inbox/all               1000000

[smtp_permit]
; Host IPs unconditionally permitted
ip4= 127.0.0.1
ip4= 192.168.1.16/28

[smtp_deny]
; Host IPs denied login
ip4= 192.168.1.1

[smtp_banned_hosts]
; hostnames banned at HELO using DNS. may contain * and ?
hostname= localhost
hostname= *.in-addr.arpa


SENDMAIL
---------

[mail]
server=   ; default mail server
port=25   ; default smtp port
from=     ; default sender


POP3 SERVER
-----------

[pop]
idle_time = 120; secs
max_conn = 4
poll_time = 333 ; millisecs
;log = 0
greeting= ready
bye= signing off
UpnpExtPort=0 ;110

[pop_users]
;username      password        inbox
;
admin          admin          ./inet/inbox/postmaster


FTP SERVER
----------

[ftp]
idle_time= 180 ; Seconds
max_conn= 4
log= ; 0
login_attempts = 3
lockout_time = 30 ; minutes
UpnpExtPort=0 ;21

[ftp_users]
;username      password   home_dir      permit [r|x|w|c]  permitted host(s)

webmaster      o1iver     ./inet/www          c           192.168.1.20/28
admin          admin      ./inet              c           192.168.1.0/22
anonymous      *          ./inet/www          x
*              -          ./inet/ftp          r


TELNET SERVER
-------------

[telnet]
idle_time= 180 ; Seconds
max_conn = 3
log= ;
UpnpExtPort=0 ;23

[telnet_users]
;username      password   home_dir       permit [r|w|c]   permitted host(s)

admin          admin      ./inet              c           192.168.1.20/28
anonymous      *          ./inet/ftp          w
guest          -          ./inet/ftp          w
*              -          ./inet/ftp          r


WEB SERVER
----------

[http]
idle_time= 120 ; Seconds
keep_time = 2 ;  secs
max_conn= 4
log= ; 0
UpnpExtPort=0 ;80

;root = /somepath ; filesystem root defaults to "." (cwd)
html_root = ; e.g. /public
cgi_root = ; e.g. /cgi-bin

; URI's requiring authentication
;authorize = /private/* http_private

; Video4Linux webcam module
v4l_dev = /dev/video0
v4l_input = -1
v4l_std
v4l_width = 360
v4l_height = 288
j_quality = 25

[http_redirect]
; Client redirects
;/index.html = /index.htm

[http_alias]
/ = /index.htm
; The lhs & rhs may contain * and ? wildcards
; NB these must be in order of precedence
;/?*/ = /*/index.htm
;http://www.myhost.com/* = /*

[http_files]
; MIME types
;*.xml  = text/xml

[http_admin]
; Authorisation for all put & delete
text = Access restricted
permit = 127.0.0.1
permit = 192.168.1.0/24
;acct = user:password

[http_proxy]
; Authorisation for all proxy requests
text = Proxy use restricted

; Enable public proxy service overnight
time = 21:30 08:30

acct = user:password

permit = 127.0.0.1
permit = 192.168.1.0/22

; blacklist
deny = 74.63.0.0/16 ; Limestone Networks - multiple ad requests
deny = 69.162.0.0/16 ; Limestone Networks
deny = 89.187.132.200

[http_proxy_connect]
; Authorisation for all proxy connect requests
text = Proxy connection restricted

; Enable proxy service overnight
;time = 21:30 08:30

;acct = user:password

permit = 127.0.0.1
permit = 192.168.1.0/22

[http_cgi]
; Authorisation for CGI's in /cgi-bin/nph_*
text = CGI access restricted
;acct = user:password
permit = 127.0.0.1/16
permit = 192.168.1.0/22

[http_private]
; Custom private area
text = Private area
acct = user:password
permit = 127.0.0.1
;permit = 192.168.1.0/22


ECHO/DISCARD SERVERS
--------------------

[echo]
idle_time= 120 ; Seconds
max_conn= 3
buffer= 3000
save= 0
log= ; 0
UpnpExtPort = 0; 7


[discard]
idle_time= 120 ; Seconds
max_conn= 3
buffer= 3000
save= 0
log= ; 0
UpnpExtPort = 0; 9


IDENT SERVER
-------------

[ident]
log= ; 0
max_conn = 3
idle_time = 120; secs
user = ; anonymous
UpnpExtPort = 0; 113


INETD SERVER
------------

[inetd]
;ftp= 0; 0= disable ftp
;telnet= 0
;smtp= 0
;http= 0
;pop= 0
;echo= 0
;discard= 0
;ident= 0


PACKET DUMPER
=============

[log]
; TRACE output level (DEBUG build only)
trace=2     ; 0= errors, 1= +warnings, 2= +info, 3= +more... 9= +trace, 10= +irqs
file=stdout ; log output filename or stderr/stdout, blank for none

; IP trace
pdump=0                 ; 0=off 1= normal 2= more etc
tcp=65535               ; b0=TxEn b1=RxEn
udp=65535               ; b0=TxEn b1=RxEn
icmp=65535              ; b0=TxEn b1=RxEn
igmp=65535              ; b0=TxEn b1=RxEn b2=classDEn
noport=0                ; ignore packets to this port
;ipfilt=192.168.1.20/24 ; ignore packets from this address

;Ethernet trace
edump=0                 ; 0=off 1= normal 2= more etc
arp=65535               ; b0=TxEn b1=RxEn
enetip=0                ; b0=TxEn b1=RxEn
enet802p3=65535         ; b0=TxEn b1=RxEn

; PPP trace
pppdump=0               ; 0=off 1= normal 2= more etc
p2pdump=0               ; 0=off 1= normal 2= more etc
