summaryrefslogtreecommitdiff
path: root/slirp
diff options
context:
space:
mode:
Diffstat (limited to 'slirp')
-rw-r--r--slirp/bootp.c2
-rw-r--r--slirp/libslirp.h5
-rw-r--r--slirp/main.h2
-rw-r--r--slirp/slirp.c14
-rw-r--r--slirp/tftp.c2
5 files changed, 19 insertions, 6 deletions
diff --git a/slirp/bootp.c b/slirp/bootp.c
index 4e0082d2ca..a2fd734cd4 100644
--- a/slirp/bootp.c
+++ b/slirp/bootp.c
@@ -38,7 +38,7 @@ typedef struct {
static BOOTPClient bootp_clients[NB_ADDR];
-const char *bootp_filename;
+char *bootp_filename;
static const uint8_t rfc1533_cookie[] = { RFC1533_COOKIE };
diff --git a/slirp/libslirp.h b/slirp/libslirp.h
index c04f3a2720..7dee34b369 100644
--- a/slirp/libslirp.h
+++ b/slirp/libslirp.h
@@ -5,7 +5,8 @@
extern "C" {
#endif
-void slirp_init(int restricted, const char *special_ip);
+void slirp_init(int restricted, const char *special_ip, const char *tftp_path,
+ const char *bootfile);
void slirp_select_fill(int *pnfds,
fd_set *readfds, fd_set *writefds, fd_set *xfds);
@@ -24,9 +25,7 @@ int slirp_redir(int is_udp, int host_port,
int slirp_add_exec(int do_pty, const void *args, int addr_low_byte,
int guest_port);
-extern const char *tftp_prefix;
extern char slirp_hostname[33];
-extern const char *bootp_filename;
void slirp_stats(void);
void slirp_socket_recv(int addr_low_byte, int guest_port, const uint8_t *buf,
diff --git a/slirp/main.h b/slirp/main.h
index ed51385599..89e722f355 100644
--- a/slirp/main.h
+++ b/slirp/main.h
@@ -46,6 +46,8 @@ extern int tcp_keepintvl;
extern uint8_t client_ethaddr[6];
extern const char *slirp_special_ip;
extern int slirp_restrict;
+extern char *tftp_prefix;
+extern char *bootp_filename;
#define PROTO_SLIP 0x1
#ifdef USE_PPP
diff --git a/slirp/slirp.c b/slirp/slirp.c
index b3db74223a..b0a092c14c 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -171,7 +171,8 @@ static void slirp_cleanup(void)
static void slirp_state_save(QEMUFile *f, void *opaque);
static int slirp_state_load(QEMUFile *f, void *opaque, int version_id);
-void slirp_init(int restricted, const char *special_ip)
+void slirp_init(int restricted, const char *special_ip, const char *tftp_path,
+ const char *bootfile)
{
// debug_init("/tmp/slirp.log", DEBUG_DEFAULT);
@@ -203,6 +204,17 @@ void slirp_init(int restricted, const char *special_ip)
if (special_ip)
slirp_special_ip = special_ip;
+ qemu_free(tftp_prefix);
+ tftp_prefix = NULL;
+ if (tftp_path) {
+ tftp_prefix = qemu_strdup(tftp_path);
+ }
+ qemu_free(bootp_filename);
+ bootp_filename = NULL;
+ if (bootfile) {
+ bootp_filename = qemu_strdup(bootfile);
+ }
+
inet_aton(slirp_special_ip, &special_addr);
alias_addr.s_addr = special_addr.s_addr | htonl(CTL_ALIAS);
getouraddr();
diff --git a/slirp/tftp.c b/slirp/tftp.c
index 4ad55048b2..7cb095fb1d 100644
--- a/slirp/tftp.c
+++ b/slirp/tftp.c
@@ -37,7 +37,7 @@ struct tftp_session {
static struct tftp_session tftp_sessions[TFTP_SESSIONS_MAX];
-const char *tftp_prefix;
+char *tftp_prefix;
static void tftp_session_update(struct tftp_session *spt)
{