svn commit: r247280 - in head/usr.sbin/bsdconfig: include networking networking/include networking/share share share/media

Devin Teske dteske at FreeBSD.org
Mon Feb 25 19:55:35 UTC 2013


Author: dteske
Date: Mon Feb 25 19:55:32 2013
New Revision: 247280
URL: http://svnweb.freebsd.org/changeset/base/247280

Log:
  Import media selection/preparation framework (sysinstall inspired). Makes
  accessing files from various types of media nice and abstracted away from
  the wet-work involved in preparing, validating, and initializing those
  types of media. This will be used for the package management system module
  and other modules that need access to files and want to allow the user to
  decide where those files come from (either in a scripted fashion, prompted
  fashion, or any combination thereof).
  
  Heavily inspired by sysinstall and even uses the same reserved words so
  that scripts are portable. Coded over months, tested continuously through-
  out, and reviewed several times.
  
  Some notes about the changes:
  - Move network-setting acquisition/validation routines to media/tcpip.subr
  - The options screen from sysinstall has been converted to a dialog menu
  - The "UFS" media choice is renamed to "Directory" to reflect how sysinstall
    treats the choice and a new [true] "UFS" media choice has been added that
    acts on real UFS partitions (such as external disks with disklabels).
  - Many more help files have been resurrected from sysinstall (I noticed that
    some of the content seems a bit dated; I gave them a once-over but they
    could really use an update).
  - A total of 10 media choices are presented (via mediaGetType) including:
    CD/DVD, FTP, FTP Passive, HTTP Proxy, Directory, NFS, DOS, UFS, Floppy, USB
  - Novel struct/device management layer for managing the issue of passing
    more information than can comfortably fit in an argument list.

Added:
  head/usr.sbin/bsdconfig/include/media.hlp   (contents, props changed)
  head/usr.sbin/bsdconfig/include/network_device.hlp   (contents, props changed)
  head/usr.sbin/bsdconfig/include/options.hlp   (contents, props changed)
  head/usr.sbin/bsdconfig/include/tcp.hlp
     - copied unchanged from r245694, head/usr.sbin/bsdconfig/networking/include/tcp.hlp
  head/usr.sbin/bsdconfig/share/device.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/
  head/usr.sbin/bsdconfig/share/media/Makefile   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/any.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/cdrom.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/common.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/directory.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/dos.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/floppy.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/ftp.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/httpproxy.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/network.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/nfs.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/options.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/tcpip.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/ufs.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/media/usb.subr   (contents, props changed)
  head/usr.sbin/bsdconfig/share/struct.subr   (contents, props changed)
Deleted:
  head/usr.sbin/bsdconfig/networking/include/tcp.hlp
Modified:
  head/usr.sbin/bsdconfig/include/Makefile
  head/usr.sbin/bsdconfig/include/messages.subr
  head/usr.sbin/bsdconfig/networking/devices
  head/usr.sbin/bsdconfig/networking/include/Makefile
  head/usr.sbin/bsdconfig/networking/share/common.subr
  head/usr.sbin/bsdconfig/networking/share/device.subr
  head/usr.sbin/bsdconfig/networking/share/hostname.subr
  head/usr.sbin/bsdconfig/networking/share/ipaddr.subr
  head/usr.sbin/bsdconfig/networking/share/netmask.subr
  head/usr.sbin/bsdconfig/networking/share/resolv.subr
  head/usr.sbin/bsdconfig/networking/share/routing.subr
  head/usr.sbin/bsdconfig/share/Makefile
  head/usr.sbin/bsdconfig/share/common.subr
  head/usr.sbin/bsdconfig/share/script.subr
  head/usr.sbin/bsdconfig/share/strings.subr
  head/usr.sbin/bsdconfig/share/variable.subr

Modified: head/usr.sbin/bsdconfig/include/Makefile
==============================================================================
--- head/usr.sbin/bsdconfig/include/Makefile	Mon Feb 25 19:22:56 2013	(r247279)
+++ head/usr.sbin/bsdconfig/include/Makefile	Mon Feb 25 19:55:32 2013	(r247280)
@@ -3,7 +3,8 @@
 NO_OBJ=
 
 FILESDIR=	${LIBEXECDIR}/bsdconfig/include
-FILES=		bsdconfig.hlp messages.subr usage.hlp
+FILES=		bsdconfig.hlp media.hlp messages.subr network_device.hlp \
+		options.hlp tcp.hlp usage.hlp
 
 beforeinstall:
 	mkdir -p ${DESTDIR}${FILESDIR}

Added: head/usr.sbin/bsdconfig/include/media.hlp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.sbin/bsdconfig/include/media.hlp	Mon Feb 25 19:55:32 2013	(r247280)
@@ -0,0 +1,48 @@
+You can install from the following types of media:
+
+   CDROM    requires one of the following supported CDROM drives:
+            ATAPI - Any standard ATAPI CDROM drive hooked to
+            a supported controller (see Hardware Guide).
+            SCSI - Any standard SCSI CDROM drive hooked to
+            a supported controller (see Hardware Guide).
+
+
+   DOS      A DOS primary partition with the required FreeBSD
+            distribution files copied onto it (e.g. C:\FREEBSD\)
+
+
+   UFS      Assuming a disk or partition with an existing
+            FreeBSD file system and distribution set on it,
+            get the distribution files from there.
+
+
+   Floppy   Get distribution files from one or more DOS or UFS
+            formatted floppies.  Such floppies are assumed to
+            contain the appropriate distribution pieces - see
+            ABOUT.TXT for more information about making floppy
+            distribution media.
+
+
+   FTP      Get the distribution files from an anonymous ftp server
+            (you will be presented with a list).  Please note that
+            you may invoke FTP in "Active" mode, "Passive" mode, or
+            via an HTTP proxy.
+
+            Active mode is the standard way of fetching files and
+            Passive mode is for use when you're behind a firewall or
+            some other security mechanism that blocks active FTP
+            connections.  Using an HTTP proxy is sometimes necessary
+            for firewalls which block all FTP connections.
+
+            If you chose to enter your own URL in the FTP menu, please
+            note that all paths are *relative* to the home directory
+            of the user being logged in as.  By default, this is the
+            user "ftp" (anonymous ftp) but you may change this in the
+            Options screen.
+
+
+   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
+            properly, you may need to set some special options for
+            your NFS server.  See the Options screen for more details.

Modified: head/usr.sbin/bsdconfig/include/messages.subr
==============================================================================
--- head/usr.sbin/bsdconfig/include/messages.subr	Mon Feb 25 19:22:56 2013	(r247279)
+++ head/usr.sbin/bsdconfig/include/messages.subr	Mon Feb 25 19:55:32 2013	(r247280)
@@ -1,5 +1,5 @@
 # Copyright (c) 2012 Ron McDowell
-# Copyright (c) 2012 Devin Teske
+# Copyright (c) 2012-2013 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -27,39 +27,251 @@
 
 field_username="Username:"
 field_password="Password:"
