Commit Graph

129 Commits

Author SHA1 Message Date
Michael Tuexen
d5b4aa9075 Add support for SCTP.
MFC after: 3 days
2015-06-13 20:11:02 +00:00
Michael Tuexen
e6f718c750 Allow more than one local or remote address per socket. This is needed to
support SCTP (and MPTCP in the future). No functional change for existing
protocols.

MFC after: 3 days
2015-06-13 20:05:20 +00:00
Michael Tuexen
7e80c6b0e2 Allow more than one socket entry for a file descriptor. This is needed
for supporting 1-to-many style SCTP sockets. For other sochets, there
is no functional change.

MFC after: 3 days
2015-06-13 20:01:54 +00:00
Michael Tuexen
baa7f281a3 Simplify printaddr(). No functional change.
MFC after: 3 days
2015-06-13 19:56:04 +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
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Michael Tuexen
25044bbcfb The code says "or", not "either or". So fix the documentation.
MFC after: 1 week
2015-04-07 14:33:03 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Baptiste Daroussin
2b7af31cf5 use .Mt to mark up email addresses consistently (part3)
PR:		191174
Submitted by:	Franco Fichtner  <franco at lastsummer.de>
2014-06-23 08:23:05 +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
Simon J. Gerraty
23090366f7 Sync from head 2012-11-04 02:52:03 +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
Andrew Thompson
c7bec96b05 Update the usage with the new jail option.
Spotted by:	Jason Hellenthal
MFC after:	3 days
2012-06-27 23:26:32 +00:00
Navdeep Parhar
09fe63205c - Updated TOE support in the kernel.
- Stateful TCP offload drivers for Terminator 3 and 4 (T3 and T4) ASICs.
  These are available as t3_tom and t4_tom modules that augment cxgb(4)
  and cxgbe(4) respectively.  The cxgb/cxgbe drivers continue to work as
  usual with or without these extra features.

- iWARP driver for Terminator 3 ASIC (kernel verbs).  T4 iWARP in the
  works and will follow soon.

Build-tested with make universe.

30s overview
============
What interfaces support TCP offload?  Look for TOE4 and/or TOE6 in the
capabilities of an interface:
# ifconfig -m | grep TOE

Enable/disable TCP offload on an interface (just like any other ifnet
capability):
# ifconfig cxgbe0 toe
# ifconfig cxgbe0 -toe

Which connections are offloaded?  Look for toe4 and/or toe6 in the
output of netstat and sockstat:
# netstat -np tcp | grep toe
# sockstat -46c | grep toe

Reviewed by:	bz, gnn
Sponsored by:	Chelsio communications.
MFC after:	~3 months (after 9.1, and after ensuring MFC is feasible)
2012-06-19 07:34:13 +00:00
Andrew Thompson
00feaafdf8 Allow the socket list to be limited to a specific jail id.
No objections:	current@
2012-05-24 01:31:10 +00:00
Mikolaj Golub
003e7e4928 Try to avoid ambiguity when sysctl returns ENOMEM additionally
checking the returned oldlen: when ENOMEM is due to the supplied
buffer being too short the return oldlen is equal to buffer size.

