Provide NetworkInterface and NetworkInterfaceCollection classes#452
Draft
christophruethingbmw wants to merge 1 commit into
Draft
Provide NetworkInterface and NetworkInterfaceCollection classes#452christophruethingbmw wants to merge 1 commit into
christophruethingbmw wants to merge 1 commit into
Conversation
Today we just have a loose collection of functions to handle LwIP network interfaces. This does not feel like a nice interface to use and when using it the first time I had to do quite some research on which LwIP functions are already called through abstractions and which ones I still have to call directly. This change tries to introduce an easy to use class based abstraction of a LwIP interface and also provide a collection of interfaces with some logic to properly route frames to the matching interface based on its VLAN ID.
2b5df56 to
cdbd9cf
Compare
Contributor
Author
|
Converted to draft, there will be a more extensive discussion on how to provide a proper abstraction which also supports all the features and corner cases we need and already know about. Results will then be documented here or in a separate issue once the discussion progresses. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Today we just have a loose collection of functions to handle LwIP network interfaces. This does not feel like a nice interface to use and when using it the first time I had to do quite some research on which LwIP functions are already called through abstractions and which ones I still have to call directly.
This change tries to introduce an easy to use class based abstraction of a LwIP interface and also provide a collection of interfaces with some logic to properly route frames to the matching interface based on its VLAN ID.
Note, that this PR just provides the implementation not yet used in the reference application. We should first do a review to agree on it in general and can then refactor existing implementations to use the new one. For example, the current reference application already has a similar idea of a
Netifsstruct but less object oriented and not generically usable.Also the driver interface is something we might need to discuss on in another follow-up on how BSP interfaces are done in OpenBSW.
An example on how to use this can look like shown below. The ethernet system just needs to hold a single member
_interfacesand call the proper methods, I think from perspectiv of somebody integrating this in his/her own system, this feels convenient and straight forward to use?