[Midnightbsd-cvs] src [8968] trunk/usr.sbin/sysinstall: add http to legacy sysinstall

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Sep 29 13:28:28 EDT 2016


Revision: 8968
          http://svnweb.midnightbsd.org/src/?rev=8968
Author:   laffer1
Date:     2016-09-29 13:28:28 -0400 (Thu, 29 Sep 2016)
Log Message:
-----------
add http to legacy sysinstall

Modified Paths:
--------------
    trunk/usr.sbin/sysinstall/Makefile
    trunk/usr.sbin/sysinstall/dispatch.c
    trunk/usr.sbin/sysinstall/help/media.hlp
    trunk/usr.sbin/sysinstall/http.c
    trunk/usr.sbin/sysinstall/install.c
    trunk/usr.sbin/sysinstall/media.c
    trunk/usr.sbin/sysinstall/menus.c
    trunk/usr.sbin/sysinstall/options.c
    trunk/usr.sbin/sysinstall/sysinstall.8
    trunk/usr.sbin/sysinstall/sysinstall.h

Modified: trunk/usr.sbin/sysinstall/Makefile
===================================================================
--- trunk/usr.sbin/sysinstall/Makefile	2016-09-27 16:52:23 UTC (rev 8967)
+++ trunk/usr.sbin/sysinstall/Makefile	2016-09-29 17:28:28 UTC (rev 8968)
@@ -1,4 +1,4 @@
-# $MidnightBSD: src/usr.sbin/sysinstall/Makefile,v 1.10 2011/12/18 03:50:50 laffer1 Exp $
+# $MidnightBSD$
 # $FreeBSD: src/usr.sbin/sysinstall/Makefile,v 1.134.2.1 2005/10/07 15:56:30 nyan Exp $
 
 PROG=	sysinstall
@@ -5,9 +5,9 @@
 MAN=	sysinstall.8
 SRCS=	anonFTP.c cdrom.c command.c config.c devices.c dhcp.c \
 	disks.c dispatch.c dist.c dmenu.c doc.c dos.c floppy.c \
-	ftp.c globals.c http.c index.c install.c installUpgrade.c keymap.c \
-	label.c main.c makedevs.c media.c menus.c misc.c modules.c \
-	mouse.c msg.c network.c nfs.c options.c package.c \
+	ftp.c globals.c http.c httpdirect.c index.c install.c \
+	installUpgrade.c keymap.c label.c main.c makedevs.c media.c menus.c \
+	misc.c modules.c mouse.c msg.c network.c nfs.c options.c package.c \
 	system.c tcpip.c termcap.c ttys.c ufs.c usb.c user.c \
 	variable.c wizard.c keymap.h countries.h
 