Without this additional check sockstat gets stuck in loop leaking the
memory if the returned ENOMEM was due the exceeded memorylocked
limit. This is easily can be observed running `limits -l 1k sockstat'.

Submitted by:	Andrey Zonov <andrey zonov org>
MFC after:	1 week
2012-02-01 18:03:21 +00:00
Jilles Tjoelker
61149f8d7c sockstat: Also show sockets not associated with a file descriptor.
Sockets not associated with a file descriptor include TCP TIME_WAIT states
and sockets created via the socket(9) API such as from rpc.lockd and the NFS
client.

PR:		bin/164081
MFC after:	2 weeks
No objection:	des
2012-01-24 21:33:34 +00:00
Ulrich Spörlein
fb2ad9d3a4 Reencode files from latin1 to UTF-8.
This makes a tiny percentage of entries in calendars ugly for latin1
users, but fixes them for UTF-8 users.

This badly needs a solution involving locale-dependent re-encoding.
2011-12-30 10:59:15 +00:00
Maxim Konovalov
09bbda2122 o Make sockstat -6 output more readable for long ipv6
addresses (most of them apart from ::1): put a whitespace
between local and remote address:port pairs.

PR:		bin/145194
Submitted by:	Fedor Dikarev
MFC after:	2 weeks
2010-03-30 09:58:21 +00:00
Ed Schouten
b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Ed Schouten
01cc221b4c Mute some warnings on uninitialized variables.
The code does the right thing, but the compiler is unable to figure it
out. All paths that use that variable use the same invariant.
2010-01-02 10:14:35 +00:00
Dag-Erling Smørgrav
fcdb43ba01 Note that sockstat(1) does not display kernel-owned sockets.
Submitted by:	infofarmer@
MFC after:	2 weeks
2009-12-21 17:23:04 +00:00
Edward Tomasz Napierala
e50022797f Add manual page links to advertise procstat(1) a little better.
Approved by:	re (kib)
2009-07-09 16:40:00 +00:00
Robert Watson
4cf172fd65 Remove unused v6 macro aliases for inpcb fields:
in6p_ip6_nxt
        in6p_vflag
        in6p_flags
        in6p_socket
        in6p_lport
        in6p_fport
        in6p_ppcb

Remove unused v6 macro aliases for inpcb flags:

        IN6P_HIGHPORT
        IN6P_LOWPORT
        IN6P_ANONPORT
        IN6P_RECVIF
        IN6P_MTUDISC
        IN6P_FAITH
        IN6P_CONTROLOPTS

References to in6p_lport and in6_fport in sockstat are also replaced with
normal inp_lport and inp_fport references.

MFC after:	3 days
Reviewed by:	bz
2009-03-10 17:57:41 +00:00
Dag-Erling Smørgrav
1ccdc84fdd Make sure the entries don't run into each other when they're longer than
the allotted space.

PR:		bin/129318
Submitted by:	Ighighi <ighighi@gmail.com>
MFC after:	3 weeks
2009-01-30 14:28:50 +00:00
Bruce M Simpson
f7916f9caf Add -L to usage(). 2008-05-19 11:35:11 +00:00
Bruce M Simpson
9b6ca89250 Add an -L option to ignore loopback Internet sockets.
MFC after:	2 weeks
2008-05-19 11:32:44 +00:00
Maxim Konovalov
48c513e07f o Do not warn if the process exits before we get its name.
PR:		bin/113777
Submitted by:	Dmitrij Tejblum
MFC after:	1 week
2007-06-16 20:24:55 +00:00
Ed Maste
f487a6a811 Use proc name (ki_comm) instead of thread name (ki_ocomm) as these may now
be different.
2007-03-22 17:47:58 +00:00
Giorgos Keramidas
d2d77d2aee In revision 1.14 I broke the -4 and -6 options of sockstat(1).
Using either one of the two would result in an empty protos[]
array, and no sockets were actually listed:

  % sockstat -4
  USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
  % sockstat -6
  USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
  %

Fix this bug by tweaking appropriately the logic of handling opt_4,
opt_6, opt_u and protos_defined.

Submitted by:	des
Pointy hat:	keramida
2006-11-12 19:03:39 +00:00
Giorgos Keramidas
1f3d67aade Add support for filtering sockets by protocol type. The default
behavior of sockstat(1) will still be to show "udp", "tcp" and
"divert" protocols, but we can now provide a (comma-separated)
list of protocols, as in:

    % sockstat -P tcp

to list only TCP sockets, or we can filter more than one protocol
by separating the protocol names with a comma:

    % sockstat -P tcp,udp

Protocol names are parsed with getprotobyname(3), so any protocol
whose name is listed in `/etc/protocols' should work fine.

