diff --git a/README.md b/README.md
index 9c45634..a537f65 100644
--- a/README.md
+++ b/README.md
@@ -11,12 +11,21 @@ configuration nor privileged services on the host.
This project wraps the slirp code in a library featuring a clean and simple interface.
+## Install libslirp:
+
+```
+$ autoreconf -if
+$ ./configure
+$ make
+$ sudo make install
+```
+
## libslirp tutorial
The first operation to use a slirp virtual network is slirp_open
.
-
+``` SLIRP *myslirp = slirp_open(SLIRP_IPV4 | SLIRP_IPV6); -+``` *myslirp* is the descriptor of the slirp network. @@ -31,25 +40,25 @@ The library has been designed to assign suitable default values for all the para Libslirp provides functions to override the values (see
man libslirpcfg
).
After the (eventual) configuration of all the parameters the slirp networj can be activated:
-+``` slirp_start(myslirp); -+``` Now virtual networking (ethernet) packets can be sent and received using *slirp_send* and *slirp_recv*. e.g.: -
+``` sentlen = slirp_send(myslirp, pkt, pktlen); pktlen = slirp_recv(myslirp, buf, buflen); -+``` *slirp_fd* returns a file descriptor which can be used to wait for incoming packets using poll or select. -
+``` myslirpfd = slirp_fd(myslirp); -+``` It is also possible to set up port forwarding for TCP, UDP (currently IPV4 only) or connect X-window clients running in the virtual network to a X server UNIX socket, see
man libslirpfwd
.
To terminate the slirp network, call:
-+``` slirp_close(myslirp) -+``` diff --git a/man/libslirp.3 b/man/libslirp.3 index 2906760..ed45eb7 100644 --- a/man/libslirp.3 +++ b/man/libslirp.3 @@ -21,7 +21,7 @@ slirp_open, slirp_start, slirp_fd, slirp_send, slirp_recv, slirp_close \- slirp .SH SYNOPSIS .B #include