Modified: trunk/usr.sbin/sysinstall/dispatch.c
===================================================================
--- trunk/usr.sbin/sysinstall/dispatch.c	2016-09-27 16:52:23 UTC (rev 8967)
+++ trunk/usr.sbin/sysinstall/dispatch.c	2016-09-29 17:28:28 UTC (rev 8968)
@@ -4,7 +4,7 @@
  * This is probably the last program in the `sysinstall' line - the next
  * generation being essentially a complete rewrite.
  *
- * $MidnightBSD: src/usr.sbin/sysinstall/dispatch.c,v 1.4 2011/03/26 16:53:46 laffer1 Exp $
+ * $MidnightBSD$
  * $FreeBSD: src/usr.sbin/sysinstall/dispatch.c,v 1.47.2.1 2006/01/31 22:03:18 jkim Exp $
  *
  * Copyright (c) 1995
@@ -103,6 +103,7 @@
     { "mediaSetFTPActive",	mediaSetFTPActive	},
     { "mediaSetFTPPassive",	mediaSetFTPPassive	},
     { "mediaSetHTTP",		mediaSetHTTP		},
+    { "mediaSetHTTPDirect",	mediaSetHTTPDirect	},
     { "mediaSetUFS",		mediaSetUFS		},
     { "mediaSetNFS",		mediaSetNFS		},
     { "mediaSetFTPUserPass",	mediaSetFTPUserPass	},

Modified: trunk/usr.sbin/sysinstall/help/media.hlp
===================================================================
--- trunk/usr.sbin/sysinstall/help/media.hlp	2016-09-27 16:52:23 UTC (rev 8967)
+++ trunk/usr.sbin/sysinstall/help/media.hlp	2016-09-29 17:28:28 UTC (rev 8968)
@@ -41,6 +41,14 @@
             Options screen.
 
 
+   HTTP Direct
+            Get the distribution files directly from an HTTP server.
+
+            If you chose to enter your own URL in the HTTP Direct menu,
+            please note that all paths are *relative* to the root
+            directory of the web server.
+
+
    NFS      Get the distribution files from an NFS server somewhere
             (make sure that permissions on the server allow this!).
             If this install method hangs on you or refuses to work

Modified: trunk/usr.sbin/sysinstall/http.c
===================================================================
--- trunk/usr.sbin/sysinstall/http.c	2016-09-27 16:52:23 UTC (rev 8967)
+++ trunk/usr.sbin/sysinstall/http.c	2016-09-29 17:28:28 UTC (rev 8968)
@@ -37,18 +37,9 @@
 
 extern const char *ftp_dirs[]; /* defined in ftp.c */
 
-static Boolean
-checkAccess(Boolean proxyCheckOnly)
+Boolean
+checkAccess(Boolean connectCheckOnly, Boolean isProxy)
 {
-/* 
- * Some proxies fetch files with certain extensions in "ascii mode" instead
- * of "binary mode" for FTP. The FTP server then translates all LF to CRLF.
- *
- * You can force Squid to use binary mode by appending ";type=i" to the URL,
- * which is what I do here. For other proxies, the LF->CRLF substitution
- * is reverted in distExtract().
- */
-
     int rv, s, af;
     bool el, found=FALSE;		    /* end of header line */
     char *cp, buf[PATH_MAX], req[BUFSIZ];
@@ -77,18 +68,26 @@
     }
     freeaddrinfo(res0);
     if (s == -1) {
-	msgConfirm("Couldn't connect to proxy %s:%s",
-		    variable_get(VAR_HTTP_HOST),variable_get(VAR_HTTP_PORT));
+	if (isProxy) {
+		msgConfirm("Couldn't connect to proxy %s:%s",
+			    variable_get(VAR_HTTP_HOST),variable_get(VAR_HTTP_PORT));
+	} else {
+		msgConfirm("Couldn't connect to server http://%s:%s/",
+			    variable_get(VAR_HTTP_HOST),variable_get(VAR_HTTP_PORT));
+	}
 	variable_unset(VAR_HTTP_HOST);
 	return FALSE;
     }
-    if (proxyCheckOnly) {
+    if (connectCheckOnly) {
        close(s);
        return TRUE;
     }
 
     msgNotify("Checking access to\n %s", variable_get(VAR_HTTP_PATH));
-    sprintf(req, "GET %s/ HTTP/1.0\r\n\r\n", variable_get(VAR_HTTP_PATH));
+    if (isProxy)
+	sprintf(req,"GET %s/ HTTP/1.0\r\n\r\n", variable_get(VAR_HTTP_PATH));
+    else
+	sprintf(req,"GET /%s/ HTTP/1.0\r\n\r\n", variable_get(VAR_HTTP_PATH));
     write(s,req,strlen(req));
 /*
  *  scan the headers of the response
@@ -109,7 +108,16 @@
 		}
 	    }
 
-	    if (!strncmp(buf,"Server: ",8)) {
+	    /* 
+	     * Some proxies fetch files with certain extensions in "ascii mode"
+	     * instead of "binary mode" for FTP. The FTP server then translates
+	     * all LF to CRLF.
+	     *
+	     * You can force Squid to use binary mode by appending ";type=i" to
+	     * the URL, which is what I do here. For other proxies, the
+	     * LF->CRLF substitution is reverted in distExtract().
+	     */
+	    if (isProxy && !strncmp(buf,"Server: ",8)) {
 		if (!strncmp(buf,"Server: Squid",13)) {
 		    variable_set2(VAR_HTTP_FTP_MODE,";type=i",0);
 		} else {
@@ -144,11 +152,11 @@
     /* 
      * First verify the proxy access
      */
-    checkAccess(TRUE);
+    checkAccess(TRUE, TRUE);
     while (variable_get(VAR_HTTP_HOST) == NULL) {
         if (DITEM_STATUS(mediaSetHTTP(NULL)) == DITEM_FAILURE)
             return FALSE;
-        checkAccess(TRUE);
+        checkAccess(TRUE, TRUE);
     }
 again:
     /* If the release is specified as "__RELEASE" or "any", then just
@@ -164,7 +172,7 @@
             sprintf(req, "%s/%s/%s", variable_get(VAR_FTP_PATH),
                 ftp_dirs[fdir], rel);
             variable_set2(VAR_HTTP_PATH, req, 0);
-            if (checkAccess(FALSE)) {
+            if (checkAccess(FALSE, TRUE)) {
                 found = TRUE;
                 break;
             }
@@ -171,7 +179,7 @@
         }
     } else {
         variable_set2(VAR_HTTP_PATH, variable_get(VAR_FTP_PATH), 0);
-        found = checkAccess(FALSE);
+        found = checkAccess(FALSE, TRUE);
     }
     if (!found) {
     	msgConfirm("No such directory: %s\n"
@@ -220,7 +228,7 @@
 	return NULL;
     }
 						   
-    sprintf(req, "GET %s/%s%s HTTP/1.0\r\n\r\n",
+    sprintf(req,"GET %s/%s%s HTTP/1.0\r\n\r\n",
 	    variable_get(VAR_HTTP_PATH), file, variable_get(VAR_HTTP_FTP_MODE));
 
     if (isDebug()) {

Modified: trunk/usr.sbin/sysinstall/install.c
===================================================================
--- trunk/usr.sbin/sysinstall/install.c	2016-09-27 16:52:23 UTC (rev 8967)
+++ trunk/usr.sbin/sysinstall/install.c	2016-09-29 17:28:28 UTC (rev 8968)
@@ -4,7 +4,7 @@
  * This is probably the last program in the `sysinstall' line - the next
  * generation being essentially a complete rewrite.
  *
