All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Import rntlutil from iwd
@ 2020-02-14 16:33 Daniel Wagner
  2020-02-14 16:33 ` [PATCH 1/2] rtnl: Add initial rtnl support Daniel Wagner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Wagner @ 2020-02-14 16:33 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 1622 bytes --]

This just copies over the code from iwd. No changes there except the
prefix of the functions name.

Unfortunatly, the unit test can only test the get/dump function
because the setters need root permissions. For this we need some sort
of sandbox. Does anyone have any ideas for this?

While writing the test case I noticed some inconsistency in the naming
sceme:

The IPv6 functions are consistent in the naming sceme, always
append ipv6 after the first name:

  rtnl_ifaddr_ipv6_extract
  rtnl_ifaddr_ipv6_get
  rtnl_ifaddr_ipv6_add
  rtnl_ifaddr_ipv6_delete

  rtnl_route_ipv6_add_gateway
  rtnl_route_ipv6_delete_gateway


For the IPv4 functions it's either a plain 'ifaddr' infix or somewhere ipv4
in the name:


  rtnl_ifaddr_extract
  rtnl_ifaddr_get
  rtnl_ifaddr_add
  rtnl_ifaddr_delete

  rtnl_route_extract_ipv4
  rtnl_route_dump_ipv4

  -> drop ipv4?

  rtnl_route_ipv4_add_connected
  rtnl_route_ipv4_add_gateway

  -> drop ipv4?


And there are the setters:

  rtnl_set_linkmode_and_operstate
  rtnl_set_mac
  rtnl_set_powered


Is this the standard naming sceme?

Thanks,
Daniel

Daniel Wagner (2):
  rtnl: Add initial rtnl support
  unit: Add l_rtnl_* unit tests

 .gitignore       |   1 +
 Makefile.am      |   5 +
 ell/ell.h        |   1 +
 ell/rtnl.c       | 641 +++++++++++++++++++++++++++++++++++++++++++++++
 ell/rtnl.h       | 119 +++++++++
 unit/test-rtnl.c | 236 +++++++++++++++++
 6 files changed, 1003 insertions(+)
 create mode 100644 ell/rtnl.c
 create mode 100644 ell/rtnl.h
 create mode 100644 unit/test-rtnl.c

-- 
2.25.0

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

end of thread, other threads:[~2020-02-14 17:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-14 16:33 [PATCH 0/2] Import rntlutil from iwd Daniel Wagner
2020-02-14 16:33 ` [PATCH 1/2] rtnl: Add initial rtnl support Daniel Wagner
2020-02-14 16:33 ` [PATCH 2/2] unit: Add l_rtnl_* unit tests Daniel Wagner
2020-02-14 17:53 ` [PATCH 0/2] Import rntlutil from iwd Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.