All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Wagner <wagi@monom.org>
To: ell@lists.01.org
Subject: [PATCH 0/2] Import rntlutil from iwd
Date: Fri, 14 Feb 2020 17:33:26 +0100	[thread overview]
Message-ID: <20200214163328.17647-1-wagi@monom.org> (raw)

[-- 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

             reply	other threads:[~2020-02-14 16:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 16:33 Daniel Wagner [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200214163328.17647-1-wagi@monom.org \
    --to=wagi@monom.org \
    --cc=ell@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.