- * $MidnightBSD: src/usr.sbin/sysinstall/install.c,v 1.9 2011/03/26 16:53:46 laffer1 Exp $
+ * $MidnightBSD$
  * $FreeBSD: src/usr.sbin/sysinstall/install.c,v 1.363.2.1 2006/01/06 20:10:41 ceri Exp $
  *
  * Copyright (c) 1995
@@ -303,7 +303,7 @@
 		msgConfirm("No USB devices found!");
 		return (DITEM_FAILURE);
 	} else if (!file_readable("/dist/rescue/ldconfig")) {
-		msgConfirm("Unable to find a FreeBSD live filesystem.");
+		msgConfirm("Unable to find a BSD live filesystem.");
 		return (DITEM_FAILURE);
 	}
 

Modified: trunk/usr.sbin/sysinstall/media.c
===================================================================
--- trunk/usr.sbin/sysinstall/media.c	2016-09-27 16:52:23 UTC (rev 8967)
+++ trunk/usr.sbin/sysinstall/media.c	2016-09-29 17:28:28 UTC (rev 8968)
@@ -4,7 +4,7 @@
  * This is probably the last attempt in the `sysinstall' line, the next
  * generation being slated to essentially a complete rewrite.
  * 
- * $MidnightBSD: src/usr.sbin/sysinstall/media.c,v 1.8 2009/05/21 00:08:40 laffer1 Exp $
+ * $MidnightBSD$
  * $FreeBSD: src/usr.sbin/sysinstall/media.c,v 1.121.12.1 2006/01/31 22:03:18 jkim Exp $
  *
  * Copyright (c) 1995
@@ -53,6 +53,7 @@
 
 static Boolean got_intr = FALSE;
 static Boolean ftp_skip_resolve = FALSE;
+static Boolean http_skip_resolve = FALSE;
 
 /* timeout handler */
 static void
@@ -509,6 +510,139 @@
     mediaDevice->shutdown = dummyShutdown;
     return DITEM_SUCCESS | DITEM_LEAVE_MENU | what;
 }
+
+/*
+ * Return 0 if we successfully found and set the installation type to
+ * be an http server
+ */
+int
+mediaSetHTTPDirect(dialogMenuItem *self)
+{
+    static Device httpDevice;
+    char *cp, hbuf[MAXPATHLEN], *hostname, *dir;
+    struct addrinfo hints, *res;
+    int af;
+    size_t urllen;
+    int HttpPort;
+    static Device *networkDev = NULL;
+
+    mediaClose();
+    cp = variable_get(VAR_HTTP_PATH);
+    /* If we've been through here before ... */
+    if (networkDev && cp && msgYesNo("Re-use old HTTP site selection values?"))
+	cp = NULL;
+    if (!cp) {
+	if (!dmenuOpenSimple(&MenuMediaHTTPDirect, FALSE))
+	    return DITEM_FAILURE;
+	else
+	    cp = variable_get(VAR_HTTP_PATH);
+    }
+    if (!cp)
+	return DITEM_FAILURE;
+    else if (!strcmp(cp, "other")) {
+	variable_set2(VAR_HTTP_PATH, "http://", 0);
+	cp = variable_get_value(VAR_HTTP_PATH, "Please specify the URL of a BSD distribution on a\n"
+				"remote http site.\n"
+				"A URL looks like this:  http://<hostname>/<path>", 0);
+	if (!cp || !*cp || !strcmp(cp, "http://")) {
+	    variable_unset(VAR_HTTP_PATH);
+	    return DITEM_FAILURE;
+	}
+	urllen = strlen(cp);
+	if (urllen >= sizeof(httpDevice.name)) {
+	    msgConfirm("Length of specified URL is %zu characters. Allowable maximum is %zu.",
+			urllen,sizeof(httpDevice.name)-1);
+	    variable_unset(VAR_HTTP_PATH);
+	    return DITEM_FAILURE;
+	}
+    }
+    if (strncmp("http://", cp, 7)) {
+	msgConfirm("Sorry, %s is an invalid URL!", cp);
+	variable_unset(VAR_HTTP_PATH);
+	return DITEM_FAILURE;
+    }
+    SAFE_STRCPY(httpDevice.name, cp);
+    SAFE_STRCPY(hbuf, cp + 7);
+    hostname = hbuf;
+
+    if (!networkDev || msgYesNo("You've already done the network configuration once,\n"
+				"would you like to skip over it now?") != 0) {
+	if (networkDev)
+	    DEVICE_SHUTDOWN(networkDev);
+	if (!(networkDev = tcpDeviceSelect())) {
+	    variable_unset(VAR_HTTP_PATH);
+	    return DITEM_FAILURE;
+	}
+    }
+    if (!DEVICE_INIT(networkDev)) {
+	if (isDebug())
+	    msgDebug("mediaSetHTTPDirect: Net device init failed.\n");
+	variable_unset(VAR_HTTP_PATH);
+	return DITEM_FAILURE;
+    }
+    if (*hostname == '[' && (cp = index(hostname + 1, ']')) != NULL &&
+	(*++cp == '\0' || *cp == '/' || *cp == ':')) {
+	++hostname;
+	*(cp - 1) = '\0';
+    }
+    else
+	cp = index(hostname, ':');
+    if (cp != NULL && *cp == ':') {
+	*(cp++) = '\0';
+	HttpPort = strtol(cp, 0, 0);
+    }
+    else
+	HttpPort = 80;
+    if ((dir = index(cp ? cp : hostname, '/')) != NULL)
+	*(dir++) = '\0';
+    if (isDebug()) {
+	msgDebug("hostname = `%s'\n", hostname);
+	msgDebug("dir = `%s'\n", dir ? dir : "/");
+	msgDebug("port # = `%d'\n", HttpPort);
+    }
+    if (!http_skip_resolve && variable_get(VAR_NAMESERVER)) {
+	msgNotify("Looking up host %s.", hostname);
+    	if (isDebug())
+	    msgDebug("Starting DNS.\n");
+	kickstart_dns();
+    	if (isDebug())
+	    msgDebug("Looking up hostname, %s, using getaddrinfo(AI_NUMERICHOST).\n", hostname);
+	af = variable_cmp(VAR_IPV6_ENABLE, "YES") ? AF_INET : AF_UNSPEC;
+	memset(&hints, 0, sizeof(hints));
+	hints.ai_family = af;
+	hints.ai_socktype = SOCK_STREAM;
+	hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
+	if (getaddrinfo(hostname, NULL, &hints, &res) != 0) {
+	    if (isDebug())
+		msgDebug("Looking up hostname, %s, using getaddrinfo().\n",
+			 hostname);
+	    hints.ai_flags = AI_PASSIVE;
+	    if (getaddrinfo(hostname, NULL, &hints, &res) != 0) {
+		msgConfirm("Cannot resolve hostname `%s'!  Are you sure that"
+			" your\nname server, gateway and network interface are"
+			" correctly configured?", hostname);
+		if (networkDev)
+		    DEVICE_SHUTDOWN(networkDev);
+		networkDev = NULL;
+		variable_unset(VAR_HTTP_PATH);
+		return DITEM_FAILURE;
+	    }
+	}
+	freeaddrinfo(res);
+	if (isDebug())
+	    msgDebug("Found DNS entry for %s successfully..\n", hostname);
+    }
+    variable_set2(VAR_HTTP_HOST, hostname, 0);
+    variable_set2(VAR_HTTP_DIR, dir ? dir : "/", 0);
+    variable_set2(VAR_HTTP_PORT, itoa(HttpPort), 0);
+    httpDevice.type = DEVICE_TYPE_HTTP_DIRECT;
+    httpDevice.init = mediaInitHTTPDirect;
+    httpDevice.get = mediaGetHTTPDirect;
+    httpDevice.shutdown = dummyShutdown;
+    httpDevice.private = networkDev;
+    mediaDevice = &httpDevice;
+    return DITEM_SUCCESS | DITEM_LEAVE_MENU | DITEM_RESTORE;
+}
    
 
 int

