History log of /freebsd-current/usr.sbin/tcpdrop/tcpdrop.c
Revision Date Author Comments
# 4d65a7c6 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

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


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# a2cc93ec 07-Jul-2023 Alfonso Gregory <gfunni234@gmail.com>

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


# c2b53b10 04-Dec-2021 Michael Tuexen <tuexen@FreeBSD.org>

tcpdrop: tweak comments

MFC after: 1 week
Sponsored by: Netflix, Inc.


# 8ea363c8 04-Dec-2021 Michael Tuexen <tuexen@FreeBSD.org>

tcpdrop: explicitly choose TCP as the transport protocol

MFC after: 1 week
Sponsored by: Netflix, Inc.


# 31537ea5 04-Dec-2021 Michael Tuexen <tuexen@FreeBSD.org>

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.


# 300914a0 04-Dec-2021 Michael Tuexen <tuexen@FreeBSD.org>

tcpdrop: use a better name of a variable.

No functional change intended.

MFC after: 1 week
Sponsored by: Netflix, Inc.


# 3a20f06a 10-Jul-2018 Brooks Davis <brooks@FreeBSD.org>

Use uintptr_t alone when assigning to kvaddr_t variables.

Suggested by: jhb


# f6293d72 05-Jul-2018 Brooks Davis <brooks@FreeBSD.org>

Work around lame warnings in ancient gcc on 32-bit platforms.

Fixes r335979.


# 1de11cd4 27-May-2018 Eric van Gyzen <vangyzen@FreeBSD.org>

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


# e1418fa5 12-Sep-2017 Michael Tuexen <tuexen@FreeBSD.org>

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.


# 7c415819 28-Apr-2017 Maxim Konovalov <maxim@FreeBSD.org>

o Clean the whole array of IPv4 addresses not just a local part.

PR: 218923
Submitted by: Daniel McRobb


# cc65eb4e 21-Mar-2017 Gleb Smirnoff <glebius@FreeBSD.org>

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


# 2d5d7a0c 30-Jan-2013 John Baldwin <jhb@FreeBSD.org>

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


# b3a1dfb7 06-Jun-2011 Bjoern A. Zeeb <bz@FreeBSD.org>

Include param.h for CACHE_LINE_SIZE to unbreak the build.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# ba33818d 01-Jun-2009 Juli Mallett <jmallett@FreeBSD.org>

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.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 5d890e67 31-Oct-2007 Ruslan Ermilov <ru@FreeBSD.org>

Normalize usage output.


# 9945c0e2 14-Feb-2005 Maxim Konovalov <maxim@FreeBSD.org>

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


# 212a79b0 06-Feb-2005 Maxim Konovalov <maxim@FreeBSD.org>

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