Commit graph

44 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 fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Alfonso Gregory a2cc93ec7f Mark usage function as __dead2 in programs where it does not return
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735
2023-07-07 10:45:18 -06:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Michael Tuexen c2b53b107e tcpdrop: tweak comments
MFC after:	1 week
Sponsored by:	Netflix, Inc.
2021-12-04 15:08:01 +01:00
Michael Tuexen 8ea363c8c6 tcpdrop: explicitly choose TCP as the transport protocol
MFC after:	1 week
Sponsored by:	Netflix, Inc.
2021-12-04 15:03:29 +01:00
Michael Tuexen 31537ea583 tcpdrop: allow TCP connections to be filtered by cc-algo
In addition to filtering by stack and state, allow filtering
by the congestion control module used.  Choose the command line
options to be consistent with the ones of sockstat.

MFC after:	1 week
Sponsored by:	Netflix, Inc.
2021-12-04 15:02:15 +01:00
Michael Tuexen 7ef45bd3cf tcpdrop: update man page, since the fastack stack has been removed
MFC after:	1 week
Sponsored by:	Netflix, Inc.
2021-12-04 14:27:46 +01:00
Michael Tuexen 300914a0ff tcpdrop: use a better name of a variable.
No functional change intended.

MFC after:	1 week
Sponsored by:	Netflix, Inc.
2021-12-04 13:48:41 +01:00
Brooks Davis 3a20f06a1c Use uintptr_t alone when assigning to kvaddr_t variables.
Suggested by:	jhb
2018-07-10 13:03:06 +00:00
Brooks Davis f6293d7296 Work around lame warnings in ancient gcc on 32-bit platforms.
Fixes r335979.
2018-07-05 17:02:10 +00:00
Eric van Gyzen 1de11cd4e1 tcpdrop: ensure NUL termination of a string
strncpy did not guarantee NUL termination of the "stack" string.
Use strlcpy instead.  While I'm here, avoid unnecessary memset
and strnlen calls.

Reported by:	Coverity
CID:		1381035
Sponsored by:	Dell EMC
2018-05-28 01:58:49 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Michael Tuexen 7c9470c075 Remove empty line accidently introduced in r323626. 2017-09-15 20:41:12 +00:00
Michael Tuexen c3c1d365de Add references. Suggested by Maxim Konovalov.
Sponsored by:	Netflix, Inc.
2017-09-15 20:34:52 +00:00
Michael Tuexen 507a9c432b Bump date missed in r323596. Trim trailing whitespace.
Sponsored by:	Netflix, Inc.
2017-09-14 20:42:19 +00:00
Michael Tuexen 314e8196ea Add a description how tcpdrop handles the case of specifying the
-s and the -S option.

Sponsored by:		Netflix, Inc.
2017-09-14 18:50:40 +00:00
Michael Tuexen e1418fa5ef Allow TCP connections to be filtered by stack and state.
Choose the command line options to be consistent with the ones of
sockstat.

Sponsored by:	Netflix, Inc.
2017-09-12 13:39:44 +00:00
Maxim Konovalov 7c415819be o Clean the whole array of IPv4 addresses not just a local part.
PR:		218923
Submitted by:	Daniel McRobb
2017-04-28 09:17:16 +00:00
Gleb Smirnoff cc65eb4e79 Hide struct inpcb, struct tcpcb from the userland.
This is a painful change, but it is needed.  On the one hand, we avoid
modifying them, and this slows down some ideas, on the other hand we still
eventually modify them and tools like netstat(1) never work on next version of
FreeBSD.  We maintain a ton of spares in them, and we already got some ifdef
hell at the end of tcpcb.

Details:
- Hide struct inpcb, struct tcpcb under _KERNEL || _WANT_FOO.
- Make struct xinpcb, struct xtcpcb pure API structures, not including
  kernel structures inpcb and tcpcb inside.  Export into these structures
  the fields from inpcb and tcpcb that are known to be used, and put there
  a ton of spare space.
- Make kernel and userland utilities compilable after these changes.
- Bump __FreeBSD_version.

Reviewed by:	rrs, gnn
Differential Revision:	D10018
2017-03-21 06:39:49 +00:00
Simon J. Gerraty ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty 44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Baptiste Daroussin 01c2b8ac0d use .Mt to mark up email addresses consistently (part2)
PR:		191174
Submitted by:	Franco Fichtner  <franco@lastsummer.de>
2014-06-20 09:57:27 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
David E. O'Brien d9a447559b Sync with HEAD. 2013-02-08 16:10:16 +00:00
John Baldwin 2d5d7a0c83 Allow the address and ports to be separated by a colon or period rather
than a space to permit directly pasting the output of commands such as
netstat and sockstat on the command line.

Reviewed by:	net
MFC after:	1 week
2013-01-30 18:24:29 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Bjoern A. Zeeb b3a1dfb7e1 Include param.h for CACHE_LINE_SIZE to unbreak the build. 2011-06-06 17:07:38 +00:00
Maxim Konovalov e094d2c0c9 o Remove an incomplete sentence.
PR:		docs/156593
Submitted by:	Yuri Pankov
MFC after:	1 week
2011-04-23 05:56:06 +00:00
Ed Schouten 71ccf09269 The last big commit: let usr.sbin/ use WARNS=6 by default. 2010-01-02 11:07:44 +00:00
Juli Mallett ba33818dce o) Restructure tcpdrop(8) to provide a facility to try to drop all established
connections.  Including a flag to instead output a sequence of tcpdrop(8)
   invocations that would accomplish the same thing, which is convenient for
   scripting.
o) Make tcpdrop complain if the addresses given to it are entirely in different
   address families, rather than failing silently.
o) When cross-referencing httpd(8), do not explicitly specify the apache2 port,
   since the example in question is generic.
2009-06-01 06:49:09 +00:00
Ruslan Ermilov 5d890e67dd Normalize usage output. 2007-10-31 13:49:20 +00:00
Christian Brueffer f0ea72a038 - Remove MLINKS to nonexistant manpages
- Change some section numbers to match reality
- For MLINKS to manpages from ports, mention which port installs them

MFC after:	3 days
2005-07-14 20:29:08 +00:00
Maxim Konovalov f6da736775 o Improve the example a bit.
Submitted by:	hrs
2005-03-14 14:12:29 +00:00
Maxim Konovalov 08e0b6bbf2 Sort xrefs 2005-03-14 12:24:34 +00:00
Maxim Konovalov e27b2d2765 o Replace OpenBSD-specific example by FreeBSD's one.
Noticed by:	Daniel O'Connor
2005-03-14 12:15:43 +00:00
Maxim Konovalov 9945c0e21f o Add handling of an IPv4-mapped IPv6 address.
o Use SYSCTL_IN() macro instead of direct call of copyin(9).

Submitted by:	ume

o Move sysctl_drop() implementation to sys/netinet/tcp_subr.c where
most of tcp sysctls live.
o There are net.inet[6].tcp[6].getcred sysctls already, no needs in
a separate struct tcp_ident_mapping.

Suggested by:	ume
2005-02-14 07:37:51 +00:00
Maxim Konovalov 212a79b010 o Implement net.inet.tcp.drop sysctl and userland part, tcpdrop(8)
utility:

    The tcpdrop command drops the TCP connection specified by the
    local address laddr, port lport and the foreign address faddr,
    port fport.

Obtained from:	OpenBSD
Reviewed by:	rwatson (locking), ru (man page), -current
MFC after:	1 month
2005-02-06 10:47:12 +00:00