Improve the README.
[slow/socket_wrapper.git] / README
1 Socket wrapper library
2 =======================
3
4 This library makes possible to run several instances of the full software stack
5 on the same machine and perform locally functional testing of complex network
6 configurations. It passes all socket communication over unix domain sockets.
7
8 The user defines a directory where to put all the unix sockets using the
9 envionment variable "SOCKET_WRAPPER_DIR=/path/to/socket_dir". When a server
10 opens a port or a client wants to connect, socket_wrapper will translate IP
11 addresses to a special socket_wrapper name and look for the relevant unix
12 socket in the SOCKET_WRAPPER_DIR.
13
14 Additionally, the default interface to be used by an application is defined
15 with "SOCKET_WRAPPER_DEFAULT_IFACE=<ID>" where <ID> is between 2 and 254. This
16 is analogous to use the IPv4 addresses "127.0.0.<ID>" or IPv6 addresses
17 "fd00::5357:5f<IDx>" (where <IDx> is a hexadecimal presentation of <ID>). You
18 should always set the default interface. If you listen on INADDR_ANY then it
19 will use the default interface to listen on.
20
21 Exmaple: 
22 LD_PRELOAD=libsocket_wrapper.so \
23 SOCKET_WRAPPER_DIR=/path/to/socket_dir \
24 ./mydaemon
25
26 The following environment variables could also be set:
27
28 SOCKET_WRAPPER_DEFAULT_IFACE
29     The default interface to use if nothing has
30     been set trough the functions.
31     Set it to '11' for '127.0.0.11'.
32
33 SOCKET_WRAPPER_PCAP_FILE
34     If set then all traffic will be written to the
35     specified pcap file.
36
37 SOCKET_WRAPPER_DEBUGLEVEL
38    If you socket_wrapper with with debug symbols
39    you can turn on logging by setting this to an
40    integer between 1 and 3.
41    0 = ERROR
42    1 = WARNING
43    2 = DEBUG
44    3 = TRACE