Renamed slirp option 'dhcp' to 'dhcpstart' (similar to Qemu)

Ignore case when checking for slirp options
Improved slirp documentation
This commit is contained in:
Volker Ruppert 2014-03-04 18:58:51 +00:00
parent 25f9b4346a
commit 0c4e5eb6c5
5 changed files with 35 additions and 21 deletions

View File

@ -957,7 +957,8 @@ speaker: enabled=1, mode=sound
# this script to configure this network interface, or enable masquerading.
# This is mainly useful for the tun/tap devices that only exist during
# Bochs execution. The network interface name is supplied to the script
# as first parameter.
# as first parameter. The 'slirp_new' module uses this parameter
# to specify a config file for setting up an alternative configuration.
#
# BOOTROM: The bootrom value is optional, and is the name of the ROM image
# to load. Note that this feature is only implemented for the PCI version of

View File

@ -1,4 +1,4 @@
Changes after 2.6.2 (updated Feb 09, 2014):
Changes after 2.6.2 (updated Mar 04, 2014):
- CPU
- Bugfixes for CPU emulation correctness (critical fixes for VMX, TBM/BMI and RDRAND instructions)
@ -39,6 +39,7 @@ Changes after 2.6.2 (updated Feb 09, 2014):
- portable ISO image file access now available on all platforms
- Networking
- slirp/vnet: all supported TFTP extension options implemented now
- added built-in slirp (user-mode networking) support (ported from Qemu)
- Sound
- SB16 / ES1370: added volume control support for wave output
- ES1370: added 'wavemode' support similar to the SB16

View File

@ -1,5 +1,5 @@
.\"Document Author: Timothy R. Butler - tbutler@uninetsolutions.com"
.TH bochsrc 5 "03 Mar 2014" "bochsrc" "The Bochs Project"
.TH bochsrc 5 "04 Mar 2014" "bochsrc" "The Bochs Project"
.\"SKIP_SECTION"
.SH NAME
bochsrc \- Configuration file for Bochs.
@ -1084,7 +1084,8 @@ is executed after bochs initialize the network interface. You can use
this script to configure this network interface, or enable masquerading.
This is mainly useful for the tun/tap devices that only exist during
Bochs execution. The network interface name is supplied to the script
as first parameter.
as first parameter. The 'slirp_new' module uses this parameter
to specify a config file for setting up an alternative configuration.
BOOTROM:
The bootrom value is optional, and is the name of the ROM image

View File

@ -133,39 +133,39 @@ bx_bool bx_slirp_new_pktmover_c::parse_slirp_conf(const char *conf)
param[--len1] = 0;
}
if ((len1 == 0) || (len2 == 0)) continue;
if (!strcmp(param, "restricted")) {
if (!stricmp(param, "restricted")) {
restricted = atoi(val);
} else if (!strcmp(param, "hostname")) {
} else if (!stricmp(param, "hostname")) {
if (len2 < 33) {
hostname = (char*)malloc(len2+1);
strcpy(hostname, val);
} else {
BX_ERROR(("slirp: wrong format for 'hostname'"));
}
} else if (!strcmp(param, "bootfile")) {
} else if (!stricmp(param, "bootfile")) {
if (len2 < 128) {
bootfile = (char*)malloc(len2+1);
strcpy(bootfile, val);
} else {
BX_ERROR(("slirp: wrong format for 'bootfile'"));
}
} else if (!strcmp(param, "net")) {
} else if (!stricmp(param, "net")) {
if (!inet_aton(val, &net)) {
BX_ERROR(("slirp: wrong format for 'net'"));
}
} else if (!strcmp(param, "mask")) {
} else if (!stricmp(param, "mask")) {
if (!inet_aton(val, &mask)) {
BX_ERROR(("slirp: wrong format for 'mask'"));
}
} else if (!strcmp(param, "host")) {
} else if (!stricmp(param, "host")) {
if (!inet_aton(val, &host)) {
BX_ERROR(("slirp: wrong format for 'host'"));
}
} else if (!strcmp(param, "dhcp")) {
} else if (!stricmp(param, "dhcpstart")) {
if (!inet_aton(val, &dhcp)) {
BX_ERROR(("slirp: wrong format for 'dhcp'"));
BX_ERROR(("slirp: wrong format for 'dhcpstart'"));
}
} else if (!strcmp(param, "dns")) {
} else if (!stricmp(param, "dns")) {
if (!inet_aton(val, &dns)) {
BX_ERROR(("slirp: wrong format for 'dns'"));
}

View File

@ -1,19 +1,30 @@
# slirp config
# The line above is mandatory
# Supported options:
#
# RESTRICTED if set to 1, only built-in services are available
# NET base IP address of the virtual network
# MASK netmask of the virtual network
# HOST IP address of the DHCP and TFTP server
# HOSTNAME DHCP client hostname
# DHCPSTART start address of DHCP pool
# DNS IP address of the virtual DNS server
# BOOTFILE boot filename returned by DHCP
# This is the classic slirp setup
# restricted = 0
# net = 10.0.2.0
# mask = 255.255.255.0
# host = 10.0.2.2
# dhcp = 10.0.2.15
# dhcpstart = 10.0.2.15
# dns = 10.0.2.3
# This is the vnet setup
restricted = 1
net = 192.168.10.0
mask = 255.255.255.0
host = 192.168.10.1
dhcp = 192.168.10.2
dns = 0.0.0.0
bootfile = pxelinux.0
# restricted = 1
# net = 192.168.10.0
# mask = 255.255.255.0
# host = 192.168.10.1
# dhcpstart = 192.168.10.2
# dns = 0.0.0.0
# bootfile = pxelinux.0