Commit graph

37 commits

Author SHA1 Message Date
Warner Losh 4d65a7c695 usr.sbin: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:24:01 -07:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh 4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Pedro F. Giffuni d282086dec pppctl88) Avoid strcpy() copies on overlapping string.
This may lead to unpredicatable behaviour on different platforms or C
library implementations. Use an intermediate variable.

Obtained from:	DragonFlyBSD (git a861a526)
2018-01-29 14:23:44 +00:00
Pedro F. Giffuni 1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Brian Somers cf4bdb6e94 Handle select() returning -1/EINTR - fairly common in these KSE days.
PR:		74972
MFC after:	3 days
2004-12-13 14:50:13 +00:00
Tim J. Robbins 8b45548804 Add IPv6 support to pppctl by using getaddrinfo() and trying each address
it returns. This allows it to connect to the server side again, which
has been listening on IPv6 addresses exclusively for more than 2 years.

PR:		59369
2003-12-07 08:39:29 +00:00
Philippe Charnier 54ede02d10 add FBSDID 2003-07-06 12:44:11 +00:00
David E. O'Brien 757eeda04b *** empty log message *** 2001-10-01 08:43:58 +00:00
Brian Somers ad96855df1 Better handling of the return from snprintf 2001-08-18 22:46:06 +00:00
Sheldon Hearn e1b4d8d074 Use STD{ERR,IN,OUT}_FILENO instead of their numeric values. The
definitions are more readable, and it's possible that they're
more portable to pathalogical platforms.

Submitted by:   David Hill <david@phobia.ms>
2001-07-26 11:02:39 +00:00
Brian Somers 2da5df67a7 Issue a ``quit'' after other ppp commands given on the command line and
then wait for the connection to be closed by the peer.

This means that commands such as ``pppctl ... show links'' will
display the correct output again (rather than truncating it depending
on how much data arrived in the last packet).
2001-03-25 20:06:08 +00:00
Brian Somers af5b109676 A NetBSD specific fix
Kind-of obtained from: NetBSD
2001-03-05 00:59:53 +00:00
Brian Somers 8a407aad55 Change interactive mode so that a monitor thread keeps an eye on the
ppp descriptor and signals the terminal thread when there's something
to read on that descriptor.

This means that the main loop doesn't have to alarm() itself into
dropping out of el_gets() frequently to check the descriptor.  This
dropping out was disturbing syscons (via ioctl()s from libedit) enough
to reset the screensaver timeout every .5 of a second.

PR:	20345
2000-11-27 02:31:25 +00:00
Brian Somers ea32742676 libutil is no longer required as setproctitle() has moved to libc 2000-09-02 02:01:18 +00:00
Brian Somers 087a20b80a If the -p option is used, use setproctitle() to hide it's argument
(a password) asap.
2000-08-16 12:01:17 +00:00
Brian Somers e83358b444 NetBSD has changed the el_init() prototype
Submitted by:	Kazuyoshi Kato <kazk@yyy.or.jp>
1999-09-20 07:22:22 +00:00
Peter Wemm 97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Brian Somers e1e9e15252 Use err[x]/warn[x] and improve error reporting
Submitted by: charnier
1999-08-02 16:59:28 +00:00
Brian Somers b941043fa2 Add support for NetBSD (history() from libedit is different). 1999-04-26 08:53:52 +00:00
Brian Somers ea56791112 Mention the error when we fail to connect(). 1999-01-31 12:24:29 +00:00
Brian Somers 23e877a8e1 Quiet -Wall in gcc-2.8.1
Obtained from: OpenBSD
1998-03-22 00:43:04 +00:00
Brian Somers fcabffd883 Remove bogus timeout code in Receive().
Don't read(fd, buffer, 0) and think ppp has closed the
connection when `buffer' is full, instead, flush most of
buffer to the terminal and read() for a reasonable length.
This fixes "show route" when there's more than 2k of
routing output.
1997-12-27 13:44:42 +00:00
Brian Somers c39934ea32 Add (BSD) copyright headers. 1997-12-21 12:11:13 +00:00
Brian Somers 2e14bb4605 Zero struct sockaddr_??s before filling them in.
Suggested by: Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-21 02:27:32 +00:00
Brian Somers 31746f5580 "No reply from ppp" -> "Connection closed".
"No reply" sounds like the message didn't get through (for
example when you `pppctl xxxx quit all'.
1997-12-18 00:29:56 +00:00
Brian Somers 4754552a07 Remove an unnecessary (and wrong) cast. 1997-12-17 00:26:58 +00:00
Brian Somers f5c9fce9cd Add Id string. 1997-11-18 00:22:07 +00:00
Brian Somers f3a51f7a0b Notice that ppp has closed the connection properly.
Remove the timeout hack to notice that ppp has closed the connection.
Remove the ``special case'' hacks for "quit" and "bye", as pppctl
now exits immediately when the connection is closed by ppp.
Suggest a secure "set server" line for connecting ppp & pppctl.
Tidy up and correct a few man page typos.
1997-11-18 00:20:29 +00:00
Brian Somers d2bb1901e7 Use select() instead of poll() for portabilities sake. 1997-11-11 13:27:47 +00:00
Brian Somers f960587c7b Poll the socket descriptor while in el_gets()
so that our display is scribbled over as we
requested.
1997-11-11 12:28:02 +00:00
Brian Somers 2d77cf0b00 Prompt correctly when ppp *doesn't* ask for a password. 1997-11-09 18:50:34 +00:00
Brian Somers 7d0a1bac71 Style police.
bzero -> memset
index -> strchr
rindex -> strrchr
Use libedit (this should make pppctl a lot more attractive than telnet).
1997-11-07 20:20:15 +00:00
Brian Somers fbff0da4c8 Support interactive mode. 1997-11-07 02:54:49 +00:00
Brian Somers 437b5af636 Allow hosts specified by IP number (avoiding
a DNS lookup)
Update doc including the [host:]port syntax.
1997-07-28 22:17:48 +00:00
Brian Somers de68f5c548 Support "host:port" as first arg. 1997-07-12 19:26:49 +00:00
Brian Somers c957ff409a Allow command line control of ppp through both
TCP and AF_LOCAL sockets.
1997-06-28 01:04:54 +00:00