Commit Graph

83 Commits

Author SHA1 Message Date
Andreas Gocht-Zech
b9abb65df0 add pcap packet stats 2023-09-29 22:54:31 +02:00
Andreas Gocht-Zech
5375587282 move C-style-list to std::list 2023-09-29 22:53:59 +02:00
Andreas Gocht-Zech
9d8c92356c fix 2023-08-20 22:28:43 +02:00
Andreas Gocht-Zech
668ae29c0a add reporting of changes since last request 2023-08-20 22:07:43 +02:00
DiedByDisgust
bf44e39240 fix get_devlen function from being pointless 2023-04-22 18:02:44 -04:00
Matheus Rambo
c55a10bf26 fix: Wrong definition of "pidsToWatch" #230 2023-03-22 10:00:52 -03:00
Arnout Engelen
d30c5226a0 Format source code
It appears we have failed to run `make format` in the last few
commits. Doing it now. We should really add it to CI
2023-01-09 12:39:07 +01:00
a1346054
56c9348372 Trim trailing whitespace 2022-10-13 00:05:35 +00:00
a1346054
22c43c5523 Fix typo 2022-10-13 00:05:35 +00:00
a1346054
aefa6cf194 Use s instead of sec for units of seconds 2022-10-12 23:55:29 +00:00
yingzhang
4c30af3b9c Add -std=c++14 for application build 2022-07-25 18:27:19 +08:00
Elie Huvier
a9258d10f4 Additional capabilities required
Specify additional capabilities in main.cpp (error message and comment),
and in man page.
2022-07-10 05:26:51 +08:00
Zev Weiss
79ccaf8e97 Hide cursor during initialization and restore at exit
Showing the cursor while running (especially on terminals where it
blinks) is a bit visually distracting, and doesn't serve much purpose;
make it invisible in init_ui() and restore the original state in
exit_ui().
2022-06-21 02:37:17 -07:00
Tom Sullivan
7efef02370 Add -std=c++14 for application build
To address:

  https://github.com/raboof/nethogs/issues/225

add the `-std=c++14` flag when building the application.

This then compiles properly with the Apple version of the Clang
compiler:

  Apple clang version 11.0.0 (clang-1100.0.33.17)

Additionally, this removed some warning noise regarding C++11
extensions used without the appropriate `-std=c++11` (or greater)
flag:

  ./process.h:38:26: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
  connection.cpp:107:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
  connection.cpp:108:8: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
  connection.cpp:162:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
  connection.cpp:187:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
2022-06-16 13:49:16 +10:00
Vladimir Panteleev
92fb73116a Replace ConnList linked list with multiset
Keeping a sorted multi-set allows faster search by source /
source+destination address.

Fixes O(n^2) complexity when handling a lot of connections (now it's
O(n log n)).
2022-03-23 17:28:09 +00:00
Vladimir Panteleev
f46954525d packet: Fix matchSource not checking address family 2022-03-23 01:57:45 +00:00
jimmylomro
fcacd7efdb added nethogsmonitor_loop_devices and moved code to python dir 2022-03-16 18:58:28 +00:00
jimmylomro
257b576221 add python bindings 2022-03-15 21:35:11 +00:00
Matheus Rambo
cabc2a1ea3 feat: Filter by process #217
It is possible to filter by process id!
Add the -P <pid> flag.
Example: `nethogs -P 123 -P 333` to filter the processes: 123 and 333
2022-02-28 21:00:11 -03:00
Matheus Rambo
b94cd9f227 feat: Add basename support
Now, the user can decide to show only the program name, instead of the
full program path. It is useful, when you have a very long hierarchy of
directories, which, with the full path name, the user might not see the
program name.
2021-12-22 10:01:00 -03:00
Matheus Rambo
82a30bb644 refactor: Change bughunt mode to 'x' 2021-12-22 09:58:45 -03:00
Naïm Favier
afb5759cc3 Disable capability check, handle failure better
Fixes #214
2021-12-02 14:04:08 +01:00
kretcheu
455daf357d Fix compilation error with [-Werror=format-security]
When compiling with [-Werror=format-security] in Debian packaging occurs this error:
```
cui.cpp: In function ‘void show_ncurses(Line**, int)’:                                          
cui.cpp:377:73: error: format not a string literal and no format arguments [-Werror=format-security]
  377 |   mvprintw(3 + 1 + i, cols - COLUMN_WIDTH_UNIT, desc_view_mode[viewMode]);              
      |                                                                         ^               
cui.cpp:379:29: warning: zero-length gnu_printf format string [-Wformat-zero-length]            
  379 |   mvprintw(totalrow + 1, 0, "");                                                        
      |                             ^~      
```

This patch solve the problem.

