summaryrefslogtreecommitdiff
path: root/slirp/socket.h
AgeCommit message (Collapse)AuthorFilesLines
2013-02-21slirp: switch to GPollFDStefan Hajnoczi1-0/+2
Slirp uses rfds/wfds/xfds more extensively than other QEMU components. The rarely-used out-of-band TCP data feature is used. That means we need the full table of select(2) to g_poll(3) events: rfds -> G_IO_IN | G_IO_HUP | G_IO_ERR wfds -> G_IO_OUT | G_IO_ERR xfds -> G_IO_PRI I came up with this table by looking at Linux fs/select.c which maps select(2) to poll(2) internally. Another detail to watch out for are the global variables that reference rfds/wfds/xfds during slirp_select_poll(). sofcantrcvmore() and sofcantsendmore() use these globals to clear fd_set bits. When sofcantrcvmore() is called, the wfds bit is cleared so that the write handler will no longer be run for this iteration of the event loop. This actually seems buggy to me since TCP connections can be half-closed and we'd still want to handle data in half-duplex fashion. I think the real intention is to avoid running the read/write handler when the socket has been fully closed. This is indicated with the SS_NOFDREF state bit so we now check for it before invoking the TCP write handler. Note that UDP/ICMP code paths don't care because they are connectionless. Note that slirp/ has a lot of tabs and sometimes mixed tabs with spaces. I followed the style of the surrounding code. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-id: 1361356113-11049-6-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-25slirp: Replace u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int typesStefan Weil1-5/+5
There is no need to have a second set of integral types. Replace them by the standard types from stdint.h. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-07-01Fix breakage by obsolete _P() for goodBlue Swirl1-14/+14
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-29slirp: Factor out internal state structureJan Kiszka1-4/+5
The essence of this patch is to stuff (almost) all global variables of the slirp stack into the structure Slirp. In this step, we still keep the structure as global variable, directly accessible by the whole stack. Changes to the external interface of slirp will be applied in the following patches. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29slirp: Drop dead codeJan Kiszka1-4/+0
After all its years inside the qemu tree, there is no point in keeping the dead code paths of slirp. This patch is a first round of removing usually commented out code parts. More cleanups need to follow (and maybe finally a proper reindention). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29slirp: Mark sockets of incoming TCP connectionsJan Kiszka1-0/+1
Required for pretty-printing. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29slirp: Explicitely mark host-forwarding socketsJan Kiszka1-0/+1
Mark sockets that describe host forwardings. This is required for their (and only their) proper deletion and for pretty-printing. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29slirp: Prepare for persistent socket state flagsJan Kiszka1-0/+2
This prepares for adding flags to socket.so_state that must not be removed during the lifetime of a socket. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29slirp: Bind support for host forwarding rulesJan Kiszka1-1/+1
Extend the hostfwd rule format so that the user can specify on which host interface qemu should listen for incoming connections. If omitted, binding will takes place against all interfaces. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-04-05Fix some win32 compile warningsblueswir11-0/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6984 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-08Redirect slirp traffic to/from qemu character device (Gleb Natapov)aliguori1-0/+2
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6240 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-05Make struct iovec universally availablealiguori1-8/+0
Vectored IO APIs will require some sort of vector argument. It makes sense to use struct iovec and just define it globally for Windows. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5889 c046a42c-6fe2-441c-8c8c-71466251a162
2007-10-26 Use const and static as needed, disable unused codeblueswir11-5/+0
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3452 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-17find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in ↵ths1-4/+4
the regex. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-16find -type f | xargs sed -i 's/[\t ]$//g' # on most filesths1-7/+7
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
2004-04-22initial user mode network supportbellard1-0/+104
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@733 c046a42c-6fe2-441c-8c8c-71466251a162