+hline_alnum_arrows_punc_tab_enter="Use alnum, arrows, punctuation, TAB or ENTER"
 hline_alnum_punc_tab_enter="Use alpha-numeric, punctuation, TAB or ENTER"
 hline_arrows_tab_enter="Press arrows, TAB or ENTER"
+hline_choose_help_for_more_information_on_media_types="Choose Help for more information on the various media types"
+msg_accept_continue="Accept/Continue"
 msg_always_try_sudo_when_run_as="Always try sudo(8) when run as %s"
+msg_argentina="Argentina"
+msg_assume_network_is_already_configured="Running multi-user, assume that the network is already configured?"
+msg_attempt_automatic_dhcp_configuration="Attempt automatic DHCP configuration of interfaces"
+msg_attempt_ipv6_configuration_of_interfaces="Attempt IPv6 configuration of interfaces"
+msg_australia="Australia"
+msg_austria="Austria"
 msg_becoming_root_via_sudo="Becoming root via sudo(8)..."
+msg_brazil="Brazil"
+msg_canada="Canada"
 msg_cancel="Cancel"
 msg_cancel_exit="Cancel/Exit"
 msg_cannot_create_permission_denied="%s: cannot create %s: Permission denied"
+msg_cannot_resolve_hostname="Cannot resolve \`%s'!  Are you sure that your\nname server, gateway and network interface are correctly configured?"
+msg_cant_find_distribution="Warning:  Can't find the \`%s' distribution on this\nFTP server.  You may need to visit a different server for\nthe release you are trying to fetch or go to the Options\nmenu and set the release name to explicitly match what's\navailable on %s (or set to \"any\").\n\nWould you like to select another FTP server?"
+msg_cant_seem_to_write_out_resolv_conf="Can't seem to write out %s.  Net cannot be used."
+msg_cd_dvd="CD/DVD"
+msg_cdrom="CDROM"
+msg_checking_access_to="Checking access to\n %s"
+msg_china="China"
+msg_choose_a_cd_dvd_type="Choose a CD/DVD type"
+msg_choose_a_dos_partition="Choose a DOS partition"
+msg_choose_a_floppy_drive="Choose a Floppy drive"
+msg_choose_a_ufs_partition="Choose a UFS partition"
+msg_choose_a_usb_partition="Choose a USB drive"
+msg_choose_installation_media="Choose Installation Media"
+msg_choose_installation_media_description="FreeBSD can be installed from a variety of different installation\nmedia, ranging from floppies to an Internet FTP server.  If you're\ninstalling FreeBSD from a supported CD/DVD drive then this is generally\nthe best media to use if you have no overriding reason for using other\nmedia."
+msg_client_error="Client error, you could try an other server"
 msg_command_failed_rest_of_script_aborted="Command \`%s' failed - rest of script aborted."
+msg_configuration_for_interface="Configuration for Interface"
+msg_could_not_unmount_the_cdrom_dvd="Could not unmount the CDROM/DVD from %s: %s"
+msg_could_not_unmount_the_dos_partition="Could not unmount the DOS partition from %s: %s"
+msg_could_not_unmount_the_nfs_partition="Could not unmount the NFS partition from %s: %s"
+msg_could_not_unmount_the_ufs_partition="Could not unmount the UFS partition from %s: %s"
+msg_couldnt_connect_to_proxy="Couldn't connect to proxy"
+msg_couldnt_connect_to_ftp_server="Couldn't connect to FTP server"
+msg_couldnt_open_ftp_connection="Couldn't open FTP connection to %s:\n  %s."
 msg_created_path="Created %s"
+msg_croatia="Croatia"
+msg_czech_republic="Czech Republic"
+msg_debugging="Debugging"
+msg_denmark="Denmark"
+msg_device_is_not_configured="The %s device is not configured.  You will need to do so\nin the Networking configuration menu before proceeding."
+msg_dhcp="DHCP"
+msg_dialog_mixedform_navigation_help="Use <up>/<down> arrows to navigate between fields, TAB to focus buttons, and Enter for OK/Cancel."
+msg_directory="Directory"
 msg_directory_not_found="%s: Directory not found."
+msg_done="Done"
+msg_dos="DOS"
+msg_editor="Editor"
+msg_emit_extra_debugging_output="Emit extra debugging output"
+msg_enter_a_fully_qualified_pathname_for_the_directory="Enter a fully qualified pathname for the directory\ncontaining the FreeBSD distribution files:"
+msg_enter_the_device_name_of_a_ufs_formatted_partition="Enter the device-name of a UFS formatted partition"
+msg_error="Error"
+msg_error_mounting_device="Error mounting %s on %s: %s"
+msg_error_mounting_floppy_device="Error mounting floppy %s (%s) on %s: %s"
+msg_error_mounting_usb_drive="Error mounting USB drive %s on %s: %s"
+msg_error_when_requesting_url="Error when requesting %s, you could try an other server"
+msg_estonia="Estonia"
 msg_exit="Exit"
 msg_exit_bsdconfig="Exit bsdconfig"
+msg_extra_options_to_ifconfig="Extra options to ifconfig (usually empty):"
+msg_failed_to_add_default_route="Failed to add a default route; please check your network configuration"
+msg_file_system="File System"
+msg_finland="Finland"
+msg_floppy="Floppy"
+msg_france="France"
+msg_ftp="FTP"
+msg_ftp_passive="FTP Passive"
+msg_ftp_username="FTP username"
+msg_germany="Germany"
+msg_greece="Greece"
+msg_help="Help"
+msg_host_name_including_domain="Host name (including domain)"
+msg_hostname_variable_not_set="WARNING: hostname variable not set and is a non-optional\nparameter.  Please add this to your installation script\nor set the netInteractive variable (see bsdconfig man page)"
+msg_http="HTTP"
+msg_http_proxy="HTTP Proxy"
+msg_hungary="Hungary"
+msg_iceland="Iceland"
+msg_install_from_a_dos_partition="Install from a DOS partition"
+msg_install_from_a_floppy_disk_set="Install from a floppy disk set"
+msg_install_from_a_freebsd_cd_dvd="Install from a FreeBSD CD/DVD"
+msg_install_from_a_usb_drive="Install from a USB drive"
+msg_install_from_a_ufs_partition="Install from a UFS partition"
+msg_install_from_an_ftp_server="Install from an FTP server"
+msg_install_from_an_ftp_server_thru_firewall="Install from an FTP server through a firewall"
+msg_install_from_an_ftp_server_thru_proxy="Install from an FTP server through an HTTP proxy"
+msg_install_from_the_existing_filesystem="Install from the existing filesystem"
+msg_install_over_nfs="Install over NFS"
+msg_invalid_gateway_ipv4_address_specified="Invalid gateway IPv4 address specified"
+msg_invalid_hostname_value="Invalid hostname value"
+msg_invalid_ipv4_address="Invalid IPv4 address"
+msg_invalid_name_server_ip_address_specified="Invalid name server IP address specified"
+msg_invalid_netmask_value="Invalid netmask value"
+msg_invalid_nfs_path_specification="Invalid NFS path specification.  Must be of the form:\nhost:/full/pathname/to/FreeBSD/distdir"
+msg_ipv4_address="IPv4 Address"
+msg_ipv4_gateway="IPv4 Gateway"
+msg_ipv6="IPv6"
+msg_ipv6_ready="IPv6 ready"
+msg_ireland="Ireland"
+msg_israel="Israel"
+msg_italy="Italy"
+msg_japan="Japan"
+msg_korea="Korea"
+msg_lithuania="Lithuania"
+msg_length_of_specified_url_is_too_long="Length of specified URL is %u characters. Allowable maximum is %u."
+msg_logging_in_to_user_at_host="Logging in to %s@%s.."
+msg_looking_up_host="Looking up host %s"
 msg_main_menu="Main Menu"