Modified: trunk/usr.sbin/sysinstall/menus.c
===================================================================
--- trunk/usr.sbin/sysinstall/menus.c	2016-09-27 16:52:23 UTC (rev 8967)
+++ trunk/usr.sbin/sysinstall/menus.c	2016-09-29 17:28:28 UTC (rev 8968)
@@ -35,7 +35,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-  "$MidnightBSD: src/usr.sbin/sysinstall/menus.c,v 1.20 2012/12/01 14:50:49 laffer1 Exp $";
+  "$MidnightBSD$";
 #endif
 
 #include "sysinstall.h"
@@ -192,7 +192,8 @@
       { " Media, UFS",		"Select UFS installation media.",	NULL, mediaSetUFS },
       { " Media, FTP",		"Select FTP installation media.",	NULL, mediaSetFTP },
       { " Media, FTP Passive",	"Select passive FTP installation media.", NULL, mediaSetFTPPassive },
-      { " Media, HTTP",		"Select FTP via HTTP proxy install media.", NULL, mediaSetHTTP },
+      { " Media, HTTP Proxy",	"Select FTP via HTTP proxy install media.", NULL, mediaSetHTTP },
+      { " Media, HTTP Direct",	"Select HTTP direct installation media.", NULL, mediaSetHTTPDirect },
       { " Network Interfaces",	"Configure network interfaces",		NULL, tcpMenuSelect },
       { " Networking Services",	"The network services menu.",		NULL, dmenuSubmenu, NULL, &MenuNetworking },
       { " NFS, client",		"Set NFS client flag.",			dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_client_enable=YES" },
@@ -465,6 +466,21 @@
       { NULL } }
 };
 
