Version 1.8.0.0
[socat.git] / PORTING
blob0571bf7ef440365b7bff56acbc1f8f279fe6aa3e
2 DEVELOPMENT PLATFORMS
4 Primary development platform for socat is currently SuSE Linux 8.2 with
5 a 2.4.20 kernel. New features are then ported to the non-Linux platforms on the
6 Sourceforge compile farm (per July 2003: SunOS 5.8 with gcc, and MacOS X 10.2),
7 and AIX 5.1 with gcc. But due to limited time resources and restricted
8 (non-root) access to these systems I cannot extensively test socat there.
11 PORTING STEPS
13 If you want to port socat to another operating system you will typically go
14 through two phases: First, you might just try to compile and run the actual
15 socat distribution (passive phase). Then, you should see if your platform
16 has some nice features that are not yet used in socat, and add code for
17 supporting them (active phase). At last, I encourage you to send me your
18 changes so I can integrate them into the main socat distribution.
21 PASSIVE PHASE:
23 * Generate Makefile and config.h:
24   . If you have gcc, then just invoke "./configure".
25   . If you use another C compiler, configure might not work properly;
26     You will have to adapt config.h and Makefile manually.
27     Change compiler options or defines to use all features of the operating
28     system (not only ANSI-C; e.g. HP-UX: -Ae!)
29     Some practical config.<platform>.h examples have been included in the
30     Config directory of the source that might serve as starting point.
32 * Try to "make" socat; correct the errors. If some constants are undefined,
33   please disable these parts option-dependent, not platform-dependent (use
34   #ifdef TCP_OPTION  instead of  #if MY_OS)
36 * If you have big troubles compiling socat then try configure with options 
37   --disable-filan --disable-sycls; this excludes some of the most system 
38   dependent parts.
40 * After successful compilation and linking, run "make test" and try some
41   examples.
44 ACTIVE PHASE:
46 * Check the man pages of your operating system for open(2), fcntl(2),
47   setsockopt(2), ioctl(2), socket(7), ip(7), tcp(7), termios etc. and the
48   include files where you find the definitions of existing options, for new
49   options and implement them - again option-dependent.
50   Places to add code for the new options: 
51   . xioopts.h: enum e_optcode  (sorted numerically/alphabetically by name)
52   . xio-*.c: select the appropriate address file (e.g., xio-tcp.c for
53     TCP-options) and make a record of type struct optdesc: opt_newoption
54   . xio-*.h: the declation of struct optdesc
55   . xioopts.c: add records to  struct optname optionnames  for all appropriate
56     names (sorted strictly ASCII for binary search)
57   . filan.c: add the option to the appropriate array (sockopts, ipopts,
58     tcpopts) 
59   . socat.html, socat.1: write a short documentation and tell which
60     platform and version implements this option
62 * problems may occur especially:
63   . with 16 or 64 bit systems
64   . if snprintf() etc. is missing
65   . on UNIX emulations, e.g. Cygwin
68 INTEGRATION
70 * If you ported socat to another platform:
71   To let other people participate please send the modified files or a patch
72   file and the files generated by ./gatherinfo.sh to socat@dest-unreach.org.