+msg_main_site="Main Site"
+msg_media_timeout="Media Timeout"
+msg_media_type="Media Type"
 msg_menu_text="If you've already installed FreeBSD, you may use\nthis menu to customize it somewhat to suit your\nparticular configuration.  Most importantly, you\ncan use the Packages utility to load extra '3rd\nparty' software not provided in the base\ndistributions."
+msg_missing_ftp_host_or_directory="Missing FTP host or directory specification.  FTP media not initialized."
 msg_must_be_root_to_execute="%s: must be root to execute"
+msg_must_specify_a_host_name_of_some_sort="Must specify a host name of some sort!"
+msg_name_server="Name server"
+msg_net_device_init_failed="Net device init failed."
+msg_netmask="Netmask"
+msg_netherlands="Netherlands"
+msg_network_configuration="Network Configuration"
+msg_network_interface_information_required="Network interface information required"
 msg_nfailed_attempts="%u incorrect password attempts"
+msg_nfs="NFS"
+msg_nfs_secure="NFS Secure"
+msg_nfs_server_talks_only_on_a_secure_port="NFS server talks only on a secure port"
+msg_nfs_slow="NFS Slow"
+msg_nfs_tcp="NFS TCP"
+msg_nfs_version_3="NFS version 3"
 msg_no="No"
+msg_no_cd_dvd_devices_found="No CD/DVD devices found!  Please check that your system's\nconfiguration is correct and that the CD/DVD drive is of a\nsupported type. For more information, consult the hardware\nguide in the Doc menu."
+msg_no_dos_primary_partitions_found="No DOS primary partitions found!  This installation method is unavailable"
+msg_no_floppy_devices_found="No floppy devices found!  Please check that your system's configuration\nis correct.  For more information, consult the hardware guide in the Doc\nmenu."
+msg_no_gateway_has_been_set="No gateway has been set. You will be unable to access hosts\nnot on your local network"
+msg_no_network_devices="No network devices available!"
 msg_no_such_file_or_directory="%s: %s: No such file or directory"
+msg_no_usb_devices_found="No USB devices found (try Options/Re-scan Devices)"
 msg_no_username="No username provided!"
+msg_norway="Norway"
+msg_not_a_directory="%s: %s: Not a directory"
 msg_not_found="not found"
+msg_not_yet_set="not yet set"
 msg_ok="OK"
+msg_options="Options"
+msg_options_editor="Options Editor"
+msg_other="other"
 msg_permission_denied="%s: %s: Permission denied"
+msg_please_check_the_url_and_try_again="No such directory: %s\nplease check the URL and try again."
 msg_please_enter_password="Please enter your password for sudo(8):"
 msg_please_enter_username_password="Please enter a username and password for sudo(8):"
+msg_please_enter_the_address_of_the_http_proxy="Please enter the address of the HTTP proxy in this format:\n hostname:port (the ':port' is optional, default is 3128)"
+msg_please_enter_the_full_nfs_file_specification="Please enter the full NFS file specification for the remote\nhost and directory containing the FreeBSD distribution files.\nThis should be in the format:  hostname:/some/freebsd/dir"
+msg_please_enter_the_password_for_this_user="Please enter the password for this user:"
+msg_please_enter_the_username_you_wish_to_login_as="Please enter the username you wish to login as:"
+msg_please_insert_floppy_in_drive="Please insert floppy in %s"
+msg_please_insert_floppy_containing="Please insert floppy containing %s in %s"
+msg_please_select_a_cd_dvd_drive="FreeBSD can be installed directly from a CD/DVD containing a valid\nFreeBSD distribution.  If you are seeing this menu it is because\nmore than one CD/DVD drive was found on your system.  Please select\none of the following CD/DVD drives as your installation drive."
+msg_please_select_a_floppy_drive="You have more than one floppy drive.  Please choose which drive\nyou would like to use."
+msg_please_select_a_freebsd_ftp_distribution_site="Please select a FreeBSD FTP distribution site"
+msg_please_select_dos_partition="FreeBSD can be installed directly from a DOS partition assuming,\nof course, that you have copied the relevant distributions into\nyour DOS partition before starting this installation.  If this is\nnot the case then you should reboot DOS at this time and copy the\ndistributions you wish to install into a \"FREEBSD\" subdirectory\non one of your DOS partitions.  Otherwise, please select the DOS\npartition containing the FreeBSD distribution files."
+msg_please_select_ufs_partition="FreeBSD can be installed directly from another FreeBSD partition\nthat is UFS formatted assuming, of course, that you have copied\nthe relevant distributions into said partition before starting\ninstallation."
+msg_please_select_a_usb_drive="You have more than one USB drive. Please choose which drive\nyou would like to use."
+msg_please_select_ethernet_device_to_configure="Please select the ethernet or PLIP device to configure."
+msg_please_select_the_site_closest_to_you_or_other="Please select the site closest to you or \"other\" if you'd like to\nspecify a different choice.  Also note that not every site listed here\ncarries more than the base distribution kits. Only Primary sites are\nguaranteed to carry the full range of possible distributions."
+msg_please_specify_the_name_of_the_text_editor="Please specify the name of the text editor you wish to use:"
+msg_please_specify_the_number_of_seconds_to_wait="Please specify the number of seconds to wait for slow media:"
+msg_please_specify_the_release_you_wish_to_load="Please specify the release you wish to load or\n\"any\" for a generic release install:"
+msg_please_specify_url_of_a_freebsd_distribution="Please specify the URL of a FreeBSD distribution on a\nremote ftp site.  This site must accept either anonymous\nftp or you should have set an ftp username and password\nin the Options screen.\n\nA URL looks like this:  ftp://<hostname>/<path>\nWhere <path> is relative to the anonymous ftp directory or the\nhome directory of the user being logged in as."
+msg_poland="Poland"
+msg_portugal="Portugal"
 msg_previous_syntax_errors="%s: Not overwriting \`%s' due to previous syntax errors"
+msg_primary="Primary"
+msg_probing_devices_please_wait_this_can_take_a_while="Probing devices, please wait (this can take a while)..."
 msg_quick_start_how_to_use_this_menu_system="Quick start - How to use this menu system"