+DMenu MenuMediaHTTPDirect = {
+    DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+    "Please select a BSD HTTP distribution site",
+    "Please select the site closest to you or \"other\" if you'd like to\n"
+    "specify a different choice.  Also note that not every site listed here\n"
+    "carries more than the base distribution kits. Only Primary sites are\n"
+    "guaranteed to carry the full range of possible distributions.",
+    "Select a site that's close!",
+    NULL,
+    { { "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL,
+	VAR_HTTP_PATH "=other" },
+
+      { NULL } }
+};
+
 DMenu MenuNetworkDevice = {
     DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
     "Network interface information required",
@@ -510,12 +526,13 @@
     { { "1 CD/DVD",		"Install from a MidnightBSD CD/DVD",	NULL, mediaSetCDROM },
       { "2 FTP",		"Install from an FTP server",		NULL, mediaSetFTPActive },
       { "3 FTP Passive",	"Install from an FTP server through a firewall", NULL, mediaSetFTPPassive },
-      { "4 HTTP",		"Install from an FTP server through a http proxy", NULL, mediaSetHTTP },
-      { "5 DOS",		"Install from a DOS partition",		NULL, mediaSetDOS },
-      { "6 NFS",		"Install over NFS",			NULL, mediaSetNFS },
-      { "7 File System",	"Install from an existing filesystem",	NULL, mediaSetUFS },
-      { "8 Floppy",		"Install from a floppy disk set",	NULL, mediaSetFloppy },
-      { "9 USB",		"Install from a USB drive",		NULL, mediaSetUSB },
+      { "4 HTTP Proxy",		"Install from an FTP server through a http proxy", NULL, mediaSetHTTP },
+      { "5 HTTP Direct",	"Install from an HTTP server",		NULL, mediaSetHTTPDirect },
+      { "6 DOS",		"Install from a DOS partition",		NULL, mediaSetDOS },
+      { "7 NFS",		"Install over NFS",			NULL, mediaSetNFS },
+      { "8 File System",	"Install from an existing filesystem",	NULL, mediaSetUFS },
+      { "9 Floppy",		"Install from a floppy disk set",	NULL, mediaSetFloppy },
+      { "A USB",		"Install from a USB drive",		NULL, mediaSetUSB },
       { "X Options",		"Go to the Options screen",		NULL, optionsEditor },
       { NULL } },
 };