[]'s
kretcheu
2021-10-09 16:37:10 -03:00
Kondo Takeo
8b2c55c3f3 Fix log message. 2021-02-17 23:13:50 +09:00
Kondo Takeo
b97fb4cfdf Issue: #96 - Garbage collect inodeproc once every 50 ui refresh as default.
- Reduce default frequency to avoid performance issue.
- The frequency of it can be modified with `-g` option
  and can be disabled with `-g 0`.
2021-02-17 23:02:27 +09:00
takeoverjp
12dbf5e28a Update src/inode2prog.cpp
Co-authored-by: Arnout Engelen <arnout@engelen.eu>
2021-02-17 22:31:21 +09:00
Kondo Takeo
0a54596bc6 Issue: #96 - Garbage collect inodeproc on each ui refresh. 2021-02-16 22:42:47 +09:00
Kondo Takeo
a4d2e550cb Fix typo in help message. 2021-02-05 22:39:01 +09:00
Kondo Takeo
b7a42786bd Issue: #62 - Fix conninode_test. 2021-02-05 00:12:21 +09:00
Kondo Takeo
18629a3b33 Issue: #62 - Treat unlisted traffic as 'unknown UDP/TCP' 2021-02-04 23:43:29 +09:00
Kondo Takeo
ccda1b50c4 Issue: #62 - Parse udp proc only when catchall mode. 2021-02-04 23:35:52 +09:00
Kondo Takeo
e024d3eb33 Issue: #62 - UDP support 2021-02-04 00:31:40 +09:00
Aaron France
a3f0586ef8 fix: Expose to_ms / packet buffer timeout to libnethogs 2019-10-01 00:24:04 +02:00
Andreas Wieland
9ccb3538db Issue: #176 - removes exit in inode2prog:
* removes the exit calls in inode2prog which was called if an error
occured while reading /proc/<pid>/cmdline file. Instead an Exception is
thrown with an error message
* adds catch block for all exception while reading cmdline file
2019-06-24 11:51:18 +02:00
Andreas Wieland
2cd523868d run make format with clang-format:
* reformats the repo as adviced in the readme
2019-06-12 15:00:40 +02:00
Andreas Wieland
9dc99c9e14 fixes issues #144, #145:
* adds a try catch block surrounding read_file in the method getcmdline.
  To avoid crashes if a pid is removed while reading was not finished.
2019-06-12 14:38:27 +02:00
Peter M. Petrakis
677baffe6a Add MB/s and GB/s view modes
- Refactored units presentation into a lookup table
- Other minor refactoring
- Updated man page
- Cleaned up trailing white space in the vicinity
2018-12-03 13:55:54 -05:00
d4ryus
51ccf42cea Fix libnethogs handle memory leak
Calling nethogsmonitor_loop, canceling it with nethogsmonitor_breakloop
and then calling it again will lead to a Segmentation fault.

This is due to handles not getting reset to NULL which leads to a
invalid list since the old list will be reused by

  new handle(newhandle, current_dev->name, handles);

in nethogsmonitor_init(). If handles is reset to NULL it will also
remove the only reference to the old list, hence it should be freed to
avoid memory leaks.

This change will reset handles to NULL after freeing all handles when
nethogsmonitor_clean_up is called.
2018-11-11 11:31:44 +01:00
PAVAN
b32ae097ce unknown udp added... 2018-05-18 20:22:44 +05:30
PAVAN
2a1e068dee added unknown udp.... 2018-05-18 19:45:07 +05:30
PAVAN
9baa4aaf34 unknown udp added... 2018-05-15 21:34:29 +05:30
PAVAN
a251024bff fixes issue #110 - dynamic DEV column length, MIN=5, MAX=15 2018-05-03 19:46:48 +05:30
PAVAN
0984d92d90 fixes issue #110 - dynamic DEV column length, MIN=5, MAX=15 2018-05-03 19:12:06 +05:30
PAVAN
5e2763d40f fixes issue #110 - DEV colum length to 15 2018-05-02 00:05:54 +05:30
Arnout Engelen
7093964413 Merge pull request #137 from jantman/issues/29
fixes #29 - change all sent/recv counters from int32 to int64 to prevent wraparound
2017-08-27 16:54:43 +02:00
Jason Antman
2a2ce7c909 fixes #29 - change all sent/recv counters from int32 to int64 to prevent wraparound 2017-08-27 10:46:21 -04:00
Jason Antman
76ced1b8d8 issue #119 - add warnings about capture filter being experimental 2017-08-27 10:37:13 -04:00
Jason Antman
7f02b84ced fixes #119 - add support for pcap capture filters 2017-08-27 09:07:44 -04:00
Arnout Engelen
e5455240c9 Merge pull request #134 from jantman/issues/129
fixes #129 - libnethogs support for limiting to specific devices
2017-08-27 13:49:52 +02:00
Jason Antman
a7c14c842a fixes #129 - libnethogs support for limiting to specific devices 2017-08-26 15:34:30 -04:00