+msg_release_name="Release Name"
+msg_rerun_bsdconfig_initial_device_probe="Re-run bsdconfig initial device probe"
+msg_rescan_devices="Re-scan Devices"
+msg_reset="RESET!"
+msg_reset_all_values_to_startup_defaults="Reset all values to startup defaults"
+msg_reuse_old_ftp_site_selection_values="Re-use old FTP site selection values?"
+msg_romania="Romania"
+msg_russia="Russia"
+msg_scanning_for_dhcp_servers="Scanning for DHCP servers..."
+msg_scanning_for_ra_servers="Scanning for RA servers..."
 msg_secure_mode_requires_x11="Secure-mode requires X11 (use \`-X')!"
 msg_secure_mode_requires_root="Secure-mode requires root-access!"
+msg_select_a_site_thats_close="Select a site that's close!"
+msg_server_error_when_requesting_url="Server error when requesting %s, you could try an other server"
+msg_singapore="Singapore"
+msg_slovak_republic="Slovak Republic"
+msg_slovenia="Slovenia"
+msg_snapshots_server_japan="Snapshots Server Japan"
+msg_snapshots_server_sweden="Snapshots Server Sweden"
+msg_sorry_invalid_url="Sorry, %s is an invalid URL!"
 msg_sorry_try_again="Sorry, try again."
+msg_south_africa="South Africa"
+msg_spain="Spain"
+msg_specify_some_other_ftp_site="Specify some other ftp site by URL"
+msg_sweden="Sweden"
+msg_switzerland="Switzerland"
+msg_taiwan="Taiwan"
+msg_the_current_installation_media_type="The current installation media type."
+msg_timeout_value_in_seconds_for_slow_media="Timeout value in seconds for slow media."
+msg_try_dhcp_configuration="Do you want to try DHCP configuration of the interface?"
+msg_try_ipv6_configuration="Do you want to try IPv6 configuration of the interface?"
 msg_try_sudo_only_this_once="Try sudo(8) only this once"
+msg_turkey="Turkey"
+msg_ufs="UFS"
+msg_uk="UK"
+msg_ukraine="Ukraine"
+msg_unable_to_configure_device="Unable to configure the %s interface!\nThis installation method cannot be used."
+msg_unable_to_get_proper_ftp_path="Unable to get proper FTP path.  FTP media not initialized."
+msg_unable_to_make_directory_mountpoint="Unable to make %s directory mountpoint for %s!"
 msg_unable_to_open="Unable to open %s"
+msg_unknown="unknown"
 msg_unknown_user="Unknown user: %s"
+msg_url_was_not_found="%s was not found, maybe directory or release-version are wrong?"
+msg_usa="USA"
 msg_usage="Usage"
+msg_usb="USB"
+msg_use_defaults="Use Defaults"
+msg_use_nfs_version_3="Use NFS version 3"
+msg_use_tcp_protocol_for_nfs="Use TCP protocol for NFS"
 msg_user_disallowed="User disallowed: %s"
+msg_user_is_using_a_slow_pc_or_ethernet_card="User is using a slow PC or Ethernet card"
+msg_username_and_password_to_use="Username and password to use instead of anonymous"
+msg_using_interface="Using interface %s"
+msg_using_usb_device="Using USB device: %s"
+msg_view_set_various_media_options="View/Set various media options"
+msg_which_release_to_attempt_to_load="Which release to attempt to load from installation media"
+msg_which_text_editor_to_use="Which text editor to use during installation"
+msg_would_you_like_to_bring_interface_up="Would you like to bring the %s interface up right now?"
 msg_yes="Yes"
 msg_you_are_not_root_but="You are not root but %s can use sudo(8).\nWhat would you like to do?"
+msg_you_may_remove_the_floppy="You may remove the floppy from %s"
+msg_youve_already_done_the_network_configuration="You've already done the network configuration once,\nwould you like to skip over it now?"
+tcplayout_extras_help="Any interface-specific options to ifconfig you would like to add"
+tcplayout_extras_help_for_plip="For PLIP configuration, you must enter the peer's IP address here."
+tcplayout_gateway_help="IPv4 address of host forwarding packets to non-local destinations"
+tcplayout_hostname_help="Your fully-qualified hostname, e.g. foo.example.com"
+tcplayout_ipaddr_help="The IPv4 address to be used for this interface"
+tcplayout_nameserver_help="IPv4 or IPv6 address of your local DNS server"
+tcplayout_netmask_help="The netmask for this interface, e.g. 255.255.255.0 for a class C network"

Added: head/usr.sbin/bsdconfig/include/network_device.hlp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.sbin/bsdconfig/include/network_device.hlp	Mon Feb 25 19:55:32 2013	(r247280)
@@ -0,0 +1,58 @@
+You can do network installations over 3 types of communications links:
+
+        Serial port:    SLIP / PPP
+        Parallel port:  PLIP (laplink cable)
+        Ethernet:       A standard Ethernet controller (includes some
+                        PCMCIA networking cards).
+
+SLIP support is rather primitive and limited primarily to directly
+connected links, such as a serial cable running between a laptop
+computer and another PC.  The link must be hard-wired as the SLIP
+installation doesn't currently offer a dialing capability (that
+facility is offered by the PPP utility, which should be used in
+preference to SLIP whenever possible).  When you choose the SLIP
+option, you'll be given the option of later editing the slattach
+command before it's run on the serial line.  It is expected that
+you'll run slattach (or some equivalent command) on the other end of
+the link at that time and bring up the line.  FreeBSD will then
+install itself at serial speeds of up to 115.2K/baud (the recommended
+speed for a hardwired cable).
+
+If you're using a modem then PPP is almost certainly your only choice.
+Make sure that you have your service provider's information handy as
+you'll need to know it fairly early in the installation process.  You
+will need to know your service provider's IP address, the IP address 
+of your provider's DNS server, and possibly your own IP address unless
+your ISP supports dynamic negotiation, most do.  If you do not choose
+a PAP or CHAP login you will also need to know how to use the various
+"AT commands" to dial the ISP with your particular brand of modem as
+the PPP dialer provides only a very simple terminal emulator and has no
+"modem capabilities database".  If you choose a PAP or CHAP login you
+can simply enter `dial' (without the quotes) at the ppp prompt if your
+modem uses the Hayes compatible AT command set.
+
+If a hard-wired connection to another FreeBSD (2.0R or later) machine
+is available, you might also consider installing over a "laplink"
+parallel port cable.  The data rate over the parallel port is much
+higher than what is typically possible over a serial line, and speeds
+of over 50KB/sec are not uncommon.
+
+Finally, for the fastest possible network installation, an Ethernet
+adaptor is always a good choice!  FreeBSD supports most common PC
+Ethernet cards, a table of which is provided in the FreeBSD Hardware
+Guide (see the `Documentation' entry in the main menu).  If you are
+using one of the supported PCMCIA Ethernet cards, also be sure that
+it's plugged in BEFORE the laptop is powered on!  Sysinstall does not,
+unfortunately, currently support "hot insertion" of PCMCIA cards.
+
+You will also need to know your IP address on the network, the
+"netmask" value for your address class, and the name of your machine.
+Your system administrator can tell you which values to use for your
+particular network setup.  If you will be referring to other hosts by
+name rather than IP address, you'll also need a name server and
+possibly the address of a gateway (if you're using PPP, it's your
+provider's IP address) to use in talking to it.  If you do not know
+the answers to all or most of these questions then you should really
+probably talk to your system administrator FIRST before trying this
+type of installation!  Choosing the wrong IP address on a busy network
+will NOT make you popular with your systems administrator!  :-)

