public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/3] Netlink helper functions refactoring
@ 2023-10-13 15:17 Martin Doucha
  2023-10-13 15:17 ` [LTP] [PATCH 1/3] tst_rtnetlink: Refactor helper function for generic use Martin Doucha
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Martin Doucha @ 2023-10-13 15:17 UTC (permalink / raw)
  To: ltp

Let's refactor the rtnetlink helper functions for generic use where possible.
The Netlink context structure can be used for other Netlink protocols like
NETLINK_CRYPTO or NETLINK_NETFILTER. One of the exceptions is
the NETLINK_KOBJECT_UEVENT protocol which returns raw data without the usual
headers.

The first patch replaces the tst_rtnl_* and RTNL_* prefix with tst_netlink_*
and NETLINK_* respectively to signify that the functions can be used
for generic netlink communication. The attribute handling functions are
specific to the NETLINK_ROUTE protocol so they keep the old prefix.

The last patch then replaces old netlink send/receive helper functions
with the context-based helpers in crypto test code.

Coming soon is a new netfilter CVE test which will also use the refactored
code.

Martin Doucha (3):
  tst_rtnetlink: Refactor helper function for generic use
  tst_netlink_destroy_context(): Allow safely passing NULL context
  crypto: Replace old netlink helper functions with netlink contexts

 doc/network-c-api.txt                   | 159 +++++++++++-----------
 include/tst_crypto.h                    |  67 +---------
 include/tst_netdevice.h                 |   2 +-
 include/tst_netlink.h                   | 171 ++++++++++++++----------
 include/tst_rtnetlink.h                 | 108 ---------------
 lib/tst_crypto.c                        |  90 +++----------
 lib/tst_netdevice.c                     |  95 ++++++-------
 lib/{tst_rtnetlink.c => tst_netlink.c}  |  88 ++++++------
 testcases/cve/tcindex01.c               |   4 +-
 testcases/kernel/crypto/crypto_user01.c |  58 +++-----
 testcases/kernel/crypto/crypto_user02.c |  17 +--
 testcases/kernel/crypto/pcrypt_aead01.c |  10 +-
 12 files changed, 331 insertions(+), 538 deletions(-)
 delete mode 100644 include/tst_rtnetlink.h
 rename lib/{tst_rtnetlink.c => tst_netlink.c} (77%)

-- 
2.42.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-11-13 15:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-13 15:17 [LTP] [PATCH 0/3] Netlink helper functions refactoring Martin Doucha
2023-10-13 15:17 ` [LTP] [PATCH 1/3] tst_rtnetlink: Refactor helper function for generic use Martin Doucha
2023-10-24  8:41   ` Petr Vorel
2023-10-13 15:17 ` [LTP] [PATCH 2/3] tst_netlink_destroy_context(): Allow safely passing NULL context Martin Doucha
2023-10-24  8:56   ` Petr Vorel
2023-10-13 15:17 ` [LTP] [PATCH 3/3] crypto: Replace old netlink helper functions with netlink contexts Martin Doucha
2023-11-13 15:40   ` Petr Vorel
2023-10-24  8:35 ` [LTP] [PATCH 0/3] Netlink helper functions refactoring Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox