diff options
author | Guillaume Subiron <maethor@subiron.org> | 2015-12-19 22:25:00 +0100 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2016-02-04 13:22:06 +0800 |
commit | a5fd24aa6d0f26aeb9f15b24daa2d68427631c40 (patch) | |
tree | 83dcbdd530a4e23f3408bbc8ba60b54d78fa48dd /slirp/socket.h | |
parent | 5379229a2708df3a1506113315214c3ce5325859 (diff) | |
download | qemu-a5fd24aa6d0f26aeb9f15b24daa2d68427631c40.zip qemu-a5fd24aa6d0f26aeb9f15b24daa2d68427631c40.tar.gz qemu-a5fd24aa6d0f26aeb9f15b24daa2d68427631c40.tar.bz2 |
slirp: Factorizing and cleaning solookup()
solookup() was only compatible with TCP. Having the socket list in
argument, it is now compatible with UDP too.
Some optimization code is factorized inside the function (the function
look at the last returned result before browsing the complete socket
list).
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>
Diffstat (limited to 'slirp/socket.h')
-rw-r--r-- | slirp/socket.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/slirp/socket.h b/slirp/socket.h index b27bbb2..1c8c24c 100644 --- a/slirp/socket.h +++ b/slirp/socket.h @@ -87,8 +87,9 @@ struct socket { #define SS_HOSTFWD 0x1000 /* Socket describes host->guest forwarding */ #define SS_INCOMING 0x2000 /* Connection was initiated by a host on the internet */ -struct socket * solookup(struct socket *, struct in_addr, u_int, struct in_addr, u_int); -struct socket * socreate(Slirp *); +struct socket *solookup(struct socket **, struct socket *, + struct in_addr, u_int, struct in_addr, u_int); +struct socket *socreate(Slirp *); void sofree(struct socket *); int soread(struct socket *); void sorecvoob(struct socket *); |