netutils: add mDNS library support #3081
Open
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.
Summary
This allows an external mDNS library from here to be built as a NuttX app.
My thanks to @xiaoxiang781216 for pointing me in the direction of how to do this, based on how Vela handled it and to an example of how NuttX downlloads such libraries: so saving me the effort of porting it, as such.
The library has a "built in" example app which runs from nsh if wanted, and I have added a "daemon" wrapper to it to allow it to be started and stopped, making it more directly usable from applications. There's an example app to go with it (hence to two commits).
In an ideal world, the library should be used as just that: a library. If Kconfig is configured for that usage, the library's header file is automatically copied to apps/include/netutils during build to facilitate easier inclusion.
I have added what I hope is enough information in the Kconfig help to allow others to make use of it.
Impact
This netutil is only enabled by Kconfig so will not impact any builds that do not enable it of course. Once enabled there is no obvious impact that I can envisage as it is standalone.
Testing
I have built this with/without all Kconfig options on my custom SAMA5D27 board and it seems to behave as expected.