Submitted by:	Josh Carroll <josh.carroll@psualum.com>
Approved by:	des
2006-11-11 22:11:54 +00:00
Dag-Erling Smørgrav
fd0cba238e Don't free(sock) before it's even allocated.
Submitted by:	Joerg Sonnenberger <joerg@britannica.bec.de>
MFC after:	1 week
2005-06-10 06:36:03 +00:00
Ruslan Ermilov
254dd1666e Let bsd.prog.mk set SRCS and MAN to their default values. 2005-01-28 16:08:11 +00:00
Ruslan Ermilov
4438d91ea2 Scheduled mdoc(7) sweep. 2005-01-11 10:32:52 +00:00
Ruslan Ermilov
4b2a3d41da Unbreak sockstat(1) on systems without the divert protocol. 2004-12-06 09:28:05 +00:00
Ruslan Ermilov
2cfbdf89b7 Show divert(4) sockets as well. 2004-12-05 14:17:14 +00:00
Peter Pentchev
97c6143c95 Do not display bogus entries for sockets in the TIME_WAIT or similar
states that no longer have a corresponding file descriptor - until now,
sockstat would mostly randomly match null kern.file.*.xf_data fields
with the first mostly-closed socket.

This bugfix is a RELENG_5 candidate.

Approved by:	andre
2004-08-25 16:36:17 +00:00
John-Mark Gurney
b4eb37c63d make sockstat not print wierd addresses on not connected unix domain sockets
Pointed out by:	rwatson
Reviewed by:	peter
2003-07-19 06:23:56 +00:00
Maxime Henrion
ae94787d6d Finish the implementation of the -p switch so that it
actually works.  I have no idea why this wasn't finished
and happened to try to use it.
2003-06-07 14:36:49 +00:00
Robert Drehmel
9efed1e6e2 To reserve space for 65536 bits, allocate
65536 / (sizeof(int) * CHAR_BITS) `int's instead of
65536 / (sizeof(int) * CHAR_BITS) bytes to avoid a possible
segmentation fault if ports above 16383 are specified via the
-p option on a platform with 4 byte wide ints.

Approved by:	re (bmah)
Reported by:	Marco Wertejuk <wertejuk@mwcis.com>
2003-05-09 09:11:27 +00:00
Matthew Dillon
48e3128b34 Bow to the whining masses and change a union back into void *. Retain
removal of unnecessary casts and throw in some minor cleanups to see if
anyone complains, just for the hell of it.
2003-01-13 00:33:17 +00:00
Matthew Dillon
cd72f2180b Change struct file f_data to un_data, a union of the correct struct
pointer types, and remove a huge number of casts from code using it.

Change struct xfile xf_data to xun_data (ABI is still compatible).

If we need to add a #define for f_data and xf_data we can, but I don't
think it will be necessary.  There are no operational changes in this
commit.
2003-01-12 01:37:13 +00:00
Ruslan Ermilov
06e482e60a mdoc(7) police: markup polishing.
Approved by:	re
2002-11-26 17:33:37 +00:00
Robert Drehmel
6dbe8d53a5 Use a cast to `void *' before casting to a pointer to a structure
to stop GCC emitting warnings about increased alignment requirements
which broke the build for sparc64.

Approved by:	des
2002-08-02 11:57:59 +00:00
Dag-Erling Smørgrav
02bd9db045 Don't depend on namespace pollution from <netinet/in_pcb.h>.
Submitted by:	bde
2002-08-01 16:49:31 +00:00
Dag-Erling Smørgrav
1e6690e5db Implement the -l and -c options, which I'd forgotten. 2002-08-01 11:02:30 +00:00
Dag-Erling Smørgrav
ca007d9172 Rewrite sockstat(1) in C.
Sponsored by:	DARPA, NAI Labs
2002-07-31 12:32:03 +00:00
Dag-Erling Smørgrav
d397408818 Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
Dag-Erling Smørgrav
b32ecb502b Drop maintainership of this, it serves no purpose. 2002-04-15 19:36:50 +00:00
Ruslan Ermilov
c5e7e03a14 Spell "FreeBSD" with "F" and "BSD" in uppercase. 2001-08-13 16:33:00 +00:00
Ruslan Ermilov
3ce0d6e846 mdoc(7) police: fix markup. 2001-08-10 10:43:45 +00:00
Dag-Erling Smørgrav
03f28475f8 Allow the user to specify port ranges against which to match inet sockets.
Suggested by:	roam
2001-08-07 19:59:52 +00:00
Matt Jacob
df94d4d280 Fix 64 bit issues so that sockstat && fstat work correctly on alpha.
PR:		29231
Submitted by:	pherman@frenchfries.net
MFC after:	2 weeks
2001-07-25 20:31:20 +00:00
Ruslan Ermilov
625003720a mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 14:16:33 +00:00
Ruslan Ermilov
b9ad8c8635 beforeinstall -> SCRIPTS. 2001-04-07 11:21:35 +00:00
Ruslan Ermilov
dc12be5258 MAN[1-9] -> MAN. 2001-03-27 10:52:19 +00:00
Dag-Erling Smørgrav
84e268e3fc Use the newly introduced -W flag to netstat(1) to avoid truncated addresses. 2001-03-15 20:46:35 +00:00
Dag-Erling Smørgrav
a0581bbcc2 Add (and document) options for showing only listening or connected sockets. 2001-03-06 13:48:38 +00:00
Ruslan Ermilov
1bfea903ed Prepare for mdoc(7)NG. 2001-01-16 09:39:23 +00:00
Ruslan Ermilov
88544700ca mdoc(7) police: added missing .Os call. 2000-12-14 13:58:15 +00:00
Ruslan Ermilov
b82f5db0ac Spell the des's name correctly. 2000-11-14 13:19:26 +00:00
Dag-Erling Smørgrav
91ef813ce3 Skip sockets with no SCB 2000-10-13 16:25:37 +00:00
Dag-Erling Smørgrav
ac1070c6fe Document the fact that sockstat now lists Unix domain sockets, and the new
command-line options for selecting what to display.
2000-10-07 14:11:43 +00:00
Dag-Erling Smørgrav
0c2352994b Total rewrite. This was actually the first non-trivial Perl script I ever
wrote, and as such was not very pretty.

