1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

1. Change device probing so that high speed network devices are found before

SLIP/PPP devices, putting them before the others in the network device
   selection menu.

2. Change "Other" to "URL" so as not to conflict with the keyboard accellerator
   for the "OK" button in FTP site selection menu.

3. Detect the NULL last symbol in the name list and initialize the other
   members correctly.
This commit is contained in:
Jordan K. Hubbard 1996-10-05 11:56:50 +00:00
parent 8996308b98
commit 2ac528a98f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18704
7 changed files with 173 additions and 166 deletions

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: devices.c,v 1.47 1996/06/13 17:07:37 jkh Exp $
* $Id: devices.c,v 1.48 1996/07/13 05:09:29 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -219,9 +219,56 @@ deviceGetAll(void)
free(names);
}
/*
* Try to get all the types of devices it makes sense to get at the
* second stage of the installation.
/* Now go for the network interfaces. Stolen shamelessly from ifconfig! */
ifc.ifc_len = sizeof(buffer);
ifc.ifc_buf = buffer;
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
msgConfirm("ifconfig: socket");
return;
}
if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0) {
msgConfirm("ifconfig (SIOCGIFCONF)");
return;
}
ifflags = ifc.ifc_req->ifr_flags;
end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) {
char *descr;
/* If it's not a link entry, forget it */
if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK)
continue;
/* Eliminate network devices that don't make sense */
if (!strncmp(ifptr->ifr_name, "tun", 3)
|| !strncmp(ifptr->ifr_name, "lo0", 3))
continue;
descr = NULL;
for (i = 0; device_names[i].name; i++) {
int len = strlen(device_names[i].name);
if (!strncmp(ifptr->ifr_name, device_names[i].name, len)) {
descr = device_names[i].description;
break;
}
}
if (!descr)
descr = "<unknown network interface type>";
deviceRegister(ifptr->ifr_name, descr, strdup(ifptr->ifr_name), DEVICE_TYPE_NETWORK, TRUE,
mediaInitNetwork, NULL, NULL, mediaShutdownNetwork, NULL);
msgDebug("Found a device of type network named: %s\n", ifptr->ifr_name);
close(s);
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
msgConfirm("ifconfig: socket");
continue;
}
if (ifptr->ifr_addr.sa_len) /* I'm not sure why this is here - it's inherited */
ifptr = (struct ifreq *)((caddr_t)ifptr + ifptr->ifr_addr.sa_len - sizeof(struct sockaddr));
}
/* Finally, try to find all the types of devices one might need
* during the second stage of the installation.
*/
for (i = 0; device_names[i].name; i++) {
char try[FILENAME_MAX];
@ -287,54 +334,6 @@ deviceGetAll(void)
break;
}
}
/* Now go for the (other) network interfaces dynamically. Stolen shamelessly from ifconfig! */
ifc.ifc_len = sizeof(buffer);
ifc.ifc_buf = buffer;
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
msgConfirm("ifconfig: socket");
return;
}
if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0) {
msgConfirm("ifconfig (SIOCGIFCONF)");
return;
}
ifflags = ifc.ifc_req->ifr_flags;
end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) {
char *descr;
/* If it's not a link entry, forget it */
if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK)
continue;
/* Eliminate network devices that don't make sense */
if (!strncmp(ifptr->ifr_name, "tun", 3)
|| !strncmp(ifptr->ifr_name, "lo0", 3))
continue;
descr = NULL;
for (i = 0; device_names[i].name; i++) {
int len = strlen(device_names[i].name);
if (!strncmp(ifptr->ifr_name, device_names[i].name, len)) {
descr = device_names[i].description;
break;
}
}
if (!descr)
descr = "<unknown network interface type>";
deviceRegister(ifptr->ifr_name, descr, strdup(ifptr->ifr_name), DEVICE_TYPE_NETWORK, TRUE,
mediaInitNetwork, NULL, NULL, mediaShutdownNetwork, NULL);
msgDebug("Found a device of type network named: %s\n", ifptr->ifr_name);
close(s);
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
msgConfirm("ifconfig: socket");
continue;
}
if (ifptr->ifr_addr.sa_len) /* I'm not sure why this is here - it's inherited */
ifptr = (struct ifreq *)((caddr_t)ifptr + ifptr->ifr_addr.sa_len - sizeof(struct sockaddr));
}
}
/*

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: menus.c,v 1.84 1996/07/31 06:41:29 jkh Exp $
* $Id: menus.c,v 1.85 1996/09/08 01:39:25 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -440,7 +440,7 @@ guaranteed to carry the full range of possible distributions.",
"install",
{ { "Primary Site", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=ftp://ftp.freebsd.org/pub/FreeBSD/" },
{ "Other", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL,
{ "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=other" },
{ "Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=ftp://ftp.au.freebsd.org/pub/FreeBSD/" },

View File

@ -24,7 +24,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* library functions for userconfig library
*
* $Id: uc_main.c,v 1.6 1996/10/05 05:51:12 jkh Exp $
* $Id: uc_main.c,v 1.7 1996/10/05 10:43:49 jkh Exp $
*/
#include <sys/types.h>
@ -109,12 +109,22 @@ uc_open(char *name){
free(kern);
return NULL;
}
if (name[0] == '\n')
name[0] = '\0';
nl[i].n_name = strdup(name);
if (fscanf(fp, "%d %d %d %ld\n",
&(nl[i].n_type), &(nl[i].n_other), &(nl[i].n_desc), &(nl[i].n_value)) != 4) {
msgDebug("Unable to read symbol detail fields from symbol file, entry = %d\n", i);
free(kern);
return NULL;
if (name[0]) {
msgDebug("Unable to read symbol detail fields from symbol file, entry = %d\n", i);
free(kern);
return NULL;
}
else {
nl[i].n_type = 0;
nl[i].n_other = 0;
nl[i].n_desc = 0;
nl[i].n_value = 0;
}
}
}
fclose(fp);

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: devices.c,v 1.47 1996/06/13 17:07:37 jkh Exp $
* $Id: devices.c,v 1.48 1996/07/13 05:09:29 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -219,9 +219,56 @@ deviceGetAll(void)
free(names);
}
/*
* Try to get all the types of devices it makes sense to get at the
* second stage of the installation.
/* Now go for the network interfaces. Stolen shamelessly from ifconfig! */
ifc.ifc_len = sizeof(buffer);
ifc.ifc_buf = buffer;
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
msgConfirm("ifconfig: socket");
return;
}
if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0) {
msgConfirm("ifconfig (SIOCGIFCONF)");
return;
}
ifflags = ifc.ifc_req->ifr_flags;
end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) {
char *descr;
/* If it's not a link entry, forget it */
if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK)
continue;
/* Eliminate network devices that don't make sense */
if (!strncmp(ifptr->ifr_name, "tun", 3)
|| !strncmp(ifptr->ifr_name, "lo0", 3))
continue;
descr = NULL;
for (i = 0; device_names[i].name; i++) {
int len = strlen(device_names[i].name);
if (!strncmp(ifptr->ifr_name, device_names[i].name, len)) {
descr = device_names[i].description;
break;
}
}
if (!descr)
descr = "<unknown network interface type>";
deviceRegister(ifptr->ifr_name, descr, strdup(ifptr->ifr_name), DEVICE_TYPE_NETWORK, TRUE,
mediaInitNetwork, NULL, NULL, mediaShutdownNetwork, NULL);
msgDebug("Found a device of type network named: %s\n", ifptr->ifr_name);
close(s);
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
msgConfirm("ifconfig: socket");
continue;
}
if (ifptr->ifr_addr.sa_len) /* I'm not sure why this is here - it's inherited */
ifptr = (struct ifreq *)((caddr_t)ifptr + ifptr->ifr_addr.sa_len - sizeof(struct sockaddr));
}
/* Finally, try to find all the types of devices one might need
* during the second stage of the installation.
*/
for (i = 0; device_names[i].name; i++) {
char try[FILENAME_MAX];
@ -287,54 +334,6 @@ deviceGetAll(void)
break;
}
}
/* Now go for the (other) network interfaces dynamically. Stolen shamelessly from ifconfig! */
ifc.ifc_len = sizeof(buffer);
ifc.ifc_buf = buffer;
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
msgConfirm("ifconfig: socket");
return;
}
if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0) {
msgConfirm("ifconfig (SIOCGIFCONF)");
return;
}
ifflags = ifc.ifc_req->ifr_flags;
end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) {
char *descr;
/* If it's not a link entry, forget it */
if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK)
continue;
/* Eliminate network devices that don't make sense */
if (!strncmp(ifptr->ifr_name, "tun", 3)
|| !strncmp(ifptr->ifr_name, "lo0", 3))
continue;
descr = NULL;
for (i = 0; device_names[i].name; i++) {
int len = strlen(device_names[i].name);
if (!strncmp(ifptr->ifr_name, device_names[i].name, len)) {
descr = device_names[i].description;
break;
}
}
if (!descr)
descr = "<unknown network interface type>";
deviceRegister(ifptr->ifr_name, descr, strdup(ifptr->ifr_name), DEVICE_TYPE_NETWORK, TRUE,
mediaInitNetwork, NULL, NULL, mediaShutdownNetwork, NULL);
msgDebug("Found a device of type network named: %s\n", ifptr->ifr_name);
close(s);
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
msgConfirm("ifconfig: socket");
continue;
}
if (ifptr->ifr_addr.sa_len) /* I'm not sure why this is here - it's inherited */
ifptr = (struct ifreq *)((caddr_t)ifptr + ifptr->ifr_addr.sa_len - sizeof(struct sockaddr));
}
}
/*

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: menus.c,v 1.84 1996/07/31 06:41:29 jkh Exp $
* $Id: menus.c,v 1.85 1996/09/08 01:39:25 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -440,7 +440,7 @@ guaranteed to carry the full range of possible distributions.",
"install",
{ { "Primary Site", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=ftp://ftp.freebsd.org/pub/FreeBSD/" },
{ "Other", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL,
{ "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=other" },
{ "Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=ftp://ftp.au.freebsd.org/pub/FreeBSD/" },

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: devices.c,v 1.47 1996/06/13 17:07:37 jkh Exp $
* $Id: devices.c,v 1.48 1996/07/13 05:09:29 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -219,9 +219,56 @@ deviceGetAll(void)
free(names);
}
/*
* Try to get all the types of devices it makes sense to get at the
* second stage of the installation.
/* Now go for the network interfaces. Stolen shamelessly from ifconfig! */
ifc.ifc_len = sizeof(buffer);
ifc.ifc_buf = buffer;
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
msgConfirm("ifconfig: socket");
return;
}
if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0) {
msgConfirm("ifconfig (SIOCGIFCONF)");
return;
}
ifflags = ifc.ifc_req->ifr_flags;
end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) {
char *descr;
/* If it's not a link entry, forget it */
if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK)
continue;
/* Eliminate network devices that don't make sense */
if (!strncmp(ifptr->ifr_name, "tun", 3)
|| !strncmp(ifptr->ifr_name, "lo0", 3))
continue;
descr = NULL;
for (i = 0; device_names[i].name; i++) {
int len = strlen(device_names[i].name);
if (!strncmp(ifptr->ifr_name, device_names[i].name, len)) {
descr = device_names[i].description;
break;
}
}
if (!descr)
descr = "<unknown network interface type>";
deviceRegister(ifptr->ifr_name, descr, strdup(ifptr->ifr_name), DEVICE_TYPE_NETWORK, TRUE,
mediaInitNetwork, NULL, NULL, mediaShutdownNetwork, NULL);
msgDebug("Found a device of type network named: %s\n", ifptr->ifr_name);
close(s);
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
msgConfirm("ifconfig: socket");
continue;
}
if (ifptr->ifr_addr.sa_len) /* I'm not sure why this is here - it's inherited */
ifptr = (struct ifreq *)((caddr_t)ifptr + ifptr->ifr_addr.sa_len - sizeof(struct sockaddr));
}
/* Finally, try to find all the types of devices one might need
* during the second stage of the installation.
*/
for (i = 0; device_names[i].name; i++) {
char try[FILENAME_MAX];
@ -287,54 +334,6 @@ deviceGetAll(void)
break;
}
}
/* Now go for the (other) network interfaces dynamically. Stolen shamelessly from ifconfig! */
ifc.ifc_len = sizeof(buffer);
ifc.ifc_buf = buffer;
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
msgConfirm("ifconfig: socket");
return;
}
if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0) {
msgConfirm("ifconfig (SIOCGIFCONF)");
return;
}
ifflags = ifc.ifc_req->ifr_flags;
end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) {
char *descr;
/* If it's not a link entry, forget it */
if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK)
continue;
/* Eliminate network devices that don't make sense */
if (!strncmp(ifptr->ifr_name, "tun", 3)
|| !strncmp(ifptr->ifr_name, "lo0", 3))
continue;
descr = NULL;
for (i = 0; device_names[i].name; i++) {
int len = strlen(device_names[i].name);
if (!strncmp(ifptr->ifr_name, device_names[i].name, len)) {
descr = device_names[i].description;
break;
}
}
if (!descr)
descr = "<unknown network interface type>";
deviceRegister(ifptr->ifr_name, descr, strdup(ifptr->ifr_name), DEVICE_TYPE_NETWORK, TRUE,
mediaInitNetwork, NULL, NULL, mediaShutdownNetwork, NULL);
msgDebug("Found a device of type network named: %s\n", ifptr->ifr_name);
close(s);
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
msgConfirm("ifconfig: socket");
continue;
}
if (ifptr->ifr_addr.sa_len) /* I'm not sure why this is here - it's inherited */
ifptr = (struct ifreq *)((caddr_t)ifptr + ifptr->ifr_addr.sa_len - sizeof(struct sockaddr));
}
}
/*

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: menus.c,v 1.84 1996/07/31 06:41:29 jkh Exp $
* $Id: menus.c,v 1.85 1996/09/08 01:39:25 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -440,7 +440,7 @@ guaranteed to carry the full range of possible distributions.",
"install",
{ { "Primary Site", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=ftp://ftp.freebsd.org/pub/FreeBSD/" },
{ "Other", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL,
{ "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=other" },
{ "Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=ftp://ftp.au.freebsd.org/pub/FreeBSD/" },