File: PORTING

package info (click to toggle)
socat 1.7.3.2-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,888 kB
  • sloc: ansic: 28,032; sh: 11,782; makefile: 146
file content (72 lines) | stat: -rw-r--r-- 3,095 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

DEVELOPMENT PLATFORMS

Primary development platform for socat is currently SuSE Linux 8.2 with
a 2.4.20 kernel. New features are then ported to the non-Linux platforms on the
Sourceforge compile farm (per July 2003: SunOS 5.8 with gcc, and MacOS X 10.2),
and AIX 5.1 with gcc. But due to limited time resources and restricted
(non-root) access to these systems I cannot extensively test socat there.


PORTING STEPS

If you want to port socat to another operating system you will typically go
through two phases: First, you might just try to compile and run the actual
socat distribution (passive phase). Then, you should see if your platform
has some nice features that are not yet used in socat, and add code for
supporting them (active phase). At last, I encourage you to send me your
changes so I can integrate them into the main socat distribution.


PASSIVE PHASE:

* Generate Makefile and config.h:
  . If you have gcc, then just invoke "./configure".
  . If you use another C compiler, configure might not work properly;
    You will have to adapt config.h and Makefile manually.
    Change compiler options or defines to use all features of the operating
    system (not only ANSI-C; e.g. HP-UX: -Ae!)
    Some practical config.<platform>.h examples have been included in the
    Config directory of the source that might serve as starting point.

* Try to "make" socat; correct the errors. If some constants are undefined,
  please disable these parts option-dependent, not platform-dependent (use
  #ifdef TCP_OPTION  instead of  #if MY_OS)

* If you have big troubles compiling socat then try configure with options 
  --disable-filan --disable-sycls; this excludes some of the most system 
  dependent parts.

* After successful compilation and linking, run "make test" and try some
  examples.


ACTIVE PHASE:

* Check the man pages of your operating system for open(2), fcntl(2),
  setsockopt(2), ioctl(2), socket(7), ip(7), tcp(7), termios etc. and the
  include files where you find the definitions of existing options, for new
  options and implement them - again option-dependent.
  Places to add code for the new options: 
  . xioopts.h: enum e_optcode  (sorted numerically/alphabetically by name)
  . xio-*.c: select the appropriate address file (e.g., xio-tcp.c for
    TCP-options) and make a record of type struct optdesc: opt_newoption
  . xio-*.h: the declation of struct optdesc
  . xioopts.c: add records to  struct optname optionnames  for all appropriate
    names (sorted strictly ASCII for binary search)
  . filan.c: add the option to the appropriate array (sockopts, ipopts,
    tcpopts) 
  . socat.html, socat.1, xio.help: write a short documentation and tell which
    platform and version implements this option

* problems may occur especially:
  . with 16 or 64 bit systems
  . if snprintf() etc. is missing
  . on UNIX emulations, e.g. Cygwin


INTEGRATION

* If you ported socat to another platform:
  To let other people participate please send the modified files or a patch
  file and the files generated by ./gatherinfo.sh to socat@dest-unreach.org.