@@ -708,7 +725,7 @@
     "Choose Custom Installation Options",
     "This is the custom installation menu. You may use this menu to specify\n"
     "details on the type of distribution you wish to have, where you wish\n"
-    "to install it from and how you wish to allocate disk storage to FreeBSD.",
+    "to install it from and how you wish to allocate disk storage to BSD.",
     NULL,
     NULL,
     { { "X Exit",		"Exit this menu (returning to previous)", NULL,	dmenuExit },

Modified: trunk/usr.sbin/sysinstall/options.c
===================================================================
--- trunk/usr.sbin/sysinstall/options.c	2016-09-27 16:52:23 UTC (rev 8967)
+++ trunk/usr.sbin/sysinstall/options.c	2016-09-29 17:28:28 UTC (rev 8968)
@@ -78,6 +78,9 @@
 	case DEVICE_TYPE_HTTP:
 	    return "HTTP Proxy";
 
+	case DEVICE_TYPE_HTTP_DIRECT:
+	    return "HTTP Direct";
+
 	case DEVICE_TYPE_CDROM:
 	    return "CDROM";
 

Modified: trunk/usr.sbin/sysinstall/sysinstall.8
===================================================================
--- trunk/usr.sbin/sysinstall/sysinstall.8	2016-09-27 16:52:23 UTC (rev 8967)
+++ trunk/usr.sbin/sysinstall/sysinstall.8	2016-09-29 17:28:28 UTC (rev 8968)
@@ -685,6 +685,8 @@
 .Bl -tag -width indent
 .It _httpPath
 The proxy to use (host:port) (non-optional).
+.It httpDirectory
+The path from http root.
 .El
 .It mediaSetUFS
 Select an existing UFS partition (mounted with the label editor) as

Modified: trunk/usr.sbin/sysinstall/sysinstall.h
===================================================================
--- trunk/usr.sbin/sysinstall/sysinstall.h	2016-09-27 16:52:23 UTC (rev 8967)
+++ trunk/usr.sbin/sysinstall/sysinstall.h	2016-09-29 17:28:28 UTC (rev 8968)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/sysinstall/sysinstall.h,v 1.264.2.2 2006/01/31 22:03:19 jkim Exp $
- * $MidnightBSD: src/usr.sbin/sysinstall/sysinstall.h,v 1.10 2011/03/26 16:53:46 laffer1 Exp $
+ * $MidnightBSD$
  */
 
 #ifndef _SYSINSTALL_H_INCLUDE
@@ -119,6 +119,7 @@
 #define VAR_FTP_STATE			"ftpState"
 #define VAR_FTP_USER			"ftpUser"
 #define VAR_FTP_HOST			"ftpHost"
+#define VAR_HTTP_DIR			"httpDirectory"
 #define VAR_HTTP_PATH			"_httpPath"
 #define VAR_HTTP_PROXY			"httpProxy"
 #define VAR_HTTP_PORT			"httpPort"
@@ -274,6 +275,7 @@
     DEVICE_TYPE_NFS,
     DEVICE_TYPE_ANY,
     DEVICE_TYPE_HTTP,
+    DEVICE_TYPE_HTTP_DIRECT,
 } DeviceType;
 
 /* CDROM mount codes */
