OpenBSD CVS

CVS log for src/usr.bin/systat/pftop.c


[BACK] Up to [local] / src / usr.bin / systat

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.47 / (download) - annotate - [select for diffs], Mon Apr 22 14:19:48 2024 UTC (3 weeks, 5 days ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.46: +8 -10 lines
Diff to previous 1.46 (colored)

fix indentation and remove uneeded braces
feedback and ok tb@

Revision 1.46 / (download) - annotate - [select for diffs], Tue Jul 4 11:34:19 2023 UTC (10 months, 2 weeks ago) by sashan
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.45: +11 -1 lines
Diff to previous 1.45 (colored)

The recent change to DIOCGETRULE allows applications which
periodically read rules from pf(4) to consume all kernel
memory. The bug has been discovered and root caused by florian@.
In this particular case it was snmpd(8) what ate all kernel
memory.

This commit introduces DIOCXEND to pf(4) so applications such
as snmpd(8) and systat(1) to close ticket/transaction when
they are done with fetching the rules. This change also
updates snmpd(8) and systat(1) to use newly introduced
DIOCXEND ioctl(2).

OK claudio@, deraadt@, kn@

Revision 1.45 / (download) - annotate - [select for diffs], Thu Oct 17 21:54:29 2019 UTC (4 years, 7 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.44: +7 -8 lines
Diff to previous 1.44 (colored)

Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX.
This is the userland portion.  OK deraadt@ sashan@

Revision 1.44 / (download) - annotate - [select for diffs], Fri Jun 28 13:35:04 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.43: +9 -9 lines
Diff to previous 1.43 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.43 / (download) - annotate - [select for diffs], Mon Feb 18 13:11:44 2019 UTC (5 years, 3 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.42: +38 -38 lines
Diff to previous 1.42 (colored)

Change ps_len of struct pfioc_states and psn_len of struct
pfioc_src_nodes to size_t.  This avoids integer truncation by casts
to unsigned.  As the types of DIOCGETSTATES and DIOCGETSRCNODES
ioctl(2) arguments change, pfctl(8) and systat(1) should be updated
together with the kernel.  Calculate number of pf(4) states as
size_t in userland.
OK sashan@ deraadt@

Revision 1.42 / (download) - annotate - [select for diffs], Fri Sep 7 12:43:30 2018 UTC (5 years, 8 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.41: +6 -10 lines
Diff to previous 1.41 (colored)

Remove unnused af argument from unmask(), sync with pfctl

Noted by jca, thanks.

OK jca claudio

Revision 1.41 / (download) - annotate - [select for diffs], Thu Feb 8 07:00:33 2018 UTC (6 years, 3 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

Add the order keyword to systat global command interpreter.
This command shows the available orderings for the current view, which
ordering is active, their shortcuts, and if they're in reverse order.

manpage nits jmc@
OK tedu@

Revision 1.40 / (download) - annotate - [select for diffs], Wed Jul 19 12:58:31 2017 UTC (6 years, 10 months ago) by mikeb
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.39: +10 -11 lines
Diff to previous 1.39 (colored)

Allow HFSC classes to use flow queues

The FQ-CoDel related configuration (flows, quantum) becomes available
for the regular bandwidth queue.  Internally the kernel will pick the
FQ-CoDel for use as a queue manager for the specified class instead of
the FIFO.

Discussed with and OK henning@ at d2k17 as a part of a larger diff.

Revision 1.39 / (download) - annotate - [select for diffs], Mon May 22 14:51:10 2017 UTC (6 years, 11 months ago) by mikeb
Branch: MAIN
Changes since 1.38: +21 -9 lines
Diff to previous 1.38 (colored)

Support for displaying flow queues alongside H-FSC

This (ab)uses the fact that node->qstats.data.period field in
hfsc_class_stats structure is at the same offset as the 'flows'
field in fqcodel_stats.

While here make use of a presently empty field "SCH" to display
the queue management policy (flow or fifo) which is not strictly
a scheduler, but it will hopefully become descriptive and useful
later. This distinguishes flow queues from the regular HFSC ones.

OK sthen, visa

Revision 1.38 / (download) - annotate - [select for diffs], Tue May 16 22:29:07 2017 UTC (7 years ago) by mikeb
Branch: MAIN
Changes since 1.37: +8 -4 lines
Diff to previous 1.37 (colored)

Improve the precision of displayed bandwidth values

Carl Mascott has reported the issue and helped with the fix.  OK tb

Revision 1.37 / (download) - annotate - [select for diffs], Wed May 3 14:01:29 2017 UTC (7 years ago) by mikeb
Branch: MAIN
Changes since 1.36: +9 -11 lines
Diff to previous 1.36 (colored)

Remove unused PRIO column from the queueing display;  ok sthen@

Revision 1.36 / (download) - annotate - [select for diffs], Wed Apr 26 15:50:59 2017 UTC (7 years ago) by mikeb
Branch: MAIN
Changes since 1.35: +12 -17 lines
Diff to previous 1.35 (colored)

Perform H-FSC root queue allocation in the kernel

Since only leaf queues can have packets assigned to them,
H-FSC requires the user specified root queue to have a
parent.  To simplify userland tools and the configuration
interface, the kernel can be leveraged to set it up.

ok henning

Revision 1.35 / (download) - annotate - [select for diffs], Sun Dec 18 19:39:30 2016 UTC (7 years, 5 months ago) by jasper
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

increase width of interface column in the pf rules view by 2 chars, so that 'vetherXY' fits

ok deraadt@ mpi@

Revision 1.34 / (download) - annotate - [select for diffs], Wed Apr 13 05:25:45 2016 UTC (8 years, 1 month ago) by jasper
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.33: +1 -10 lines
Diff to previous 1.33 (colored)

remove dumpfilter related code; it's a leftover from pftop-proper and not used
in systat

ok canacar@

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jan 16 03:30:26 2016 UTC (8 years, 4 months ago) by canacar
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

fix a number of minor issues in the state view:

1. peak and rate computations were using uint32 size which caused
the fields from working for states that transferred more than 4GB
also fix an unnecessary cast to double found while looking for the bug.

2. When creating new cache entries for existing states, start time from
0 rather than the current time to prevent a "spike" in rate and peak.

Revision 1.32 / (download) - annotate - [select for diffs], Thu Aug 20 22:32:42 2015 UTC (8 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

Do not cast result of malloc/calloc/realloc* if stdlib.h is in scope
ok krw millert

Revision 1.31 / (download) - annotate - [select for diffs], Mon Feb 9 02:00:38 2015 UTC (9 years, 3 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.30: +2 -4 lines
Diff to previous 1.30 (colored)

Correct a test so synproxy states will display as "Syn" instead of
modulate states displaying as "Syn".

ok henning@

Revision 1.30 / (download) - annotate - [select for diffs], Fri Jan 16 00:03:37 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.29: +3 -2 lines
Diff to previous 1.29 (colored)

first batch of programs adapting to the namespace cleanup
(pfvar.h nameser.h proc.h ucred.h)
ok guenther millert, and some review from doug as well.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Oct 11 04:30:56 2014 UTC (9 years, 7 months ago) by doug
Branch: MAIN
Changes since 1.28: +8 -7 lines
Diff to previous 1.28 (colored)

Userland reallocarray() audit.

Avoid potential integer overflow in the size argument of malloc() and
realloc() by using reallocarray() to avoid unchecked multiplication.

ok deraadt@

Revision 1.28 / (download) - annotate - [select for diffs], Fri May 9 21:03:43 2014 UTC (10 years ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.27: +3 -1 lines
Diff to previous 1.27 (colored)

print interface name with queues in "systat q"; ok henning

Revision 1.27 / (download) - annotate - [select for diffs], Sat May 3 11:11:15 2014 UTC (10 years ago) by chl
Branch: MAIN
Changes since 1.26: +1 -4 lines
Diff to previous 1.26 (colored)

remove unused variables

ok henning@

Revision 1.26 / (download) - annotate - [select for diffs], Sat Apr 26 11:28:49 2014 UTC (10 years ago) by sthen
Branch: MAIN
Changes since 1.25: +15 -15 lines
Diff to previous 1.25 (colored)

fix whitespace

Revision 1.25 / (download) - annotate - [select for diffs], Sat Apr 26 11:27:23 2014 UTC (10 years ago) by sthen
Branch: MAIN
Changes since 1.24: +2 -6 lines
Diff to previous 1.24 (colored)

Only remove queues from the TAILQ when the ticket changes; fixes PPS/BPS
displays for queues in "systat q". From Arto Jonsson.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Apr 18 11:36:06 2014 UTC (10 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.23: +3 -357 lines
Diff to previous 1.23 (colored)

no more altq

Revision 1.23 / (download) - annotate - [select for diffs], Tue Feb 11 01:07:21 2014 UTC (10 years, 3 months ago) by pelikan
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.22: +7 -3 lines
Diff to previous 1.22 (colored)

Stop leaking megabytes of memory at every queue refresh.

ok krw

Revision 1.22 / (download) - annotate - [select for diffs], Sun Jan 19 23:45:34 2014 UTC (10 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.21: +211 -26 lines
Diff to previous 1.21 (colored)

newqueue support for the queue view, code mostly from pfctl. lifting done
by Arto Jonsson <ajonsson at kapsi dot fi>, many thanks!

Revision 1.21 / (download) - annotate - [select for diffs], Sat Oct 12 12:17:32 2013 UTC (10 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

adopt to queueing changes

Revision 1.20 / (download) - annotate - [select for diffs], Thu Oct 13 18:32:30 2011 UTC (12 years, 7 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.19: +89 -41 lines
Diff to previous 1.19 (colored)

Teach some userland tools about NAT64. I think this is mostly from mikeb@
OK mcbride@

Revision 1.19 / (download) - annotate - [select for diffs], Tue Apr 5 15:07:46 2011 UTC (13 years, 1 month ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.18: +1 -3 lines
Diff to previous 1.18 (colored)

the tree builds better when you don't use PF_FASTROUTE
ok henning@ mikeb@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Mar 2 06:48:17 2011 UTC (13 years, 2 months ago) by jasper
Branch: MAIN
Changes since 1.17: +37 -39 lines
Diff to previous 1.17 (colored)

- use a common FIELD_ADDR macro, instead of rolling 78 identical copies.

ok canacar@

Revision 1.17 / (download) - annotate - [select for diffs], Sun Feb 6 05:20:25 2011 UTC (13 years, 3 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.16: +1 -4 lines
Diff to previous 1.16 (colored)

Remove duplicated prototypes.
ok miod@

Revision 1.16 / (download) - annotate - [select for diffs], Thu Oct 28 16:08:10 2010 UTC (13 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.15: +5 -5 lines
Diff to previous 1.15 (colored)

cleanup ;;

Revision 1.15 / (download) - annotate - [select for diffs], Thu Jul 22 12:33:29 2010 UTC (13 years, 10 months ago) by giovanni
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.14: +11 -6 lines
Diff to previous 1.14 (colored)


Let systat -N states resolve network addresses
help and ok sthen@ lum@
ok canacar@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Nov 23 21:30:14 2009 UTC (14 years, 5 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.13: +1 -4 lines
Diff to previous 1.13 (colored)

no more natpass

Revision 1.13 / (download) - annotate - [select for diffs], Tue Jul 14 17:58:14 2009 UTC (14 years, 10 months ago) by jsg
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

use static for inline so compilers with c99 inline semantics
generate the same linkage as those with c89 semantics.

ok sthen@

Revision 1.12 / (download) - annotate - [select for diffs], Wed Jun 10 03:42:58 2009 UTC (14 years, 11 months ago) by canacar
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.11: +3 -4 lines
Diff to previous 1.11 (colored)

Revert part of the earlier commit that displayed garbage instead of
the action column values. reported by jmc@

Revision 1.11 / (download) - annotate - [select for diffs], Thu Apr 23 12:58:44 2009 UTC (15 years ago) by henning
Branch: MAIN
Changes since 1.10: +7 -5 lines
Diff to previous 1.10 (colored)

sync actiontypes (pass, block etc) with pfvar so that match rules are
displayed correctly (actually thsi was out of sync for more than just match)
From: Craig Barraclough <craigba at afnsecurity dot com>

Revision 1.10 / (download) - annotate - [select for diffs], Mon Apr 6 12:08:26 2009 UTC (15 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.9: +2 -18 lines
Diff to previous 1.9 (colored)

scrub rules gone

Revision 1.9 / (download) - annotate - [select for diffs], Sat Apr 4 03:29:53 2009 UTC (15 years, 1 month ago) by canacar
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Fix the byte order of the rule field in state view.
Reported by Kamil Mielcarek

Revision 1.8 / (download) - annotate - [select for diffs], Thu Jan 1 22:50:39 2009 UTC (15 years, 4 months ago) by mcbride
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.7: +12 -6 lines
Diff to previous 1.7 (colored)

Unclutter 'systate rules' by printing the flags option using the minimal
pf.conf syntax (flags S/SA is implicit).

ok henning canacar

Revision 1.7 / (download) - annotate - [select for diffs], Wed Nov 5 15:48:44 2008 UTC (15 years, 6 months ago) by canacar
Branch: MAIN
Changes since 1.6: +11 -6 lines
Diff to previous 1.6 (colored)

Fix some function prototypes, remove unused variables and commented out code

Revision 1.6 / (download) - annotate - [select for diffs], Wed Oct 8 15:11:13 2008 UTC (15 years, 7 months ago) by canacar
Branch: MAIN
Changes since 1.5: +25 -10 lines
Diff to previous 1.5 (colored)

Fix the order of traversal when printing the queues. Properly places
child queues under their respective interface root queues. Reported
by jared r r spiegel via PR 5861.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Sep 1 23:30:08 2008 UTC (15 years, 8 months ago) by sthen
Branch: MAIN
Changes since 1.4: +8 -2 lines
Diff to previous 1.4 (colored)

Display direction In/Out/Any for rule display, not just In/Out.
ok canacar@

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jul 16 10:23:39 2008 UTC (15 years, 10 months ago) by canacar
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.3: +58 -354 lines
Diff to previous 1.3 (colored)

Cleanup #define maze leftover from pftop compatibility.
Pointed out by mcbride@, makes sense henning@

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jun 29 08:42:15 2008 UTC (15 years, 10 months ago) by mcbride
Branch: MAIN
Changes since 1.2: +15 -15 lines
Diff to previous 1.2 (colored)

Simplify state creation code; merge state import/export code between pfsync
and the state-related pf(4) ioctls, and make functions in state creation and
destruction paths more robust in error conditions.

All values in struct pfsync_state now in network byte order, as with pfsync.

testing by david
ok henning, systat parts ok canacar

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jun 13 23:47:17 2008 UTC (15 years, 11 months ago) by canacar
Branch: MAIN
Changes since 1.1: +1 -2 lines
Diff to previous 1.1 (colored)

Do not print a warning if /dev/pf can not be opened.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Jun 12 22:26:01 2008 UTC (15 years, 11 months ago) by canacar
Branch: MAIN

New display engine for systat, based on pftop. Adds new views for pf
(status, state, rule, queue). While all displays work, some keyboard
comands are not implemented yet. Other features include better handling
of display resize and scrolling for long views. Committing now to fix
the remaining issues in the tree.
Testing and comments by otto@ and harding@, ok deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.