Changes that may cause problems for people who use sockstat in scripts:

 - sockstat(8) now displays Unix domain sockets in addition to IPv4 and IPv6
 - the last period in local and foreign addresses is changed to a colon to
   make the port number easier to spot
 - IPv4 and IPv6 sockets are listed separately (IPv4 first, then IPv6, then
   Unix)
2000-10-07 14:10:37 +00:00
Ruslan Ermilov
6159b9dd5b Restore support for displaying raw IPv4 sockets and
correct the author's name.  Were broken in rev 1.6.

Approved by:	des
2000-08-30 13:24:01 +00:00
Dag-Erling Smørgrav
2d090923d6 Invoke netstat(1) and fstat(1) with full path. 2000-08-30 09:18:20 +00:00
Philippe Charnier
f57cdd0f01 Do not dot terminate list of references 2000-03-26 14:56:52 +00:00
Yoshinobu Inoue
f3935df101 Prevent sockstat print out some empty entries related to IPv6.
Sockstat use netstat tcp/udp socket print, and fstat tcp/udp
  socket print, but it just specify all of IPPROTO_IP and
  IPPROTO_IPV6 sockets for fstat.
  Now IPv6 socket also use raw socket, but only netstat don't print it,
  so now they are printed as empty entries in sockstat output.

Approved by: jkh
2000-03-11 11:25:00 +00:00
Sheldon Hearn
87faa07bec Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 12:20:22 +00:00
Yoshinobu Inoue
482ca4274b Update sockstat to support INET6 socket printing.
Approved by: jkh

Submitted by: Ben Smithurst <ben@scientia.demon.co.uk>
Reviewed by: des
2000-02-26 02:56:16 +00:00
Sheldon Hearn
5ff829fdbf Add xrefs to the {f,net,sock}stat.1 manpages. While I'm in there, fix
the sockstat.1 document title, which still remembers when sockstat was
called lsock.

Reviewed by:	mpp
1999-09-06 13:14:24 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Dag-Erling Smørgrav
14802b6092 Use -finet option to netstat(1), and don't discard anything.
Don't truncate the protocol field.
These two changes conspire to make sockstat(1) show divert sockets.

Submitted by:	ru
1999-07-06 19:12:31 +00:00
Dag-Erling Smørgrav
c0da497e2d Don't use STDOUT_TOP.
Submitted by:	Christopher Masto <chris@netmonger.net>
1999-05-01 11:31:19 +00:00
Dag-Erling Smørgrav
5827850902 Rename lsock(1) to sockstat(1).
Suggested by:	Sheldon Hearn <sheldonh@iafrica.com>
Approved by:	Peter Wemm <peter@netplex.com.au>
1999-04-15 13:40:43 +00:00