49 Commits

Author SHA1 Message Date
Thomas Graf
a0eea59519 netlink: BUG() if we don't have parent information
This would indicate that we hang a TC object to the tree root.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2015-12-16 15:40:58 +01:00
Thomas Graf
f9c714fa15 netlink: Use ifindex of parent TC object when searching leaf qdiscs
The qdisc cache is host wide, the parent classid is not unique
so the ifindex of the parent tc object must be set in the filter
otherwise a leaf qdisc with an identical parent id in another
device can be mistaken.

This also converts the class_cache to be passed up through the
stack to make clear it is not system wide but specific to the
ifindex we are currently handling.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2015-12-16 15:36:03 +01:00
Thomas Graf
892bdac762 bmon: Mark attr_def_free() and __lookup_element() static
Fixes sparse warnings:
attr.c:114:6: warning: symbol 'attr_def_free' was not declared. Should it be static?
element.c:116:16: warning: symbol '__lookup_element' was not declared. Should it be static?

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2015-12-16 14:10:43 +01:00
Thomas Graf
4488cd03f9 bmon: Properly pass NULL pointers instead of 0
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2015-12-16 14:09:35 +01:00
Thomas Graf
753a9e09dd bmon: Remove dead code and make sig_exit() static
Fixes sparse warnings:
bmon.c:36:5: warning: symbol 'do_quit' was not declared. Should it be static?
bmon.c:37:5: warning: symbol 'is_daemon' was not declared. Should it be static?
bmon.c:91:12: warning: symbol 'sig_int' was not declared. Should it be static?
bmon.c:98:6: warning: symbol 'sig_exit' was not declared. Should it be static?

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2015-12-16 14:04:14 +01:00
Thomas Graf
0641291ad5 curses: Pass in proper NULL pointer
Fix sparse warning:
out_curses.c:433:25: warning: Using plain integer as NULL pointer

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2015-12-16 14:01:51 +01:00
Thomas Graf
f666ffd0b7 curses: Make float2str static
Fix sparse message:
out_curses.c:140:6: warning: symbol 'float2str' was not declared. Should it be static?

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2015-12-16 14:00:39 +01:00
Thomas Graf
559e31e62f Merge pull request #30 from tklauser/ip6-link-stats
Add additional IPv6 link stats
2015-11-15 18:09:42 -08:00
Tobias Klauser
665c63d4e7 Add additional IPv6 link stats
Hook up additional IPv6 link statistics counters available since libnl
v3.2.25. Also add compatibility defines, so bmon can still be compiled
against older libnl versions.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2015-08-06 15:20:07 +02:00
Thomas Graf
e31a860af6 Update copyright
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2015-07-25 11:05:01 +02:00
Thomas Graf
2027a634a7 netlink: Only disable TC stats if QoS is not available in kernel
Up to now, the entire Netlink module was disable if QoS statistics were
not available. Merely disable TC stats themselves but continue using
the input module.

Reported-by: Wen Chiu <Wen.Chiu@brocade.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2015-07-25 10:51:47 +02:00
Thomas Graf
21ec49ed67 format: Don't print error message for unavailable attributes
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2015-06-30 11:59:48 +02:00
Chocobo1
51a24c315b Fix wrong unit displayed when using "--use-bit" option 2015-05-31 21:27:52 +08:00
Chocobo1
5cecc86856 Fix inconsistency in format module example 2015-05-31 18:53:35 +08:00
Tobias Klauser
c80554be16 Explicitly include linux/if.h to fix cross-compile error
When compiling bmon with the Linaro 2014.01 ARM toolchain
(gcc-linaro-arm-linux-gnueabihf-4.8-2014.01_linux) the following compile error occurs:

  in_netlink.c: In function ‘do_link’:
  in_netlink.c:688:53: error: ‘IFF_UP’ undeclared (first use in this function)

