summaryrefslogtreecommitdiffstats
path: root/slirp
Commit message (Collapse)AuthorAgeFilesLines
...
* slirp: Factor out one-time initializationJan Kiszka2009-06-293-37/+41
| | | | | | | | | | | | In order to prepare re-initialization and multi-instance slirp, factor out init code that is of global scope and (at least for now) only need to be run once. This also fixes the potentially uninitialized use of our_addr in get_dns_addr. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: tftp: Rework filename handlingJan Kiszka2009-06-291-22/+16
| | | | | | | | | This changes the filename handling from a static buffer in tftp_session for the client-provided name + prefix to a dynamically allocated buffer that keeps the combined path in one place. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: tftp: Refactor tftp_handle_rrqJan Kiszka2009-06-291-28/+21
| | | | | | | | Specifically make the filename extraction more readable, and always report errors back to the client. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: tftp: Clean up tftp_send_errorJan Kiszka2009-06-291-8/+5
| | | | | | | | The return code of tftp_send_error is not used, drop it. And also make sure to always terminate the session. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: tftp: Cleanup tftp_prefix checkJan Kiszka2009-06-291-8/+7
| | | | | | | | Perform check for set prefix early (if it's not given, tftp is disabled) and drop redundant second check. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Drop unused icmp_var.hJan Kiszka2009-06-292-50/+0
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Cleanup and basic reanimation of debug codeJan Kiszka2009-06-296-25/+13
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Drop statistic codeJan Kiszka2009-06-2918-476/+6
| | | | | | | | | As agreed on the mailing list, there is no interest in keeping the usually disabled slirp statistics in the tree. So this patch removes them. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Drop dead codeJan Kiszka2009-06-2926-1650/+22
| | | | | | | | | | 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>
* slirp: Add info usernet for dumping connection statesJan Kiszka2009-06-295-55/+90
| | | | | | | | | Break out sockstats from the slirp statistics and present them under the new info category "usernet". This patch also improves the current output /wrt proper reporting connection source and destination. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Mark sockets of incoming TCP connectionsJan Kiszka2009-06-292-0/+2
| | | | | | | Required for pretty-printing. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Do not allow to remove non-hostfwd socketsJan Kiszka2009-06-291-9/+5
| | | | | | | | | Prevent that the users accidentally shoots down dynamic sockets. This allows to remove looping for removals as there can now only be one match. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Explicitely mark host-forwarding socketsJan Kiszka2009-06-293-3/+4
| | | | | | | | 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>
* slirp: Prepare for persistent socket state flagsJan Kiszka2009-06-295-13/+26
| | | | | | | | 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>
* slirp: Bind support for host forwarding rulesJan Kiszka2009-06-297-25/+27
| | | | | | | | | 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>
* slirp: Fix port comparision in slirp_remove_hostfwdJan Kiszka2009-06-291-2/+6
| | | | | | | | | For UDP host forwardings, fport is not stable, every outgoing packet of the redirection can modify it. Use getsockname instead to look up the port that is actually used on the host side. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Rework external configuration interfaceJan Kiszka2009-06-293-39/+38
| | | | | | | | | | | | | With the internal IP configuration made more flexible, we can now enhance the user interface. This patch adds a number of new options to "-net user": net (address and mask), host, dhcpstart, dns and smbserver. It also renames "redir" to "hostfwd" and "channel" to "guestfwd" in order to (hopefully) clarify their meanings. The format of guestfwd is extended so that the user can define not only the port but also the virtual server's IP address the forwarding starts from. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Rework internal configurationJan Kiszka2009-06-2913-142/+149
| | | | | | | | | | | | | The user mode IP stack is currently only minimally configurable /wrt to its virtual IP addresses. This is unfortunate if some guest has a fixed idea of which IP addresses to use. Therefore this patch prepares the stack for fully configurable IP addresses and masks. The user interface and default addresses remain untouched in this step, they will be enhanced in the following patch. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Move smb, redir, tftp and bootp parameters and -net channelJan Kiszka2009-06-295-6/+19
| | | | | | | | | | | | | | | | | So far a couple of slirp-related parameters were expressed via stand-alone command line options. This it inconsistent and unintuitive. Moreover, it prevents both dynamically reconfigured (host_net_add/ delete) and multi-instance slirp. This patch refactors the configuration by turning -smb, -redir, -tftp and -bootp as well as -net channel into options of "-net user". The old stand-alone command line options are still processed, but no longer advertised. This allows smooth migration of management applications to to the new syntax and also the extension of that syntax later in this series. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "User networking: Show active connections"Jan Kiszka2009-06-292-28/+0
| | | | | | | | | | | | | | | This reverts commit 1c6ed9f3379faac83da0ed3e95cbd49003ac0dd1. It's redundant to slirp statistics, which are going to be split up / reworked later on. Conflicts: monitor.c net.c Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Refactor tcp_ctlJan Kiszka2009-06-291-79/+30
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Drop redundant lines from udp_inputJan Kiszka2009-06-291-2/+0
| | | | | | | | The socket faddr/fport is already updated a few lines below, so these are completely redundant. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix mingw32 build warningsBlue Swirl2009-06-132-2/+11
| | | | | | | | Work around buffer and ioctlsocket argument type signedness problems Suppress a prototype which is unused on mingw32 Expand a macro to avoid warnings from some GCC versions Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: Reorder initializationJan Kiszka2009-06-092-2/+2
| | | | | | | | | | | | | This patch reorders the initialization of slirp itself as well as its associated features smb and redirection. So far the first reference to slirp triggered the initialization, independent of the actual -net user option which may carry additional parameters. Now we save any request to add a smb export or some redirections until the actual initialization of the stack. This also allows to move a few parameters that were passed via global variable into the argument list of net_slirp_init. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
* User networking: Show active connectionsAlexander Graf2009-05-282-0/+28
| | | | | | | | | | | | | In case you're wondering what connections exactly you have open or maybe redir'ed in the past, you can't really find out from qemu right now. This patch enables you to see all current connections the host only networking holds open, so you can kill them using the previous patch. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* User Networking: Enable removal of redirectionsAlexander Graf2009-05-272-0/+24
| | | | | | | | | | | | | Using the new host_net_redir command you can easily create redirections on the fly while your VM is running. While that's great, it's missing the removal of redirections, in case you want to have a port closed again at a later point in time. This patch adds support for removal of redirections. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Reassign same address to same DHCP clientJan Kiszka2009-05-221-3/+5
| | | | | | | | In case a client restarts a DHCP recovery without releasing its old address, reassign the same address to prevent consuming free addresses and moving away from the standard client address. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* Cast pointer arguments of get/setsockopt, send to void * to keep GCCmalc2009-05-211-1/+1
| | | | | | from producing a warning about pointer type mismatches with Winsock Signed-off-by: malc <av1474@comtv.ru>
* Replace gcc variadic macro extension with C99 versionBlue Swirl2009-05-131-3/+3
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: Handle DHCP requests for specific IP (Jan Kiszka)aliguori2009-04-212-34/+95
| | | | | | | | | | | | | | | | | | This adds proper handling of the ciaddr field as well as the "Requested IP Address" option to slirp's DHCP server. If the client requests an invalid or used IP, a NAK reply is sent, if it requests a specific but valid IP, this is now respected. NAK'ing invalid IPs is specifically useful when changing the slirp IP range via '-net user,ip=...' while the client saved its previously used address and tries to reacquire it. Now this will be NAK'ed and the client will start a new discovery round. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7198 c046a42c-6fe2-441c-8c8c-71466251a162
* Use ANSI prototypes to please sparseblueswir12009-04-182-17/+8
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7176 c046a42c-6fe2-441c-8c8c-71466251a162
* Move bootp_filename to avoid a sparse warningblueswir12009-04-181-0/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7174 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix some win32 compile warningsblueswir12009-04-052-1/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6984 c046a42c-6fe2-441c-8c8c-71466251a162
* Delete some unused macros detected with -Wp,-Wunused-macros useblueswir12009-03-163-3/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6856 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix windows build and clean up use of <windows.h>aliguori2009-03-081-1/+0
| | | | | | | | | | | | | We want to globally define WIN_LEAN_AND_MEAN and WINVER to particular values so let's do it in OS_CFLAGS. Then, we can pepper in windows.h includes where using #includes that require it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6783 c046a42c-6fe2-441c-8c8c-71466251a162
* Sparse fixes: NULL use, header order, ANSI prototypes, staticblueswir12009-03-0713-176/+94
| | | | | | | | | | | | | Fix Sparse warnings: * use NULL instead of plain 0 * rearrange header include order to avoid redefining types accidentally * ANSIfy SLIRP * avoid "restrict" keyword * add static git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6736 c046a42c-6fe2-441c-8c8c-71466251a162
* monitor: Rework API (Jan Kiszka)aliguori2009-03-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the monitor API and prepare it for decoupled terminals: term_print functions are renamed to monitor_* and all monitor services gain a new parameter (mon) that will once refer to the monitor instance the output is supposed to appear on. However, the argument remains unused for now. All monitor command callbacks are also extended by a mon parameter so that command handlers are able to pass an appropriate reference to monitor output services. For the case that monitor outputs so far happen without clearly identifiable context, the global variable cur_mon is introduced that shall once provide a pointer either to the current active monitor (while processing commands) or to the default one. On the mid or long term, those use case will be obsoleted so that this variable can be removed again. Due to the broad usage of the monitor interface, this patch mostly deals with converting users of the monitor API. A few of them are already extended to pass 'mon' from the command handler further down to internal functions that invoke monitor_printf. At this chance, monitor-related prototypes are moved from console.h to a new monitor.h. The same is done for the readline API. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6711 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix SIGSEGV crash in slirp networking codeblueswir12009-02-061-2/+1
| | | | | | | | | | Fix SIGSEGV crash in networking code (bug was introduced in r6288). Thanks to Gleb Natapov for finding this fix. Signed-off-by: Stefan Weil <weil@mail.berlios.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6545 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove the advertising clause from the slirp licensealiguori2009-01-2619-93/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the FSF, the 4-clause BSD license, which slirp is covered under, is not compatible with the GPL or LGPL[1]. [1] http://www.fsf.org/licensing/licenses/index_html#GPLIncompatibleLicenses There are three declared copyright holders in slirp that use the 4-clause BSD license, the Regents of UC Berkley, Danny Gasparovski, and Kelly Price. Below are the appropriate permissions to remove the advertise clause from slirp from each party. Special thanks go to Richard Fontana from Red Hat for contacting all of the necessary authors to resolve this issue! Regents of UC Berkley: From ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change July 22, 1999 To All Licensees, Distributors of Any Version of BSD: As you know, certain of the Berkeley Software Distribution ("BSD") source code files require that further distributions of products containing all or portions of the software, acknowledge within their advertising materials that such products contain software developed by UC Berkeley and its contributors. Specifically, the provision reads: " * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors." Effective immediately, licensees and distributors are no longer required to include the acknowledgement within advertising materials. Accordingly, the foregoing paragraph of those BSD Unix files containing it is hereby deleted in its entirety. William Hoskins Director, Office of Technology Licensing University of California, Berkeley Danny Gasparovski: Subject: RE: Slirp license Date: Thu, 8 Jan 2009 10:51:00 +1100 From: "Gasparovski, Daniel" <Daniel.Gasparovski@ato.gov.au> To: "Richard Fontana" <rfontana@redhat.com> Hi Richard, I have no objection to having Slirp code in QEMU be licensed under the 3-clause BSD license. Thanks for taking the effort to consult me about this. Dan ... Kelly Price: Date: Thu, 8 Jan 2009 19:38:56 -0500 From: "Kelly Price" <strredwolf@gmail.com> To: "Richard Fontana" <rfontana@redhat.com> Subject: Re: Slirp license Thanks for contacting me, Richard. I'm glad you were able to find Dan, as I've been "keeping the light on" for Slirp. I have no use for it now, and I have little time for it (now holding onto Keenspot's Comic Genesis and having a regular US state government position). If Dan would like to return to the project, I'd love to give it back to him. As for copyright, I don't own all of it. Dan does, so I will defer to him. Any of my patches I will gladly license to the 3-part BSD license. My interest in re-licensing was because we didn't have ready info to contact Dan. If Dan would like to port Slirp back out of QEMU, a lot of us 64-bit users would be grateful. Feel free to share this email address with Dan. I will be glad to effect a transfer of the project to him and Mr. Bellard of the QEMU project. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6451 c046a42c-6fe2-441c-8c8c-71466251a162
* Use broadcast address for slirp dhcp repliesaurel322009-01-241-0/+2
| | | | | | | | | | Windows Vista drops unicast dhcp replies to its yet-unconfigured address, so use a broadcast address. This behaviour is allowed by the RFC. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6430 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix _P use on OpenBSDblueswir12009-01-141-2/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6298 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix 64 bit issue in slirpblueswir12009-01-1311-207/+138
| | | | | | | Signed-off-by: Gleb Natapov <gleb@redhat.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6288 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix some SLIRP warningsblueswir12009-01-123-5/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6272 c046a42c-6fe2-441c-8c8c-71466251a162
* Add support for vmchannel socket migration (Gleb Natapov)aliguori2009-01-081-0/+227
| | | | | | | | | 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@6243 c046a42c-6fe2-441c-8c8c-71466251a162
* Add slirp_restrict option (Gleb Natapov)aliguori2009-01-087-14/+57
| | | | | | | | | | | Add "slirp firewall" to permit connection only to vmchannel addresses. 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@6241 c046a42c-6fe2-441c-8c8c-71466251a162
* Redirect slirp traffic to/from qemu character device (Gleb Natapov)aliguori2009-01-088-25/+156
| | | | | | | | | 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
* Remove unnecessary trailing newlinesblueswir12008-12-134-4/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6000 c046a42c-6fe2-441c-8c8c-71466251a162
* slirp: fix CVE 2007-5729aurel322008-12-071-0/+3
| | | | | | | | | | The emulated network cards in QEMU allows local users to execute arbitrary code by writing Ethernet frames with a size larger than the slirp's default MTU, which triggers a heap-based buffer overflow in the slirp library. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5920 c046a42c-6fe2-441c-8c8c-71466251a162
* Make struct iovec universally availablealiguori2008-12-052-8/+1
| | | | | | | | | | | 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
* Fix inline use warnings from sparseblueswir12008-10-262-4/+4
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5540 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud