LNST-project / lnst

Linux Network Stack Test
GNU General Public License v2.0
73 stars 33 forks source link

Dependencies linux #332

Open Axonis opened 1 year ago

Axonis commented 1 year ago

Description

Using LNST as dependency when you only require PerfResult structure / importing LRC files it is not required to be installing and using ethtool / pyroute2 dependencies, which are netlink specific - meaning linux specific.

There are multiple LNST users and developers that are not actively using Linux distros and it would simplify working with LNST as dependency.

Tests

8351283

Reviews

@LNST-project/lnst-developers

Closes: #331

Axonis commented 1 year ago

Have you tried platform-specific imports e.g. https://stackoverflow.com/a/41097342 ?

I guess it broke static analysis?

I thought about it, but there are no alternatives on darwin kernel that would be just "plug-and-play".

I am just trying to make LNST work in minimal sense so that darwin kernel is able to load LRC files mostly, not to make it fully functional as that would require quite a lot of effort for minimal to no gain as LNST is currently only being utilized by Linux specific server setups.

Also I don't see this happening on Windows NT kernel as there are just way too many references to underlaying system (being linux based), which would break and had to be rewritten to support multiple platforms. Instead I am leveraging FreeBSD properties of Darwin, which allow us to get it somewhat functional.

Finally, we already added somewhat of a lazy loading of imports/dependencies at the time of their need/utilization, instead of being always present and this goes along with that idea.

Axonis commented 1 year ago

Tests are passing, SimpleNetwork, L2TP and MPTCP all seem to work after the changes.