Date: Fri, 22 Oct 2021 18:41:57 GMT From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 6aae3517ed25 - main - Retire synchronous PPP kernel driver sppp(4). Message-ID: <202110221841.19MIfvqY029121@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=6aae3517ed2500fb963ba0a4264b4756088dd0f4 commit 6aae3517ed2500fb963ba0a4264b4756088dd0f4 Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2021-10-21 04:08:13 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2021-10-22 18:41:36 +0000 Retire synchronous PPP kernel driver sppp(4). The last two drivers that required sppp are cp(4) and ce(4). These devices are still produced and can be purchased at Cronyx <http://cronyx.ru/hardware/wan.html>. Since Roman Kurakin <rik@FreeBSD.org> has quit them, they no longer support FreeBSD officially. Later they have dropped support for Linux drivers to. As of mid-2020 they don't even have a developer to maintain their Windows driver. However, their support verbally told me that they could provide aid to a FreeBSD developer with documentaion in case if there appears a new customer for their devices. These drivers have a feature to not use sppp(4) and create an interface, but instead expose the device as netgraph(4) node. Then, you can attach ng_ppp(4) with help of ports/net/mpd5 on top of the node and get your synchronous PPP. Alternatively you can attach ng_frame_relay(4) or ng_cisco(4) for HDLC. Actually, last time I used cp(4) back in 2004, using netgraph(4) instead of sppp(4) was already the right way to do. Thus, remove the sppp(4) related part of the drivers and enable by default the negraph(4) part. Further maintenance of these drivers in the tree shouldn't be a big deal. While doing that, remove some cruft and enable cp(4) compilation on amd64. The ce(4) for some unknown reason marks its internal DDK functions with __attribute__ fastcall, which most likely is safe to remove, but without hardware I'm not going to do that, so ce(4) remains i386-only. Reviewed by: emaste, imp, donner Differential Revision: https://reviews.freebsd.org/D32590 See also: https://reviews.freebsd.org/D23928 --- ObsoleteFiles.inc | 11 + UPDATING | 5 + lib/libc/net/getnameinfo.c | 2 +- lib/libnetgraph/debug.c | 2 - libexec/rc/netstart | 1 - libexec/rc/rc.conf | 6 - libexec/rc/rc.d/Makefile | 1 - libexec/rc/rc.d/netif | 2 +- libexec/rc/rc.d/sppp | 37 - rescue/rescue/Makefile | 2 +- sbin/Makefile | 1 - sbin/sconfig/sconfig.8 | 5 - sbin/spppcontrol/Makefile | 9 - sbin/spppcontrol/Makefile.depend | 17 - sbin/spppcontrol/spppcontrol.8 | 275 -- sbin/spppcontrol/spppcontrol.c | 266 -- share/man/man4/Makefile | 2 - share/man/man4/man4.i386/ce.4 | 44 +- share/man/man4/man4.i386/cp.4 | 44 +- share/man/man4/netgraph.4 | 1 - share/man/man4/ng_sppp.4 | 172 - share/man/man4/sppp.4 | 238 -- share/man/man5/rc.conf.5 | 15 - sys/conf/NOTES | 5 - sys/conf/files | 6 +- sys/conf/files.i386 | 3 - sys/conf/files.x86 | 3 + sys/conf/options.i386 | 3 - sys/dev/ce/if_ce.c | 328 +- sys/dev/ce/ng_ce.h | 4 - sys/{i386/include => dev/cp}/cserial.h | 0 sys/dev/cp/if_cp.c | 316 +- sys/dev/cp/ng_cp.h | 4 - sys/i386/conf/NOTES | 9 +- sys/modules/Makefile | 2 - sys/modules/ce/Makefile | 21 +- sys/modules/cp/Makefile | 21 +- sys/modules/netgraph/Makefile | 1 - sys/modules/netgraph/sppp/Makefile | 7 - sys/modules/sppp/Makefile | 18 - sys/net/if_sppp.h | 234 -- sys/net/if_spppfr.c | 611 ---- sys/net/if_spppsubr.c | 5418 ------------------------------- sys/netgraph/ng_sppp.c | 411 --- sys/netgraph/ng_sppp.h | 39 - sys/x86/conf/NOTES | 5 + targets/pseudo/userland/Makefile.depend | 1 - 47 files changed, 71 insertions(+), 8557 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 7c5e534d21d4..b6a2d299bc8c 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -40,6 +40,17 @@ # xargs -n1 | sort | uniq -d; # done +# 20211022 +OLD_FILES+=sbin/spppcontrol +.if ${TARGET_ARCH} == "i386" +OLD_FILES+=usr/include/machine/cserial.h +.endif +OLD_FILES+=usr/include/net/if_sppp.h +OLD_FILES+=usr/include/netgraph/ng_sppp.h +OLD_FILES+=usr/share/man/man4/ng_sppp.4.gz +OLD_FILES+=usr/share/man/man4/sppp.4.gz +OLD_FILES+=usr/share/man/man8/spppcontrol.8.gz + # 20210929: OLD_FILES+=usr/sbin/hcseriald OLD_FILES+=usr/share/man/man8/hcseriald.8.gz diff --git a/UPDATING b/UPDATING index 8028c5f192cb..765722b62617 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20211022: + The synchronous PPP kernel driver sppp(4) has been removed. + The cp(4) and ce(4) drivers are now always compiled with netgraph(4) + support, formerly enabled by NETGRAPH_CRONYX option. + 20211020: sh(1) is now the default shell for the root user. To force root to use the csh shell, please run the following command as root: diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c index ad54920aa793..b72734e56ed3 100644 --- a/lib/libc/net/getnameinfo.c +++ b/lib/libc/net/getnameinfo.c @@ -467,7 +467,7 @@ getnameinfo_link(const struct afd *afd, * The following have zero-length addresses. * IFT_GIF (net/if_gif.c) * IFT_LOOP (net/if_loop.c) - * IFT_PPP (net/if_ppp.c, net/if_spppsubr.c) + * IFT_PPP (net/if_tuntap.c) * IFT_SLIP (net/if_sl.c, net/if_strip.c) * IFT_STF (net/if_stf.c) * IFT_L2VLAN (net/if_vlan.c) diff --git a/lib/libnetgraph/debug.c b/lib/libnetgraph/debug.c index f44504140b8b..513d3350760d 100644 --- a/lib/libnetgraph/debug.c +++ b/lib/libnetgraph/debug.c @@ -96,7 +96,6 @@ __FBSDID("$FreeBSD$"); #include <netgraph/ng_socket.h> #include <netgraph/ng_source.h> #include <netgraph/ng_split.h> -#include <netgraph/ng_sppp.h> #include <netgraph/ng_tag.h> #include <netgraph/ng_tcpmss.h> #include <netgraph/ng_tee.h> @@ -172,7 +171,6 @@ static const struct ng_cookie cookies[] = { COOKIE(SOCKET), COOKIE(SOURCE), COOKIE(SPLIT), - COOKIE(SPPP), COOKIE(TAG), COOKIE(TCPMSS), COOKIE(TEE), diff --git a/libexec/rc/netstart b/libexec/rc/netstart index fa4ce382e4ff..d40ee05edd4d 100755 --- a/libexec/rc/netstart +++ b/libexec/rc/netstart @@ -43,7 +43,6 @@ _start=quietstart /etc/rc.d/ipfilter ${_start} /etc/rc.d/ipnat ${_start} /etc/rc.d/ipfs ${_start} -/etc/rc.d/sppp ${_start} /etc/rc.d/netif ${_start} /etc/rc.d/ipsec ${_start} /etc/rc.d/ppp ${_start} diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 6f4a3a1eb3f3..0cfee2d9c194 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -262,12 +262,6 @@ cloned_interfaces="" # List of cloned network interfaces to create. # #autobridge_interfaces="bridge0" # List of bridges to check #autobridge_bridge0="tap* vlan0" # Interface glob to automatically add to the bridge -# -# If you have any sppp(4) interfaces above, you might also want to set -# the following parameters. Refer to spppcontrol(8) for their meaning. -sppp_interfaces="" # List of sppp interfaces. -#sppp_interfaces="...0" # example: sppp over ... -#spppconfig_...0="authproto=chap myauthname=foo myauthsecret='top secret' hisauthname=some-gw hisauthsecret='another secret'" # User ppp configuration. ppp_enable="NO" # Start user-ppp (or NO). diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 5981b3b03d17..4c7267552526 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -96,7 +96,6 @@ CONFS= DAEMON \ savecore \ securelevel \ serial \ - sppp \ statd \ static_arp \ static_ndp \ diff --git a/libexec/rc/rc.d/netif b/libexec/rc/rc.d/netif index 3dbb3e1a9588..ae30299bfc52 100755 --- a/libexec/rc/rc.d/netif +++ b/libexec/rc/rc.d/netif @@ -26,7 +26,7 @@ # # PROVIDE: netif -# REQUIRE: FILESYSTEMS iovctl serial sppp sysctl +# REQUIRE: FILESYSTEMS iovctl serial sysctl # REQUIRE: hostid # KEYWORD: nojailvnet diff --git a/libexec/rc/rc.d/sppp b/libexec/rc/rc.d/sppp deleted file mode 100755 index b6b02876d4fe..000000000000 --- a/libexec/rc/rc.d/sppp +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -# PROVIDE: sppp -# REQUIRE: root -# BEFORE: netif -# KEYWORD: nojail - -. /etc/rc.subr - -name="sppp" -desc="Point to point protocol network layer for synchronous lines" -start_cmd="sppp_start" -stop_cmd=":" - -sppp_start() -{ - # Special options for sppp(4) interfaces go here. These need - # to go _before_ the general ifconfig since in the case - # of hardwired (no link1 flag) but required authentication, you - # cannot pass auth parameters down to the already running interface. - # - for ifn in ${sppp_interfaces}; do - eval spppcontrol_args=\$spppconfig_${ifn} - if [ -n "${spppcontrol_args}" ]; then - # The auth secrets might contain spaces; in order - # to retain the quotation, we need to eval them - # here. - eval spppcontrol ${ifn} ${spppcontrol_args} - fi - done -} - -load_rc_config $name -run_rc_command "$1" diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile index 42094340e768..90aaea3cb709 100644 --- a/rescue/rescue/Makefile +++ b/rescue/rescue/Makefile @@ -101,7 +101,7 @@ CRUNCH_PROGS_sbin= \ mount_udf mount_unionfs newfs \ newfs_msdos nos-tun ping reboot \ restore rcorder route savecore \ - shutdown spppcontrol swapon sysctl tunefs umount + shutdown swapon sysctl tunefs umount .if ${MK_CCD} != "no" CRUNCH_PROGS_sbin+= ccdconfig diff --git a/sbin/Makefile b/sbin/Makefile index 6d6b647651ad..ade73fc8b0ee 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -63,7 +63,6 @@ SUBDIR=adjkerntz \ savecore \ setkey \ shutdown \ - spppcontrol \ swapon \ sysctl \ tunefs \ diff --git a/sbin/sconfig/sconfig.8 b/sbin/sconfig/sconfig.8 index 713f76d88c9d..a55bf911e3dd 100644 --- a/sbin/sconfig/sconfig.8 +++ b/sbin/sconfig/sconfig.8 @@ -216,9 +216,6 @@ Select the Frame Relay synchronous protocol T1.617 Annex D). .It Cm ppp Select the synchronous PPP protocol. -PPP parameters can be configured using the -.Xr spppcontrol 8 -utility. .It Sm Cm keepalive No = Bro Cm on , off Brc Sm Turn on/off transmission of keepalive messages. This option is used only for synchronous PPP. @@ -569,10 +566,8 @@ Test error (G.703 only). .Sh SEE ALSO .Xr stty 1 , .Xr ioctl 2 , -.Xr sppp 4 , .Xr ifconfig 8 , .Xr route 8 , -.Xr spppcontrol 8 .\"-------------------------------------------------------------- .Sh HISTORY The diff --git a/sbin/spppcontrol/Makefile b/sbin/spppcontrol/Makefile deleted file mode 100644 index 04173201cfde..000000000000 --- a/sbin/spppcontrol/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# $FreeBSD$ - -PACKAGE= ppp - -PROG= spppcontrol -MAN= spppcontrol.8 -WARNS?= 2 - -.include <bsd.prog.mk> diff --git a/sbin/spppcontrol/Makefile.depend b/sbin/spppcontrol/Makefile.depend deleted file mode 100644 index 6cfaab1c3644..000000000000 --- a/sbin/spppcontrol/Makefile.depend +++ /dev/null @@ -1,17 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - - -.include <dirdeps.mk> - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/sbin/spppcontrol/spppcontrol.8 b/sbin/spppcontrol/spppcontrol.8 deleted file mode 100644 index 4d948a60651a..000000000000 --- a/sbin/spppcontrol/spppcontrol.8 +++ /dev/null @@ -1,275 +0,0 @@ -.\" Copyright (C) 1997, 2001 by Joerg Wunsch, Dresden -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS -.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, -.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -.\" POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD$ -.\" -.Dd December 30, 2001 -.Dt SPPPCONTROL 8 -.Os -.Sh NAME -.Nm spppcontrol -.Nd display or set parameters for an sppp interface -.Sh SYNOPSIS -.Nm -.Op Fl v -.Ar ifname -.Op Ar parameter Ns Op Li = Ns Ar value -.Op Ar ... -.Sh DESCRIPTION -The -.Xr sppp 4 -driver might require a number of additional arguments or optional -parameters besides the settings that can be adjusted with -.Xr ifconfig 8 . -These are things like authentication protocol parameters, but also -other tunable configuration variables. -The -.Nm -utility can be used to display the current settings, or adjust these -parameters as required. -.Pp -For whatever intent -.Nm -is being called, at least the parameter -.Ar ifname -needs to be specified, naming the interface for which the settings -are to be performed or displayed. -Use -.Xr ifconfig 8 , -or -.Xr netstat 1 -to see which interfaces are available. -.Pp -If no other parameter is given, -.Nm -will just list the current settings for -.Ar ifname -and exit. -The reported settings include the current PPP phase the -interface is in, which can be one of the names -.Em dead , -.Em establish , -.Em authenticate , -.Em network , -or -.Em terminate . -If an authentication protocol is configured for the interface, the -name of the protocol to be used, as well as the system name to be used -or expected will be displayed, plus any possible options to the -authentication protocol if applicable. -Note that the authentication -secrets (sometimes also called -.Em keys ) -are not being returned by the underlying system call, and are thus not -displayed. -.Pp -If any additional parameter is supplied, superuser privileges are -required, and the command works in the -.Dq set -mode. -This is normally done quietly, unless the option -.Fl v -is also enabled, which will cause a final printout of the settings as -described above once all other actions have been taken. -Use of this -mode will be rejected if the interface is currently in any other phase -than -.Em dead . -Note that you can force an interface into -.Em dead -phase by calling -.Xr ifconfig 8 -with the parameter -.Cm down . -.Pp -The currently supported parameters include: -.Bl -tag -offset indent -width indent -.It Va authproto Ns Li = Ns Ar protoname -Set both, his and my authentication protocol to -.Ar protoname . -The protocol name can be one of -.Dq Li chap , -.Dq Li pap , -or -.Dq Li none . -In the latter case, the use of an authentication protocol will be -turned off for the named interface. -This has the side-effect of -clearing the other authentication-related parameters for this -interface as well (i.e., system name and authentication secret will -be forgotten). -.It Va myauthproto Ns Li = Ns Ar protoname -Same as above, but only for my end of the link. -I.e., this is the -protocol when remote is authenticator, and I am the peer required to -authenticate. -.It Va hisauthproto Ns Li = Ns Ar protoname -Same as above, but only for his end of the link. -.It Va myauthname Ns Li = Ns Ar name -Set my system name for the authentication protocol. -.It Va hisauthname Ns Li = Ns Ar name -Set his system name for the authentication protocol. -For CHAP, this -will only be used as a hint, causing a warning message if remote did -supply a different name. -For PAP, it is the name remote must use to -authenticate himself (in connection with his secret). -.It Va myauthsecret Ns Li = Ns Ar secret -Set my secret (key, password) for use in the authentication phase. -For CHAP, this will be used to compute the response hash value, based -on remote's challenge. -For PAP, it will be transmitted as plain text -together with the system name. -Do not forget to quote the secrets from -the shell if they contain shell metacharacters (or white space). -.It Va myauthkey Ns Li = Ns Ar secret -Same as above. -.It Va hisauthsecret Ns Li = Ns Ar secret -Same as above, to be used if we are an authenticator and the remote peer -needs to authenticate. -.It Va hisauthkey Ns Li = Ns Va secret -Same as above. -.It Va callin -Require remote to authenticate himself only when he is calling in, but -not when we are caller. -This is required for some peers that do not -implement the authentication protocols symmetrically (like Ascend -routers, for example). -.It Va always -The opposite of -.Va callin . -Require remote to always authenticate, regardless of which side is -placing the call. -This is the default, and will not be explicitly -displayed in the -.Dq list -mode. -.It Va norechallenge -Only meaningful with CHAP. -Do not re-challenge peer once the initial -CHAP handshake was successful. -Used to work around broken peer -implementations that cannot grok being re-challenged once the -connection is up. -.It Ar rechallenge -With CHAP, send re-challenges at random intervals while the connection -is in network phase. -(The intervals are currently in the range of 300 -through approximately 800 seconds.) -This is the default, and will not -be explicitly displayed in the -.Dq list -mode. -.It Va lcp-timeout Ns Li = Ns Ar timeout-value -Allows to change the value of the LCP restart timer. -Values are -specified in milliseconds. -The value must be between 10 and 20000 ms, -defaulting to 3000 ms. -.It Va enable-vj -Enable negotiation of Van Jacobsen header compression. -(Enabled by default.) -.It Va disable-vj -Disable negotiation of Van Jacobsen header compression. -.It Va enable-ipv6 -Enable negotiation of the IPv6 network control protocol. -(Enabled by default if the kernel has IPv6 enabled.) -.It Va disable-ipv6 -Disable negotiation of the IPv6 network control protocol. -Since every -IPv4 interface in an IPv6-enabled kernel automatically gets an IPv6 -address assigned, this option provides for a way to administratively -prevent the link from attempting to negotiate IPv6. -Note that -initialization of an IPv6 interface causes a multicast packet to be -sent, which can cause unwanted traffic costs (for dial-on-demand -interfaces). -.El -.Sh EXAMPLES -.Bd -literal -# spppcontrol bppp0 -bppp0: phase=dead - myauthproto=chap myauthname="uriah" - hisauthproto=chap hisauthname="ifb-gw" norechallenge - lcp-timeout=3000 - enable-vj - enable-ipv6 -.Ed -.Pp -Display the settings for -.Li bppp0 . -The interface is currently in -.Em dead -phase, i.e., the LCP layer is down, and no traffic is possible. -Both -ends of the connection use the CHAP protocol, my end tells remote the -system name -.Dq Li uriah , -and remote is expected to authenticate by the name -.Dq Li ifb-gw . -Once the initial CHAP handshake was successful, no further CHAP -challenges will be transmitted. -There are supposedly some known CHAP -secrets for both ends of the link which are not being shown. -.Bd -literal -# spppcontrol bppp0 \e - authproto=chap \e - myauthname=uriah myauthsecret='some secret' \e - hisauthname=ifb-gw hisauthsecret='another' \e - norechallenge -.Ed -.Pp -A possible call to -.Nm -that could have been used to bring the interface into the state shown -by the previous example. -.Sh SEE ALSO -.Xr netstat 1 , -.Xr sppp 4 , -.Xr ifconfig 8 -.Rs -.%A B. Lloyd -.%A W. Simpson -.%T "PPP Authentication Protocols" -.%O RFC 1334 -.Re -.Rs -.%A W. Simpson, Editor -.%T "The Point-to-Point Protocol (PPP)" -.%O RFC 1661 -.Re -.Rs -.%A W. Simpson -.%T "PPP Challenge Handshake Authentication Protocol (CHAP)" -.%O RFC 1994 -.Re -.Sh HISTORY -The -.Nm -utility appeared in -.Fx 3.0 . -.Sh AUTHORS -The program was written by -.An J\(:org Wunsch , -Dresden. diff --git a/sbin/spppcontrol/spppcontrol.c b/sbin/spppcontrol/spppcontrol.c deleted file mode 100644 index e56310c635e9..000000000000 --- a/sbin/spppcontrol/spppcontrol.c +++ /dev/null @@ -1,266 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1997, 2001 Joerg Wunsch - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/socket.h> - -#include <net/if.h> -#include <net/if_sppp.h> - -#include <err.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sysexits.h> -#include <unistd.h> - -static void usage(void); -void print_vals(const char *ifname, struct spppreq *sp); -const char *phase_name(enum ppp_phase phase); -const char *proto_name(u_short proto); -const char *authflags(u_short flags); - -#define PPP_PAP 0xc023 -#define PPP_CHAP 0xc223 - -int -main(int argc, char **argv) -{ - int s, c; - int errs = 0, verbose = 0; - size_t off; - long to; - char *endp; - const char *ifname, *cp; - struct ifreq ifr; - struct spppreq spr; - - while ((c = getopt(argc, argv, "v")) != -1) - switch (c) { - case 'v': - verbose++; - break; - - default: - errs++; - break; - } - argv += optind; - argc -= optind; - - if (errs || argc < 1) - usage(); - - ifname = argv[0]; - strncpy(ifr.ifr_name, ifname, sizeof ifr.ifr_name); - - /* use a random AF to create the socket */ - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - err(EX_UNAVAILABLE, "ifconfig: socket"); - - argc--; - argv++; - - spr.cmd = (uintptr_t) SPPPIOGDEFS; - ifr.ifr_data = (caddr_t)&spr; - - if (ioctl(s, SIOCGIFGENERIC, &ifr) == -1) - err(EX_OSERR, "SIOCGIFGENERIC(SPPPIOGDEFS)"); - - if (argc == 0) { - /* list only mode */ - print_vals(ifname, &spr); - return 0; - } - -#define startswith(s) strncmp(argv[0], s, (off = strlen(s))) == 0 - - while (argc > 0) { - if (startswith("authproto=")) { - cp = argv[0] + off; - if (strcmp(cp, "pap") == 0) - spr.defs.myauth.proto = - spr.defs.hisauth.proto = PPP_PAP; - else if (strcmp(cp, "chap") == 0) - spr.defs.myauth.proto = - spr.defs.hisauth.proto = PPP_CHAP; - else if (strcmp(cp, "none") == 0) - spr.defs.myauth.proto = - spr.defs.hisauth.proto = 0; - else - errx(EX_DATAERR, "bad auth proto: %s", cp); - } else if (startswith("myauthproto=")) { - cp = argv[0] + off; - if (strcmp(cp, "pap") == 0) - spr.defs.myauth.proto = PPP_PAP; - else if (strcmp(cp, "chap") == 0) - spr.defs.myauth.proto = PPP_CHAP; - else if (strcmp(cp, "none") == 0) - spr.defs.myauth.proto = 0; - else - errx(EX_DATAERR, "bad auth proto: %s", cp); - } else if (startswith("myauthname=")) - strncpy(spr.defs.myauth.name, argv[0] + off, - AUTHNAMELEN); - else if (startswith("myauthsecret=") || - startswith("myauthkey=")) - strncpy(spr.defs.myauth.secret, argv[0] + off, - AUTHKEYLEN); - else if (startswith("hisauthproto=")) { - cp = argv[0] + off; - if (strcmp(cp, "pap") == 0) - spr.defs.hisauth.proto = PPP_PAP; - else if (strcmp(cp, "chap") == 0) - spr.defs.hisauth.proto = PPP_CHAP; - else if (strcmp(cp, "none") == 0) - spr.defs.hisauth.proto = 0; - else - errx(EX_DATAERR, "bad auth proto: %s", cp); - } else if (startswith("hisauthname=")) - strncpy(spr.defs.hisauth.name, argv[0] + off, - AUTHNAMELEN); - else if (startswith("hisauthsecret=") || - startswith("hisauthkey=")) - strncpy(spr.defs.hisauth.secret, argv[0] + off, - AUTHKEYLEN); - else if (strcmp(argv[0], "callin") == 0) - spr.defs.hisauth.flags |= AUTHFLAG_NOCALLOUT; - else if (strcmp(argv[0], "always") == 0) - spr.defs.hisauth.flags &= ~AUTHFLAG_NOCALLOUT; - else if (strcmp(argv[0], "norechallenge") == 0) - spr.defs.hisauth.flags |= AUTHFLAG_NORECHALLENGE; - else if (strcmp(argv[0], "rechallenge") == 0) - spr.defs.hisauth.flags &= ~AUTHFLAG_NORECHALLENGE; - else if (startswith("lcp-timeout=")) { - cp = argv[0] + off; - to = strtol(cp, &endp, 10); - if (*cp == '\0' || *endp != '\0' || - /* - * NB: 10 ms is the minimal possible value for - * hz=100. We assume no kernel has less clock - * frequency than that... - */ - to < 10 || to > 20000) - errx(EX_DATAERR, "bad lcp timeout value: %s", - cp); - spr.defs.lcp.timeout = to; - } else if (strcmp(argv[0], "enable-vj") == 0) - spr.defs.enable_vj = 1; - else if (strcmp(argv[0], "disable-vj") == 0) - spr.defs.enable_vj = 0; - else if (strcmp(argv[0], "enable-ipv6") == 0) - spr.defs.enable_ipv6 = 1; - else if (strcmp(argv[0], "disable-ipv6") == 0) - spr.defs.enable_ipv6 = 0; - else - errx(EX_DATAERR, "bad parameter: \"%s\"", argv[0]); - - argv++; - argc--; - } - - spr.cmd = (uintptr_t)SPPPIOSDEFS; - - if (ioctl(s, SIOCSIFGENERIC, &ifr) == -1) - err(EX_OSERR, "SIOCSIFGENERIC(SPPPIOSDEFS)"); - - if (verbose) - print_vals(ifname, &spr); - - return 0; -} - -static void -usage(void) -{ - fprintf(stderr, "%s\n%s\n", - "usage: spppcontrol [-v] ifname [{my|his}auth{proto|name|secret}=...]", - " spppcontrol [-v] ifname callin|always"); - exit(EX_USAGE); -} - -void -print_vals(const char *ifname, struct spppreq *sp) -{ - printf("%s:\tphase=%s\n", ifname, phase_name(sp->defs.pp_phase)); - if (sp->defs.myauth.proto) { - printf("\tmyauthproto=%s myauthname=\"%.*s\"\n", - proto_name(sp->defs.myauth.proto), - AUTHNAMELEN, sp->defs.myauth.name); - } - if (sp->defs.hisauth.proto) { - printf("\thisauthproto=%s hisauthname=\"%.*s\"%s\n", - proto_name(sp->defs.hisauth.proto), - AUTHNAMELEN, sp->defs.hisauth.name, - authflags(sp->defs.hisauth.flags)); - } - printf("\tlcp-timeout=%d ms\n", sp->defs.lcp.timeout); - printf("\t%sable-vj\n", sp->defs.enable_vj? "en": "dis"); - printf("\t%sable-ipv6\n", sp->defs.enable_ipv6? "en": "dis"); -} - -const char * -phase_name(enum ppp_phase phase) -{ - switch (phase) { - case PHASE_DEAD: return "dead"; - case PHASE_ESTABLISH: return "establish"; - case PHASE_TERMINATE: return "terminate"; - case PHASE_AUTHENTICATE: return "authenticate"; - case PHASE_NETWORK: return "network"; - } - return "illegal"; -} - -const char * -proto_name(u_short proto) -{ - static char buf[12]; - switch (proto) { - case PPP_PAP: return "pap"; - case PPP_CHAP: return "chap"; - } - sprintf(buf, "0x%x", (unsigned)proto); - return buf; -} - -const char * -authflags(u_short flags) -{ - static char buf[30]; - buf[0] = '\0'; - if (flags & AUTHFLAG_NOCALLOUT) - strcat(buf, " callin"); - if (flags & AUTHFLAG_NORECHALLENGE) - strcat(buf, " norechallenge"); - return buf; -} diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index af3ad94c9e2e..e2f68f619f37 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -379,7 +379,6 @@ MAN= aac.4 \ ng_socket.4 \ ng_source.4 \ ng_split.4 \ - ng_sppp.4 \ ng_sscfu.4 \ ng_sscop.4 \ ng_tag.4 \ @@ -529,7 +528,6 @@ MAN= aac.4 \ spigen.4 \ ${_spkr.4} \ splash.4 \ - sppp.4 \ ste.4 \ stf.4 \ stge.4 \ diff --git a/share/man/man4/man4.i386/ce.4 b/share/man/man4/man4.i386/ce.4 index 531904fd539c..451f9fb22da0 100644 --- a/share/man/man4/man4.i386/ce.4 +++ b/share/man/man4/man4.i386/ce.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2006 +.Dd October 22, 2021 .Dt CE 4 i386 .Os .Sh NAME @@ -44,29 +44,19 @@ module at boot time, place the following line in .Bd -literal -offset indent if_ce_load="YES" .Ed -.Pp -Additional options: -.Cd "device sppp" -.Cd "options NETGRAPH" -.Cd "options NETGRAPH_CRONYX" .Sh DESCRIPTION The .Nm -driver needs either -.Xr sppp 4 -or -.Xr netgraph 4 . -Which one to use is determined by the -.Dv NETGRAPH_CRONYX -option. -If this option is present in your kernel configuration file, the -.Nm -driver will be compiled with +driver creates a .Xr netgraph 4 -support. -Otherwise, it will be compiled with -.Xr sppp 4 -support. +node for each device found. +The node is usually paired with +.Xr ng_async 4 , +.Xr ng_cisco 4 , +.Xr ng_frame_relay 4 +or with +.Xr ng_ppp 4 +under control of net/mpd5 port. .Pp Refer to .Xr sconfig 8 @@ -89,12 +79,8 @@ with 32 HDLC channels. .El .Sh SEE ALSO .Xr cp 4 , -.Xr ctau 4 , -.Xr cx 4 , -.Xr sppp 4 , -.Xr ifconfig 8 , -.Xr sconfig 8 , -.Xr spppcontrol 8 *** 8694 LINES SKIPPED ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110221841.19MIfvqY029121>