Added: head/usr.sbin/bsdconfig/include/options.hlp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.sbin/bsdconfig/include/options.hlp	Mon Feb 25 19:55:32 2013	(r247280)
@@ -0,0 +1,98 @@
+The following options may be set from this screen.
+
+NFS Secure:   NFS server talks only on a secure port
+
+    This is most commonly used when talking to Sun workstations, which
+    will not talk NFS over "non privileged" ports.
+
+
+NFS Slow:     User is using a slow PC or Ethernet card
+
+    Use this option if you have a slow PC (386) or an Ethernet card
+    with poor performance being "fed" by NFS on a higher-performance
+    workstation.  This will throttle the workstation back to prevent
+    the PC from becoming swamped with data.
+
+
+NFS TCP:      Use TCP for the NFS mount
+
+    This option can be used if your NFS server supports TCP
+    connections; not all do!  This may be useful if your NFS server
+    is at a remote site in which case it may offer some additional
+    stability.
+
+
+NFS version 3:   Use NFS version 3
+
+    This option forces the use of NFS version 3 and is on by default.
+    If your NFS server only supports NFS version 2, disable this option.
+
+
+Debugging:    Turn on the extra debugging flag
+
+    This turns on a lot of extra noise in between dialogs (unless
+    debugFile has been set, sending the data to a logfile instead).
+    Optionally, if debugFile begins with a plus sign (`+'), output will
+    occur both on standard output and to debugFile (minus leading plus).
+    If your installation should fail for any reason, PLEASE turn this
+    flag on when attempting to reproduce the problem.  It will provide a
+    lot of extra debugging at the failure point and may be very helpful
+    to the developers in tracking such problems down!
+
+
+DHCP:         Enable DHCP configuration of interfaces
+
+    This option specifies whether DHCP configuration of interfaces
+    may be attempted.  The default setting is to interactively ask
+    the user.
+
+
+IPv6:         Enable IPv6 router solicitation configuration
+
+    This option specifies whether automatic configuration of IPv6
+    interfaces may be attempted.  This uses the router solicitation
+    method of automatic configuration.  The default setting is to
+    interactively ask the user.
+
+
+FTP username:  Specify username and password instead of anonymous.
+
+    By default, the installation attempts to log in as the
+    anonymous user.  If you wish to log in as someone else,
+    specify the username and password with this option.
+
+
+Editor:  Specify which screen editor to use.
+
+   At various points during the installation it may be necessary
+   to customize some text file, at which point the user will be
+   thrown unceremoniously into a screen editor.  A relatively
+   simplistic editor which shows its command set on-screen is
+   selected by default, but UNIX purists may wish to change this
+   setting to `/usr/bin/vi'.
+
+
+Release Name:  Which release to attempt to load from installation media.
+
+    You should only change this option if you're really sure you know
+    what you are doing!  This will change the release name used by
+    bsdconfig when fetching components of any distributions, and
+    is a useful way of using a more recent installation boot floppy
+    with an older release (say, on CDROM).
+
+
+Media Type:   Which media type is being used.
+
+    This is mostly informational and indicates which media type (if any)
+    was last selected in the Media menu.  It's also a convenient short-cut
+    to the media menu itself.
+
+
+Re-scan Devices:  
+
+   Reprobe the system for devices.
+
+
+Use Defaults:  Use default values.
+
+    Reset all options back to their default values.

Copied: head/usr.sbin/bsdconfig/include/tcp.hlp (from r245694, head/usr.sbin/bsdconfig/networking/include/tcp.hlp)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.sbin/bsdconfig/include/tcp.hlp	Mon Feb 25 19:55:32 2013	(r247280, copy of r245694, head/usr.sbin/bsdconfig/networking/include/tcp.hlp)
@@ -0,0 +1,33 @@
+This screen allows you to set up your general network parameters
+(hostname, domain name, DNS server, etc) as well as the settings for a
+given interface (which was selected from the menu before this screen).
+
+PLIP/SLIP users - please read through to the end of this doc!
+
+The "options" field is kind of special (read: a hack :-):
+
+Any valid options to ifconfig can be specified here, so if you need
+to do something "special" to get your interface working, then here
+is the place to do it.
+
+If you're running SLIP or PLIP, you also need to use it for specifying
+the remote end of the link (simply type the foreign IP address in).
+In the specific case where you're running PLIP with a Linux host peer
+rather than a FreeBSD one, you also must add the "-link0" flag after the
+foreign address.
+
+If you're dealing with an ethernet adaptor with multiple media
+connectors (e.g. AUI, 10BT, 10B2, etc), you can use this field to
+specify which one to use.  Examples of valid strings include:
+
+        "media 10base5/AUI" - Select the AUI port.
+        "media 10baseT/UTP" - Select the twisted pair port.
+        "media 10base2/BNC" - Select the BNC connector.
+        "media 100baseTX"   - Select 100BaseT on a 100/10 dual adaptor.
+
+If you have a wireless interface and must specify arguments such as a
+WEP key here, you may use something like:
+
+	"wepmode on wepkey 0xFEEDFACE"
+
+When you're done with this form, select OK.

Modified: head/usr.sbin/bsdconfig/networking/devices
==============================================================================
--- head/usr.sbin/bsdconfig/networking/devices	Mon Feb 25 19:22:56 2013	(r247279)
+++ head/usr.sbin/bsdconfig/networking/devices	Mon Feb 25 19:55:32 2013	(r247280)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #-
-# Copyright (c) 2006-2012 Devin Teske
+# Copyright (c) 2006-2013 Devin Teske
 # All Rights Reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,7 @@ f_dprintf "%s: loading includes..." "$0"
 f_include $BSDCFG_SHARE/dialog.subr
 f_include $BSDCFG_SHARE/mustberoot.subr
 f_include $BSDCFG_SHARE/sysrc.subr
+f_include $BSDCFG_SHARE/media/tcpip.subr
 f_include $BSDCFG_SHARE/networking/device.subr
 f_include $BSDCFG_SHARE/networking/ipaddr.subr
 f_include $BSDCFG_SHARE/networking/media.subr

Modified: head/usr.sbin/bsdconfig/networking/include/Makefile
==============================================================================
--- head/usr.sbin/bsdconfig/networking/include/Makefile	Mon Feb 25 19:22:56 2013	(r247279)
+++ head/usr.sbin/bsdconfig/networking/include/Makefile	Mon Feb 25 19:55:32 2013	(r247280)
@@ -3,7 +3,7 @@
 NO_OBJ=
 
 FILESDIR=	${LIBEXECDIR}/bsdconfig/120.networking/include
-FILES=		messages.subr tcp.hlp
+FILES=		messages.subr
 
 beforeinstall:
 	mkdir -p ${DESTDIR}${FILESDIR}

Modified: head/usr.sbin/bsdconfig/networking/share/common.subr
==============================================================================
--- head/usr.sbin/bsdconfig/networking/share/common.subr	Mon Feb 25 19:22:56 2013	(r247279)
+++ head/usr.sbin/bsdconfig/networking/share/common.subr	Mon Feb 25 19:55:32 2013	(r247280)
@@ -1,6 +1,6 @@
 if [ ! "$_NETWORKING_COMMON_SUBR" ]; then _NETWORKING_COMMON_SUBR=1
 #
-# Copyright (c) 2006-2012 Devin Teske
+# Copyright (c) 2006-2013 Devin Teske
 # All Rights Reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -33,17 +33,6 @@ BSDCFG_SHARE="/usr/share/bsdconfig"
 
 ############################################################ FUNCTIONS
 
-# f_mounted $local_directory
-#
-# Return success if a filesystem is mounted on a particular directory.
-#
-f_mounted()
-{
-	local dir="$1"
-	[ -d "$dir" ] || return $FAILURE
-	mount | grep -Eq " on $dir \([^)]+\)$"
-}
-
 # f_jailed
 #
 # Returns true if the current process is jail(8)ed.

Modified: head/usr.sbin/bsdconfig/networking/share/device.subr
==============================================================================
--- head/usr.sbin/bsdconfig/networking/share/device.subr	Mon Feb 25 19:22:56 2013	(r247279)
+++ head/usr.sbin/bsdconfig/networking/share/device.subr	Mon Feb 25 19:55:32 2013	(r247280)
@@ -1,6 +1,6 @@
 if [ ! "$_NETWORKING_DEVICE_SUBR" ]; then _NETWORKING_DEVICE_SUBR=1
 #
-# Copyright (c) 2006-2012 Devin Teske
+# Copyright (c) 2006-2013 Devin Teske
 # All Rights Reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -31,8 +31,10 @@ if [ ! "$_NETWORKING_DEVICE_SUBR" ]; the
 BSDCFG_SHARE="/usr/share/bsdconfig"
 . $BSDCFG_SHARE/common.subr || exit 1
 f_dprintf "%s: loading includes..." networking/device.subr
+f_include $BSDCFG_SHARE/device.subr
 f_include $BSDCFG_SHARE/dialog.subr
 f_include $BSDCFG_SHARE/sysrc.subr
+f_include $BSDCFG_SHARE/media/tcpip.subr
 f_include $BSDCFG_SHARE/networking/common.subr
 f_include $BSDCFG_SHARE/networking/ipaddr.subr
 f_include $BSDCFG_SHARE/networking/media.subr
@@ -43,8 +45,6 @@ f_include $BSDCFG_SHARE/networking/routi
 BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking"
 f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
 
-TCP_HELPFILE=$BSDCFG_LIBE/$APP_DIR/include/tcp.hlp
-
 ############################################################ GLOBALS
 
 #
@@ -55,133 +55,6 @@ TCP_HELPFILE=$BSDCFG_LIBE/$APP_DIR/inclu
 
 ############################################################ FUNCTIONS
 
-# f_device_desc $device_name
-#
-# Print a description for a device name (eg., `fxp0').
-#
-f_device_desc()
-{
-	local device="$1" d="[1234567890]" desc=""
-
-	# Check variables
-	[ "$device" ] || return $SUCCESS
-
-	#
-	# Return sysctl MIB dev.NAME.UNIT.%desc if it exists,
-	# otherwise fall through to below static list.
-	#
-	if f_have sysctl; then
-		local devname devunit
-		devname="${device%%$d*}"
-		devunit="${device#$devname}"
-		devunit="${devunit%%[a-zA-Z_]*}"
-		sysctl -n "dev.$devname.$devunit.%desc" 2> /dev/null &&
-			return $SUCCESS
-	fi
-
-	case "$device" in
-	# Network devices
-	ae$d)    desc="Attansic/Atheros L2 Fast Ethernet";;
-	age$d)   desc="Attansic/Atheros L1 Gigabit Ethernet";;
-	alc$d)   desc="Atheros AR8131/AR8132 PCIe Ethernet";;
-	ale$d)   desc="Atheros AR8121/AR8113/AR8114 PCIe Ethernet";;
-	an$d)    desc="Aironet 4500/4800 802.11 wireless adapter";;
-	ath$d)   desc="Atheros IEEE 802.11 wireless adapter";;
-	aue$d)   desc="ADMtek USB Ethernet adapter";;
-	axe$d)   desc="ASIX Electronics USB Ethernet adapter";;
-	bce$d)   desc="Broadcom NetXtreme II Gigabit Ethernet card";;
-	bfe$d)   desc="Broadcom BCM440x PCI Ethernet card";;
-	bge$d)   desc="Broadcom BCM570x PCI Gigabit Ethernet card";;
-	bm$d)    desc="Apple BMAC Built-in Ethernet";;
-	bwn$d)   desc="Broadcom BCM43xx IEEE 802.11 wireless adapter";;
-	cas$d)   desc="Sun Cassini/Cassini+ or NS DP83065 Saturn Ethernet";;
-	cc3i$d)  desc="SDL HSSI sync serial PCI card";;
-	cue$d)   desc="CATC USB Ethernet adapter";;
-	cxgb$d)  desc="Chelsio T3 10Gb Ethernet card";;
-	dc$d)    desc="DEC/Intel 21143 (and clones) PCI Fast Ethernet card";;
-	de$d)    desc="DEC DE435 PCI NIC or other DC21040-AA based card";;
-	disc$d)  desc="Software discard network interface";;
-	ed$d)    desc="Novell NE1000/2000; 3C503; NE2000-compatible PCMCIA";;
-	el$d)    desc="3Com 3C501 Ethernet card";;
-	em$d)    desc="Intel(R) PRO/1000 Ethernet card";;
-	en$d)    desc="Efficient Networks ATM PCI card";;
-	ep$d)    desc="3Com 3C509 Ethernet card/3C589 PCMCIA";;
-	et$d)    desc="Agere ET1310 based PCI Express Gigabit Ethernet card";;
-	ex$d)    desc="Intel EtherExpress Pro/10 Ethernet card";;
-	fe$d)    desc="Fujitsu MB86960A/MB86965A Ethernet card";;
-	fpa$d)   desc="DEC DEFPA PCI FDDI card";;
-	fwe$d)   desc="FireWire Ethernet emulation";;
-	fwip$d)  desc="IP over FireWire";;
-	fxp$d)   desc="Intel EtherExpress Pro/100B PCI Fast Ethernet card";;
-	gem$d)   desc="Apple GMAC or Sun ERI/GEM Ethernet adapter";;
-	hme$d)   desc="Sun HME (Happy Meal Ethernet) Ethernet adapter";;
-	ie$d)    desc="AT&T StarLAN 10 and EN100; 3Com 3C507; NI5210";;
-	igb$d)   desc="Intel(R) PRO/1000 PCI Express Gigabit Ethernet card";;
-	ipw$d)   desc="Intel PRO/Wireless 2100 IEEE 802.11 adapter";;
-	iwi$d)   desc="Intel PRO/Wireless 2200BG/2225BG/2915ABG adapter";;
-	iwn$d)   desc="Intel Wireless WiFi Link 4965AGN IEEE 802.11n adapter";;
-	ix$d)    desc="Intel Etherexpress Ethernet card";;
-	ixgb$d)  desc="Intel(R) PRO/10Gb Ethernet card";;
-	ixgbe$d) desc="Intel(R) PRO/10Gb Ethernet card";;
-	jme$d)   desc="JMicron JMC250 Gigabit/JMC260 Fast Ethernet";;
-	kue$d)   desc="Kawasaki LSI USB Ethernet adapter";;
-	le$d)    desc="AMD Am7900 LANCE or Am79C9xx PCnet Ethernet adapter";;
-	lge$d)   desc="Level 1 LXT1001 Gigabit Ethernet card";;
-	lnc$d)   desc="Lance/PCnet (Isolan/Novell NE2100/NE32-VL) Ethernet";;
-	lp$d)    desc="Parallel Port IP (PLIP) peer connection";;
-	lo$d)    desc="Loop-back (local) network interface";;
-	malo$d)  desc="Marvell Libertas 88W8335 802.11 wireless adapter";;
-	msk$d)   desc="Marvell/SysKonnect Yukon II Gigabit Ethernet";;
-	mxge$d)  desc="Myricom Myri10GE 10Gb Ethernet card";;
-	nfe$d)   desc="NVIDIA nForce MCP Ethernet";;
-	ng${d}_*|ng$d${d}_*|ng$d$d${d}_*|ng$d$d$d${d}_*|ng$d$d$d$d${d}_*)
-	         desc="Vimage netgraph(4) bridged Ethernet device";;
-	nge$d)   desc="NatSemi PCI Gigabit Ethernet card";;
-	nve$d)   desc="NVIDIA nForce MCP Ethernet";;
-	nxge$d)  desc="Neterion Xframe 10GbE Server/Storage adapter";;
-	pcn$d)   desc="AMD Am79c79x PCI Ethernet card";;
-	plip$d)  desc="Parallel Port IP (PLIP) peer connection";;
-	ral$d)   desc="Ralink Technology IEEE 802.11 wireless adapter";;
-	ray$d)   desc="Raytheon Raylink 802.11 wireless adapter";;
-	re$d)    desc="RealTek 8139C+/8169/8169S/8110S PCI Ethernet adapter";;
-	rl$d)    desc="RealTek 8129/8139 PCI Ethernet card";;
-	rue$d)   desc="RealTek USB Ethernet card";;
-	rum$d)   desc="Ralink Technology USB IEEE 802.11 wireless adapter";;
-	sf$d)    desc="Adaptec AIC-6915 PCI Ethernet card";;
-	sge$d)   desc="Silicon Integrated Systems SiS190/191 Ethernet";;
-	sis$d)   desc="SiS 900/SiS 7016 PCI Ethernet card";;
-	sk$d)    desc="SysKonnect PCI Gigabit Ethernet card";;
-	sn$d)    desc="SMC/Megahertz Ethernet card";;
-	snc$d)   desc="SONIC Ethernet card";;
-	sr$d)    desc="SDL T1/E1 sync serial PCI card";;
-	ste$d)   desc="Sundance ST201 PCI Ethernet card";;
-	stge$d)  desc="Sundance/Tamarack TC9021 Gigabit Ethernet";;
-	ti$d)    desc="Alteon Networks PCI Gigabit Ethernet card";;
-	tl$d)    desc="Texas Instruments ThunderLAN PCI Ethernet card";;
-	tx$d)    desc="SMC 9432TX Ethernet card";;
-	txp$d)   desc="3Com 3cR990 Ethernet card";;
-	uath$d)  desc="Atheros AR5005UG and AR5005UX USB wireless adapter";;
-	upgt$d)  desc="Conexant/Intersil PrismGT USB wireless adapter";;
-	ural$d)  desc="Ralink Technology RT2500USB 802.11 wireless adapter";;
-	urtw$d)  desc="Realtek 8187L USB wireless adapter";;
-	vge$d)   desc="VIA VT612x PCI Gigabit Ethernet card";;
-	vlan$d|vlan$d$d|vlan$d$d$d|vlan$d$d$d$d|vlan$d$d$d$d$d)
-	         desc="IEEE 802.1Q VLAN network interface";;
-	vr$d)    desc="VIA VT3043/VT86C100A Rhine PCI Ethernet card";;
-	vx$d)    desc="3COM 3c590 / 3c595 Ethernet card";;
-	wb$d)    desc="Winbond W89C840F PCI Ethernet card";;
-	wi$d)    desc="Lucent WaveLAN/IEEE 802.11 wireless adapter";;
-	wpi$d)   desc="Intel 3945ABG IEEE 802.11 wireless adapter";;
-	wx$d)    desc="Intel Gigabit Ethernet (82452) card";;
-	xe$d)    desc="Xircom/Intel EtherExpress Pro100/16 Ethernet card";;
-	xl$d)    desc="3COM 3c90x / 3c90xB PCI Ethernet card";;
-	zyd$d)   desc="ZyDAS ZD1211/ZD1211B USB 802.11 wireless adapter";;
-	# Unknown device
-	*)       desc="<unknown network interface type>";;
-	esac
-	printf "%s\n" "$desc"
-}
-
 # f_dialog_menu_netdev
 #
 # Display a list of network devices with descriptions.

