SwsSock - TCP/IP network communications library =============================================== THIS IS A FEATURE RESTRICTED EVALUATION VERSION. The SwsSock library provides a cross platform, BSD compatible, sockets API, a TCP/IP protocol stack and drivers for common Ethernet and serial adapters. The package consists of libraries, C header files, example applications and projects or makefiles for the following target/compiler combinations: - Win32 target, Microsoft Visual C++ 6.0. - 32-bit DOS target, DJGPP (version 2.03 or later). - 16-bit DOS target, Microsoft Visual C++ 1.52c. The SwsSock evaluation library is shareware; that is it may be freely used by any individual for personal and private use or for their business without any restriction or charge. Companies, organizations or governments may not use it without a license. In no case may SwsSock be re-sold or used in a system to deprive anyone of life, liberty or livelihood. Copyright (C)2005 Software Systems Consultants. Web: www.softsystem.co.uk Tel: +33 5 49 72 79 63 e-mail: sales@softsystem.co.uk FEATURES ======== - Standard BSD 'sockets' API, Winsock2 compatible. - TCP. Supports slow start, congestion control (RFC2581), Jacobson RTT estimation, fast retransmit etc... - IP version 4. Supports IP options, fragmentation and reassembly, fast table driven routing & cache, multi-homed routing. - UDP. - Raw sockets. - ICMP and Echo server. - IGMP version 2 and multicasting. - Ethernet - DIX and 802.3 frame formats. - ARP. - Point to point link manager featuring 'dial on demand'. - Hayes modem support. - 'MSdirect' modem support for Microsoft direct cable connections. - PPP and SLIP serial links. - CHAP and PAP authentication. - Van Jacobsen TCP/IP header compression. - DNS client. - DHCP client. - IP, PPP and Ethernet packet dumpers. - Threads. Mapped to native threads on appropriate platforms, otherwise a co-operative (non-preemptive) implementation is provided. - Timers. Low overhead with millisecond resolution. - Low overhead, minimum copy buffering. - Fully asynchronous design. - Simple configuration from text file. - Platform independent. - Easily portable design written entirely in ANSI C89. - Easily customised - simple interfaces to Ethernet and serial drivers. - Ideal for embedded systems. - Small and fast; complete HTTP 1.1 web server in 87 KBytes. REQUIREMENTS ============ - An Intel Pentium compatible PC running Windows XP (Home, Professional or Server), Windows 2000 (Professional or Server), Windows NT 4 (Service Pack 6), Windows Me or Windows 98 (Second Edition). - 10 MB of free disk space. - The SwsVpkt driver, downloadable from www.softsystem.co.uk/swsvpkt1003.zip - A Windows supported TCP/IP network e.g. ADSL, cable or Ethernet LAN. - A suitable C compiler. ANSI C89 compatible. LIMITATIONS =========== Although the SwsSock library can be ported to many host/compiler combinations, this evaluation version is restricted to use on Windows systems only. The Windows native version provides a full implementation of SwsSock but requires the SwsVpkt packet driver to access a LAN. The SwsSock DLL provides a functional subset of Winsock2. All standard BSD sockets calls are supported but there is a restricted set of WSAxxx Microsoft specific functions and associated functionality. In many cases, an application linked with ws2_32.dll can run quite happily using the (renamed) SwsSock DLL. The DOS and DJGPP libraries require a standard 'packet driver' (see Crynwr Software www.crynwr.com for examples) to communicate with an Ethernet adapter. The evaluation version specifically require the presence of the SwsVpkt virtual packet driver and hence can only be used on a Windows host. The DOS and DJGPP evaluation libraries implement a subset of the full features available with SwsSock. In particular the following features are missing or restricted: - No DHCP client. Configuration is obtained from the sws_sock.ini file. - No DNS client (only dotted IP addresses may be used). - No ICMP. All ICMP packets are silently dropped. - No Multicasting or IGMP. - No point to point links (SLIP and PPP). - No modem support. - No UDP protocol. - No support for IP options i.e. Timestamp, LooseRoute, RecordRoute etc. - No routing in multi-homed hosts. - No IP gateway. Packets may only be sent on the local subnet. The 16-bit DOS library was compiled as 'large model' assuming SS != DS. Threaded programs must also be compiled assuming SS != DS. INSTALLATION ============ If you haven't already done so, download the virtual packet driver, SwsVpkt, from www.softsystem.co.uk/swsvpkt1003.zip and install it. If you have a self-extracting archive file (.exe) then double click it to expand the files into an empty folder. If you have a ZIP archive then use WinZip or similar to extract the files into an empty folder. The example applications should now be built (see 'Building the examples' below) to ensure correct installation. REMOVAL ======= Simply delete the folder created during installation. SDK LAYOUT ========== In the top level directory: c_api.txt Description of the C programming interface. config.txt Description of the sws_sock.ini runtime configuration file. readme.txt This file sws_sock.ini The runtime configuration file. In the APPS directory: Batch files to buiold the applications. A sub-directory for each example. In the APPS\ directory: C source files and headers for the example. A sub-directory containing make or project files for each target. In the INCLUDE directory: C header files defining the public interface to each module. sws_sock.h C header containing declarations of the 'sockets' API. sws_net.h C header bringing in network headers for each target. sws_cfg.c C source to read the sws_sock.ini file. sws_dmpe.c C source to the Ethernet packet dumper. sws_dmpi.c C source to the IP packet dumper. sws_dmpp.c C source to the PPP packet dumper. sws_dump.c C source to the packet dumper. In the LIBS directory: A sub-directory for each target containing a library and the file config.h which was used to specify library build options. EXAMPLES ======== There are 5 example, console mode, programs provided in the 'APPS' folder: - Echos. A combined UDP/TCP Echo (RFC862) server and client. Makefiles/projects are provided for Cygwin, Djgpp, MSVC++1.52c, MSVC++ 6 and MSVC++ 6 using Winsock2. - Httpd. An HTTP 1.1 web server with file system module. The server can be extended by registering 'action modules' to handle specified URI branches. Makefiles/projects are provided for Cygwin, Djgpp, MSVC++1.52c, MSVC++ 6 and MSVC++ 6 using Winsock2. - Inetd. An example of using SWS_Thread to create a multi-threaded server combining Echod and Httpd. Makefiles/projects are provided for Djgpp, MSVC++1.52c and MSVC++ 6. - Ping. An ICMP echo client. This example demonstrates using 'raw' sockets. Makefiles/projects are provided for Cygwin, Djgpp, MSVC++1.52c, MSVC++ 6 and MSVC++ 6 using Winsock2. NB the Winsock2 version will not work on Windows XP service pack 2 due to Microsoft disabling raw socket support in this service pack. - Pktdump. An example of using the Ethernet and IP packet dumper API. Makefiles/projects are provided for Djgpp, MSVC++1.52c and MSVC++ 6. Building the examples ---------------------- The examples can be built by double clicking the batch file: * buildalldjgpp.bat. Builds 32-bit DOS programs with DJGPP 2.03 or later. You may need to edit makedj.bat to setup paths. * buildallmsvc1.bat. Builds 16-bit DOS programs with MSVC 1.52c. You may need to edit makevc1.bat to setup paths. * buildallmsvc6.bat. Builds Win32 programs using the SwsSock DLL with MS VC++ 6. You may need to edit makevcs.bat to setup paths. * buildallmsvc6ws2.bat. Builds Win32 programs using the Winsock2 DLL with MS VC++ 6. You may need to edit makevc.bat to setup paths. * buildallcygwin.bat. Builds Win32 native programs with the Cygwin compiler. You may need to edit makecygw.bat to setup paths. It is also possible to build the 16-bit DOS programs with BorlandC++ 3.1. Running the examples -------------------- For convenience all programs of a given type should be copied to a separate runtime folder. Copy the file sws_sock.ini (found in the top level folder where SwsSock was installed) to the runtime folder. For Win32/SwsSock programs, copy the file sws_sock.dll, found in libs\win32\dll, to the runtime folder. Open a command line session and cd to the runtime folder. Help for each program can be obtained by entering a command line of -? . All the programs display a one line version banner followed by an information line containing the hostname and IP address. Using the supplied sws_sock.ini file all the apps should report the hostname as SwsSock and the IP address as 192.168.0.6x (x is 1, 2 or 3). If none, or just the loopback adapter 127.0.0.1, is shown then you have probably not installed the SwsVpkt virtual packet driver. NB to use the httpd program you will need to copy the files apps\httpd\index.htm and apps\httpd\develop.gif to the runtime folder. You may also wish to create your own website, but the default page must be named index.htm. Each session provides a standalone TCP/IP implementation. Sessions may be given identical or different IP addresses dependent upon the local sws_sock.ini file contents. CONFIGURATION ============= All configuration data is contained in the text file sws_sock.ini. This file must be placed in the same directory as the executable program. Please refer to config.txt for information on the contents of this file. Each example has its own section in sws_sock.ini: [http] max_conn = 6 ; The max number of concurrent connections idle_time = 60 ; Max seconds connection may be idle before reset. root = . ; Relative path to web directory [echo] max_conn = 3 ; The max number of concurrent connections idle_time = 30 ; Max seconds connection may be idle before reset. ;save= echo.dat ; If set, write all incoming data to this file [discard] max_conn = 3 ; The max number of concurrent connections idle_time = 30 ; Max seconds connection may be idle before reset. ;save= echo.dat ; If set, write all incoming data to this file [inetd] ;http= 0 ; 0 to disable the http thread ;echo= 0 ; 0 to disable the echo thread ;discard= 0 ; 0 to disable the discard thread PROBLEMS ======== SwsSock is designed to be compatible with all recent Windows systems. The following limitations are known: - The DPMI server that ships with Windows NT4 service pack 6 has a problem with DJGPP applications. This manifests as a SIGSEGV abort when a frame is received. There is no known workaround. If you should have other problems, issues or for technical support contact sales@softsystem.co.uk or phone us on +33 5 49 72 79 63. UPGRADING ========= This is an evaluation version of the SwsSock library which has documented limitations and restrictions. The following unrestricted distributions are available to purchase: - 32-bit DOS/DJGPP library supporting standard 'packet drivers'. Example C source Ethernet and serial port drivers are included to assist with supporting custom hardware. Complete with full API documentation. - 16-bit DOS library for use with standard 'packet drivers'. Example C source Ethernet and serial port drivers are included to assist with supporting custom hardware. Complete with full API documentation. - Complete source code and example/skeleton platform adaptation module for porting to new platforms. Complete with full API documentation. For prices, availability and technical inquiries contact sales@softsystem.co.uk or phone us on +33 5 49 72 79 63. WHO ARE SOFTWARE SYSTEMS? ========================= Software Systems provide software development services and consultancy. Our current products include: SwsSock TCP/IP communications library SwsVpkt virtual packet driver MailCenturion NetCenturion SoundFX Masm2djg Contacts: Web: www.softsystem.co.uk Tel: +33 5 49 72 79 63 e-mail: sales@softsystem.co.uk WARRANTY ======== The SwsSock evaluation is supplied 'as is' with absolutely no warranty given or implied. The use of SwsSock is entirely at the risk of the end user. Software Systems will not be held responsible for any loss or damage, however caused, resulting from the use of SwsSock. Release History =============== 1.0.0.4 18-Oct-05 Add multicast capability to raw IP sockets. Default IP transmit queue length increased from 32 to 64. Bug fixes: TCP fast retansmit, multicast and IP reassembly. 1.0.0.3 13-Sep-05 Bug fixes: TCP retransmit, DPC queue interrupt safety. 1.0.0.2 07-Sep-05 Added modem support and PPP. 1.0.0.1 24-Jun-05 Initial release.