Attention is currently required from: laforge.
pespin has posted comments on this change. (
https://gerrit.osmocom.org/c/libosmocore/+/31025 )
Change subject: Introduce tundev API
......................................................................
Patch Set 12:
(1 comment)
Patchset:
PS12:
but I don't really understand why
adding/setting/removing addresses etc. is constrainted to tun-devices. We have the same
task for other net-devices, such as for example the GTP devices.
So IMHO, there should be a generic API to perform those operations on any type of netdev
(either by ifindex or name).
I am simply keeping those generic functions acting on interfaces private for now, but well
separated in:
"""
static int tundev_mnl_add_addr(struct osmo_mnl *omnl, const char *dev_name, const struct
osmo_sockaddr *osa, uint8_t prefix)
static int tundev_mnl_add_route(struct osmo_mnl *omnl,
const char *dev_name,
const struct osmo_sockaddr *dst_osa,
uint8_t dst_prefix,
const struct osmo_sockaddr *gw_osa)
static int tundev_mnl_set_ifupdown(struct osmo_mnl *omnl, const char *dev_name, bool up)
"""
Same applies to gtp kernel devices or hdlc
net-devices, right?
Those would need separate objects since they have specific requirements to set up, manage,
etc. When those are added, the static functions above can be moved to a shared place and
even make a public API. I don't want to make the API public now since I'm not
working on those, and would take a lot more time to start changing all implementations of
all those devices everywhere (and the current task at hand is already requiring me to
touch a lot of stuff in lots of places).
The netns related code is als not really specific to
tun-devices, is it?
That's why I added a netns.h API in the previous commit, and the tun-device object is
simply using the API to manage the netns and do the required steps at the correct points
in time, without the user of the tundev having to care about those details.
--
To view, visit
https://gerrit.osmocom.org/c/libosmocore/+/31025
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I3463271666df1e85746fb7b06ec45a17024b8c53
Gerrit-Change-Number: 31025
Gerrit-PatchSet: 12
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Tue, 24 Jan 2023 10:40:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: comment