Modified: head/usr.sbin/bsdconfig/networking/share/hostname.subr
==============================================================================
--- head/usr.sbin/bsdconfig/networking/share/hostname.subr	Mon Feb 25 19:22:56 2013	(r247279)
+++ head/usr.sbin/bsdconfig/networking/share/hostname.subr	Mon Feb 25 19:55:32 2013	(r247280)
@@ -1,6 +1,6 @@
 if [ ! "$_NETWORKING_HOSTNAME_SUBR" ]; then _NETWORKING_HOSTNAME_SUBR=1
 #
-# Copyright (c) 2006-2012 Devin Teske
+# Copyright (c) 2006-2013 Devin Teske
 # All Rights Reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -41,63 +41,6 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc
 
 ############################################################ FUNCTIONS
 
-# f_validate_hostname $hostname
-#
-# Returns zero if the given argument (a fully-qualified hostname) is compliant
-# with standards set-forth in RFC's 952 and 1123 of the Network Working Group:
-#
-# RFC 952 - DoD Internet host table specification
-# http://tools.ietf.org/html/rfc952
-#
-# RFC 1123 - Requirements for Internet Hosts - Application and Support
-# http://tools.ietf.org/html/rfc1123
-#
-# See http://en.wikipedia.org/wiki/Hostname for a brief overview.
-#
-# The return status for invalid hostnames is one of:
-# 	255	Entire hostname exceeds the maximum length of 255 characters.
-# 	 63	One or more individual labels within the hostname (separated by
-# 	   	dots) exceeds the maximum of 63 characters.
-# 	  1	One or more individual labels within the hostname contains one
-# 	   	or more invalid characters.
-# 	  2	One or more individual labels within the hostname starts or
-# 	   	ends with a hyphen (hyphens are allowed, but a label cannot
-# 	   	begin or end with a hyphen).
-# 	  3	One or more individual labels within the hostname are null.
-#
-# If the hostname is determined to be invalid, the appropriate error will be
-# displayed using the f_show_msg function.
-#
-f_validate_hostname()
-{
-	local fqhn="$1"
-
-	( # Operate within a sub-shell to protect the parent environment
-
-		# Return error if the hostname exceeds 255 characters
-		[ ${#fqhn} -gt 255 ] && exit 255
-
-		IFS="." # Split on `dot'
-		for label in $fqhn; do
-
-			# Return error if the label exceeds 63 characters
-			[ ${#label} -gt 63 ] && exit 63
-
-			# Return error if the label is null
-			[ "$label" ] || exit 3
-
-			# Return error if label begins/ends with dash
-			case "$label" in
-			-*|*-) exit 2
-			esac
-
-			# Return error if the label contains any invalid chars
-			echo "$label" | grep -q '^[[:alnum:]-]*$' || exit 1
-
-		done
-	)
-}
-
 # f_dialog_hnerror $error $hostname
 #
 # Display a msgbox with the appropriate error message for an error returned by

Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr
==============================================================================
--- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr	Mon Feb 25 19:22:56 2013	(r247279)
+++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr	Mon Feb 25 19:55:32 2013	(r247280)
@@ -1,6 +1,6 @@
 if [ ! "$_NETWORKING_IPADDR_SUBR" ]; then _NETWORKING_IPADDR_SUBR=1
 #
-# Copyright (c) 2006-2012 Devin Teske
+# Copyright (c) 2006-2013 Devin Teske
 # All Rights Reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -40,75 +40,10 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc
 
 ############################################################ FUNCTIONS
 
-# f_ifconfig_inet $interface
-#
-# Returns the IPv4 address associated with $interface.
-#
-f_ifconfig_inet()
-{
-	local interface="$1"
-	ifconfig "$interface" 2> /dev/null | awk \
-	'
-		BEGIN { found = 0 }
-		( $1 == "inet" ) \
-		{
-			print $2
-			found = 1
-			exit
-		}
-		END { exit ! found }
-	'
-}
-
-# f_validate_ipaddr $ipaddr
-#
-# Returns zero if the given argument (an IP address) is of the proper format.
-#
-# The return status for invalid IP address is one of:
-# 	1	One or more individual octets within the IP address (separated
-# 	 	by dots) contains one or more invalid characters.
-# 	2	One or more individual octets within the IP address are null
-# 	 	and/or missing.
-# 	3	One or more individual octets within the IP address exceeds the
-# 	 	maximum of 255 (or 2^8, being an octet comprised of 8 bits).
-# 	4	The IP address has either too few or too many octets.
-#
-f_validate_ipaddr()
-{
-	local ip="$1"
-
-	( # Operate within a sub-shell to protect the parent environment
-
-		# Track number of octets for error checking
-		noctets=0
-
-		IFS="." # Split on `dot'
-		for octet in $ip; do
-
-			# Return error if the octet is null
-			[ "$octet" ] || exit 2
-
-			# Return error if not a whole integer
-			f_isinteger "$octet" || exit 1
-
-			# Return error if not a positive integer
-			[ $octet -ge 0 ] || exit 1
-
-			# Return error if the octet exceeds 255
-			[ $octet -gt 255 ] && exit 3
-
-			noctets=$(( $noctets + 1 ))
-
-		done
-
-		[ $noctets -eq 4 ] || exit 4
-	)
-}
-
 # f_dialog_iperror $error $ipaddr
 #
 # Display a msgbox with the appropriate error message for an error returned by
-# the f_validate_ipaddr function above.
+# the f_validate_ipaddr function.
 #
 f_dialog_iperror()
 {
@@ -144,141 +79,6 @@ f_dialog_validate_ipaddr()
 	return $retval
 }
 
-# f_validate_ipaddr6 $ipv6_addr
-#
-# Returns zero if the given argument (an IPv6 address) is of the proper format.
-#
-# The return status for invalid IP address is one of:
-# 	1	One or more individual segments within the IP address
-# 	 	(separated by colons) contains one or more invalid characters.
-# 	 	Segments must contain only combinations of the characters 0-9,
-# 	 	A-F, or a-f.
-# 	2	Too many/incorrect null segments. A single null segment is
-# 	 	allowed within the IP address (separated by colons) but not
-# 	 	allowed at the beginning or end (unless a double-null segment;
-# 	 	i.e., "::*" or "*::").
-# 	3	One or more individual segments within the IP address
-# 	 	(separated by colons) exceeds the length of 4 hex-digits.
-# 	4	The IP address entered has either too few (less than 3), too
-# 	 	many (more than 8), or not enough segments, separated by
-# 	 	colons.
-# 	5*	The IPv4 address at the end of the IPv6 address is invalid.
-# 	*	When there is an error with the dotted-quad IPv4 address at the
-# 	 	end of the IPv6 address, the return value of 5 is OR'd with a
-# 	 	bit-shifted (<< 4) return of f_validate_ipaddr.
-#
-f_validate_ipaddr6()
-{
-	local ip="$1"
-
-	( # Operate within a sub-shell to protect the parent environment
-
-		IFS=":" # Split on `colon'
-		set -- $ip:
-
-		# Return error if too many or too few segments
-		# Using 9 as max in case of leading or trailing null spanner
-		[ $# -gt 9 -o $# -lt 3 ] && exit 4
-
-		h="[0-9A-Fa-f]"
-		nulls=0
-		nsegments=$#
-		contains_ipv4_segment=
-
-		while [ $# -gt 0 ]; do
-
-			segment="${1%:}"
-			shift
-
-			#
-			# Return error if this segment makes one null too-many.
-			# A single null segment is allowed anywhere in the
-			# middle as well as double null segments are allowed at
-			# the beginning or end (but not both).
-			#
-			if [ ! "$segment" ]; then
-				nulls=$(( $nulls + 1 ))
-				if [ $nulls -eq 3 ]; then
-					# Only valid syntax for 3 nulls is `::'
-					[ "$ip" = "::" ] || exit 2
-				elif [ $nulls -eq 2 ]; then
-					# Only valid if begins/ends with `::'
-					case "$ip" in
-					::*|*::) : fall thru ;;
-					*) exit 2
-					esac
-				fi
-				continue
-			fi
-
-			#
-			# Return error if not a valid hexadecimal short
-			#
-			case "$segment" in
-			$h|$h$h|$h$h$h|$h$h$h$h)
-				: valid segment of 1-4 hexadecimal digits
-				;;
-			*[!0-9A-Fa-f]*)
-				# Segment contains at least one invalid char
-
-				# Return error immediately if not last segment
-				[ $# -eq 0 ] || exit 1
-
-				# Otherwise, check for legacy IPv4 notation
-				case "$segment" in
-				*[!0-9.]*)
-					# Segment contains at least one invalid
-					# character even for an IPv4 address
-					exit 1
-				esac
-
-				# Return error if not enough segments
-				if [ $nulls -eq 0 ]; then
-					[ $nsegments -eq 7 ] || exit 4
-				fi

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-head mailing list