Fix it by explicitly including linux/if.h, where IFF_UP is defined.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2015-04-30 12:00:35 +02:00
Chocobo1
229d58c975 using cfg_setint is triggering an assertion in confuse library, should use cfg_setbool instead 2015-01-19 20:02:14 +08:00
Thomas Graf
0100916a95 BSD: Provide minimal interface information
Including:
 - MTU
 - Metric
 - RX/TX IRQ Quota

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-12-16 18:31:27 +01:00
Thomas Graf
4492ab547c build: Enable -Wall
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-25 01:07:19 +02:00
Thomas Graf
a36136ec4d Annotate unused variables
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-25 01:07:19 +02:00
Thomas Graf
e3d208905d Initialize t to silence uninit warning
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-25 01:07:19 +02:00
Thomas Graf
68bd14ffd1 Remove unused write_column() function
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-25 01:07:19 +02:00
Thomas Graf
e2df502abc Remove unused variables
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-25 01:07:19 +02:00
Thomas Graf
9d89c5bc8e curses: Handle out of memory return value of of vasprintf()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-24 22:11:32 +02:00
Thomas Graf
584ef44252 proc: Silence warning of unhandled fgets() return value
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-24 22:11:02 +02:00
Thomas Graf
41e36f2a66 element: Remove unneeded condition, element is always member of group
Fixes: CID 49003
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-24 20:52:53 +02:00
Thomas Graf
ccf33755ad utils: Fix copy_timestamp() accuracy
Fixes: CID 49000
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-24 20:51:00 +02:00
Thomas Graf
3cff7715ce curses: Check if value is provided for ngraph
Fixes: CID 49001
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-24 20:48:12 +02:00
Thomas Graf
22c83ceb1a proc: Fix leakage of fd if element lookup failed
Fixes: CID 49002
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-24 20:44:53 +02:00
Thomas Graf
6eae8530c5 Fix uint64_t printf modifiers
Reported by clang. Repo compiles cleanly with clang at this point.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-24 14:55:27 +02:00
Thomas Graf
afb5db14c8 curses: Fix '?' to toggle quick help
Previously, pressing '?' only made the quick help appear but not
disappear again.

Reported-by: Bill [github id "broomdodger"]
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-08-24 14:05:42 +02:00
Žilvinas Valinskas
f7df93bcd3 bmon: unlink list element from list before xfree() 2014-07-20 23:56:07 +03:00
Thomas Graf
be8ef18b74 conf: Read global config from $(sysconfdir)/bmon.conf
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-07-06 13:33:12 +02:00
Žilvinas Valinskas
ef4e488b2f Fix spelling.
Signed-off-by: Žilvinas Valinskas <zilvinas.valinskas@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-06-05 12:04:34 +02:00
Žilvinas Valinskas
ee98b9ea30 osx: fix remaining compiler warnings
Signed-off-by: Žilvinas Valinskas <zilvinas.valinskas@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-06-02 15:03:26 +02:00
Žilvinas Valinskas
852008c4ae osx: read interfaces, counters & etc.
Signed-off-by: Žilvinas Valinskas <zilvinas.valinskas@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-06-02 15:03:23 +02:00
Žilvinas Valinskas
22b13d2506 osx: Import src/in_sysctl.c from bmon v2.0.1.
Signed-off-by: Žilvinas Valinskas <zilvinas.valinskas@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-06-02 15:03:19 +02:00
Žilvinas Valinskas
c62eb9de44 osx: bmon v3.2 compiles and links
Signed-off-by: Žilvinas Valinskas <zilvinas.valinskas@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-06-02 15:03:14 +02:00
Thomas Graf
deb1cd2aba unit: Do not cache unit divisor list result
Now that we support multiple divisor variants caching no longer makes sense

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-05-08 15:30:10 +02:00
Thomas Graf
fd461f6568 curses: only initialize curses module if actually being used
Fixes display problems with plain ascii output

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-05-08 15:22:00 +02:00
Thomas Graf
46ec101b00 Add -b / --use-bit option to display rates in bit/s instead of bytes/s
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-05-08 15:16:38 +02:00
Thomas Graf
d3a53dc1c1 conf: Correctly terminate default config with CFG_END()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-05-08 10:57:23 +02:00
Thomas Graf
e0efec0c42 ascii: Initialize prec variables
Ensure that branching does not leave behind uninitialized variables

Reported-by: dcb314
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2014-05-06 15:01:53 +02:00
Thomas Graf
164584b6f5 Merge pull request #8 from valinskas/zv/bmon-sigsegv
Fixes 'bmon -i dummy:randomize' SIGSEGV
2014-05-06 14:56:17 +02:00
Žilvinas Valinskas
aa1542cd98 Fixes 'bmon -i dummy:randomize' SIGSEGV
Reverse 'value' and 'type' parameters order in dummy_parse_opt()
function.
2014-05-01 10:07:27 +03:00
Andrew McCarthy
bb3b4c4b2c Fix spelling of Packets. 2014-04-30 09:46:46 +01:00
Dmitry Smirnov
bdd621e80f man page corrections (lintianisation) + spelling:
* hyphen-used-as-minus-sign
 * spelling-error-in-binary usr/bin/bmon childs children
2013-10-05 14:46:05 +10:00
Thomas Graf
509d64bd18 module: Support auto enabling and enforce single registration of module
Enforces a single registration of a module with a subsystem.
module_register() now returns -EBUSY if module is already
registered.

Adds support for BMON_MODULE_AUTO to flag modules that should
be autoloaded upon the first call to module_set(). Loading
will succeed if the probe() function succeeds.
2013-07-13 13:05:20 +02:00
Thomas Graf
2c047d2af3 curses: Use RARROW to mark selected item 2013-07-13 12:48:37 +02:00
Thomas Graf
3be703f67d Initial import 2013-07-05 15:11:46 +02:00