New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux platform functions to get network interfaces #1811
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1811 +/- ##
==========================================
+ Coverage 78.48% 78.69% +0.20%
==========================================
Files 234 234
Lines 8776 8853 +77
==========================================
+ Hits 6888 6967 +79
+ Misses 1888 1886 -2
Continue to review full report at Codecov.
|
Hey @luis4a0, I think you brought one commit too many: the first one, titled "Add platform-dependent network info interface". I thought this would be stacked on the bridging branch. This would replace the throwing platform_linux implementation and would be rebased on top of public/control. It doesn't achieve much without that anyway, right? To test bridging with vbox on Linux, one would checkout the private/control branch and merge with this one locally. Does that make sense? |
Right, stacking on top of the |
dcb9adb
to
2f7155d
Compare
I see you stacked this and dropped the repeated commit, great! |
Yes, this should work now. |
6ab0a27
to
2579004
Compare
7627b35
to
fceacc1
Compare
2f7155d
to
cb09472
Compare
fceacc1
to
1293126
Compare
cb09472
to
d689f31
Compare
fb7e6e6
to
7b1c2db
Compare
05f6082
to
a9da725
Compare
It still remains to add details on bridges.
The test is incomplete, since we still have to mock the filesystem to mimic reading from /sys.
To test virtual interfaces, the filesystem had to be mocked in order to create a structure similar to /sys. For physical interfaces, only the output of the `ip` command had to be simulated.
Move free functions to unnamed namespace. Add comments about confinement. These things were pointed out during the review of the PR.
- Made output strings look like the other platforms output; - simplified function interfaces; - add some logging.
It was read each time a physical interface was queried.
Hey @luis4a0, I am revisiting this for the LXD implementation 🙂 The first commit in this branch appears bogus – description doesn't seem to match the diff, which is later reverted. I have a rebase on master that drops that commit. If you agree, I can push? |
Go ahead! |
This PR adds the functions needed in Linux to get information about network interfaces present in the system. This will be needed to implement bridging in some backends.
Namely, this add the functions
platform::get_network_interfaces_info()
to get information about all the interfaces on the system.This code works confined, which complicates the detection of some interfaces.