@@ -444,6 +446,7 @@
 extern DMenu		MenuMediaDOS;		/* DOS media menu				*/
 extern DMenu		MenuMediaFloppy;	/* Floppy media menu				*/
 extern DMenu		MenuMediaFTP;		/* FTP media menu				*/
+extern DMenu		MenuMediaHTTPDirect;	/* HTTP Direct media menu			*/
 extern DMenu		MenuNetworkDevice;	/* Network device menu				*/
 extern DMenu		MenuNTP;		/* NTP time server menu				*/
 extern DMenu		MenuSecurity;		/* System security options menu			*/
@@ -644,9 +647,14 @@
 extern void	mediaShutdownFTP(Device *dev);
 
 /* http.c */
+extern Boolean	checkAccess(Boolean connectCheckOnly, Boolean isProxy);
 extern Boolean	mediaInitHTTP(Device *dev);
 extern FILE	*mediaGetHTTP(Device *dev, char *file, Boolean probe);
 
+/* httpdirect.c */
+extern Boolean	mediaInitHTTPDirect(Device *dev);
+extern FILE	*mediaGetHTTPDirect(Device *dev, char *file, Boolean probe);
+
 /* globals.c */
 extern void	globalsInit(void);
 
@@ -720,6 +728,7 @@
 extern int	mediaSetFTPActive(dialogMenuItem *self);
 extern int	mediaSetFTPPassive(dialogMenuItem *self);
 extern int	mediaSetHTTP(dialogMenuItem *self);
+extern int	mediaSetHTTPDirect(dialogMenuItem *self);
 extern int	mediaSetUFS(dialogMenuItem *self);
 extern int	mediaSetNFS(dialogMenuItem *self);
 extern int	mediaSetFTPUserPass(dialogMenuItem *self);



More information about the Midnightbsd-cvs mailing list