Commit graph

14 commits

Author SHA1 Message Date
Thomas Weißschuh
54a0643829 lsfd: make a few structs const 2023-01-23 13:52:00 +01:00
Karel Zak
91a484feba lsfd: remove strcpy(), keep things based on sizeof()
* use safe xstrncpy() rather than strcpy()
* use sizeof() for static buffers rather than macro with real size
  (this solution is more robust for future code changes)
* use xcalloc() to zeroize allocated memory

Signed-off-by: Karel Zak <kzak@redhat.com>
2023-01-20 15:20:55 +01:00
Thomas Weißschuh
7578e03f12 sysfs: sysfs_get_byteorder: add context parameter
This can be used to read the file /sys/kernel/cpu_byteorder from an
alternative root-directory.
2022-11-25 19:21:45 +01:00
Thomas Weißschuh
db79a10027 lsfd: use runtime byteorder 2022-11-25 19:20:32 +01:00
Thomas Weißschuh
006612cdf4 fileeq/lsfd: use correct format specifier 2022-11-22 14:57:17 +01:00
Masatake YAMATO
58d2f31eb0 lsfd: unify the code for reading /proc/net/tcp and udp
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2022-10-26 12:01:37 +09:00
Masatake YAMATO
b49529f06f lsfd: make the logic for verifying the initial line of /proc/net/{tcp,udp} more flexible
The format of /proc/net/udp was changed in
6c25449e1a32 ("net: udp: fix alignment problem in udp4_seq_show()").
This kind of change can be applied to /proc/net/tcp, too.

Co-Authored-by: Thomas Weißschuh <thomas@t-8ch.de>
Co-Authored-by: Masatake YAMATO <yamato@redhat.com>
2022-10-26 11:56:00 +09:00
Karel Zak
15ce5b753b lsfd: fix compiler warning [-Werror,-Wextra-semi]
isc-utils/lsfd-sock-xinfo.c:588:34: error: extra ';' outside of a function [-Werror,-Wextra-semi]
define_fill_column_func(tcp, TCP);
                                 ^
misc-utils/lsfd-sock-xinfo.c:703:34: error: extra ';' outside of a function [-Werror,-Wextra-semi]
define_fill_column_func(udp, UDP);
                                 ^
Addresses: 92a0dbce7c
Signed-off-by: Karel Zak <kzak@redhat.com>
2022-10-21 14:23:50 +02:00
Masatake YAMATO
92a0dbce7c lsfd: use extra information loaded from /proc/net/udp
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2022-10-20 05:15:09 +09:00
Masatake YAMATO
7b2a9be00e lsfd: use extra information loaded from /proc/net/tcp
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2022-10-02 05:41:37 +09:00
Masatake YAMATO
b36499456b lsfd: cosmetic change, delete whitespaces 2022-10-02 05:18:20 +09:00
Masatake YAMATO
45d61bffb2 lsfd: add SOCKLISTENING column
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2022-10-02 05:16:54 +09:00
Masatake YAMATO
2e38e61ca6 lsfd: use extra information loaded from /proc/net/unix
The loaded information is displayed at SOCKNETNS, SOCKSTATE,
SOCKTYPE, and/or UNIX.PATH columns of UNIX-STREAM and UNIX
typed sockets.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2022-09-24 21:10:22 +09:00
Masatake YAMATO
0ee16e4334 lsfd: facilitate the way to attach extra info loaded from /proc/net/* to sockets
Files under /proc/net/ like unix, tcp, udp, etc. provides extra
information about sockets. To unitize these information in
lsfd, this change adds stub for loading the information form
/proc/net/* and attaching it to struct file presenting sockets.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2022-09-24 21:09:05 +09:00