qemu-e2k/slirp
Guillaume Subiron 5379229a27 slirp: Factorizing address translation
This patch factorizes some duplicate code into a new function,
sotranslate_out(). This function perform the address translation when a
packet is transmitted to the host network. If the packet is destinated
to the host, the loopback address is used, and if the packet is
destinated to the virtual DNS, the real DNS address is used. This code
is just a copy of the existent, but factorized and ready to manage the
IPv6 case.

On the same model, the major part of udp_output() code is moved into a
new sotranslate_in(). This function is directly used in sorecvfrom(),
like sotranslate_out() in sosendto().
udp_output() becoming useless, it is removed and udp_output2() is
renamed into udp_output(). This adds consistency with the udp6_output()
function introduced by further patches.

Lastly, this factorizes some duplicate code into sotranslate_accept(), which
performs the address translation when a connection is established on the host
for port forwarding: if it comes from localhost, the host virtual address is
used instead.

This prepares for IPv6 support.

Signed-off-by: Guillaume Subiron <maethor@subiron.org>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-02-04 13:22:06 +08:00
..
arp_table.c slirp/arp: do not special-case bogus IP addresses 2014-06-09 01:49:28 +02:00
bootp.c slirp: Factorizing address translation 2016-02-04 13:22:06 +08:00
bootp.h
cksum.c
COPYRIGHT
debug.h
dnssearch.c
if.c slirp: Fix type casts and format strings in debug code 2015-11-12 13:48:36 +08:00
if.h
ip_icmp.c slirp: Factorizing address translation 2016-02-04 13:22:06 +08:00
ip_icmp.h
ip_input.c slirp: Fix type casts and format strings in debug code 2015-11-12 13:48:36 +08:00
ip_output.c slirp: Fix type casts and format strings in debug code 2015-11-12 13:48:36 +08:00
ip.h
libslirp.h
main.h
Makefile.objs
mbuf.c slirp: Generalizing and neutralizing ARP code 2016-02-04 13:22:06 +08:00
mbuf.h slirp: Generalizing and neutralizing ARP code 2016-02-04 13:22:06 +08:00
misc.c slirp: Fix type casts and format strings in debug code 2015-11-12 13:48:36 +08:00
misc.h slirp/misc: Use the GLib memory allocation APIs 2014-08-24 13:16:32 +04:00
sbuf.c slirp: Fix type casts and format strings in debug code 2015-11-12 13:48:36 +08:00
sbuf.h
slirp_config.h slirp/misc: Use the GLib memory allocation APIs 2014-08-24 13:16:32 +04:00
slirp.c slirp: Make Socket structure IPv6 compatible 2016-02-04 13:22:06 +08:00
slirp.h ether/slirp: Avoid redefinition of the same constants 2016-01-11 11:01:35 +08:00
socket.c slirp: Factorizing address translation 2016-02-04 13:22:06 +08:00
socket.h slirp: Factorizing address translation 2016-02-04 13:22:06 +08:00
tcp_input.c slirp: Make Socket structure IPv6 compatible 2016-02-04 13:22:06 +08:00
tcp_output.c slirp: Fix type casts and format strings in debug code 2015-11-12 13:48:36 +08:00
tcp_subr.c slirp: Factorizing address translation 2016-02-04 13:22:06 +08:00
tcp_timer.c
tcp_timer.h
tcp_var.h
tcp.h
tcpip.h
tftp.c slirp: Factorizing address translation 2016-02-04 13:22:06 +08:00
tftp.h Increase maximum number of session of the internal TFTP server. 2014-06-24 20:01:24 +04:00
udp.c slirp: Factorizing address translation 2016-02-04 13:22:06 +08:00
udp.h slirp: Factorizing address translation 2016-02-04 13:22:06 +08:00