-
Notifications
You must be signed in to change notification settings - Fork 239
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
[ncp] integrate SRP Server and Advertising Proxy for NCP #2624
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2624 +/- ##
==========================================
- Coverage 55.77% 45.88% -9.89%
==========================================
Files 87 106 +19
Lines 6890 12851 +5961
Branches 0 928 +928
==========================================
+ Hits 3843 5897 +2054
- Misses 3047 6632 +3585
- Partials 0 322 +322 ☔ View full report in Codecov by Sentry. |
315d152
to
53d7c11
Compare
500b3ab
to
5eeee35
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overll.
Couple of smaller suggestions. and one question/suggestion about key name.
name += "."; | ||
name += aKey.mServiceType; | ||
} | ||
return name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be careful here, as the first label in a "service instance name" may itself contain a dot (.
) character. So, if we construct a full name by appending the labels, it may be parsed incorrectly later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a check to only add the dot when the name doesn't contain one in the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .
can be in the middle and part of the instance name label itself (not a separator). The dot .
is generally not used (or allowed) in DNS labels, but service instance labels allow this. For example, a service instance label can be "device.1234" as a single label (.
being part of the label itself).
If we want to handle this, I can think of two options:
- Keep the first label separate and pass it as a separate "string" to all APIs (mDNS-related APIs).
- Add a new escaping mechanism so we can construct a full name as a single string, using an escape character to indicate when
.
is part of the label and not a separator.
I prefer option 1 (that's why we use this way to represent the names from the OT core).
I know this is rather tricky, so it may be fine to leave it for the future (accepting that the current code would not work with instance labels that include a .
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM! I added a comment in the code.
fa3c97b
to
b861990
Compare
b861990
to
9e20aea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
9e20aea
to
8cf6c5b
Compare
This PR integrates the mDNS Publisher with NcpHost to make advertising proxy work under NCP mode.
The PR adds an expect test to verify the advertising proxy function under NCP mode. To do the test,
avahi-browser
is used. So it's added into the bootstrap of the CI for ncp_mode.As an abstraction:
NcpSpinel::SrpServerSetEnabled
andNcpSpinel::SrpServerSetAutoEnableMode
to control the SRP server on the NCP.SPINEL_PROP_DNSSD_HOST
,SPINEL_PROP_DNSSD_SERVICE
andSPINEL_PROP_DNSSD_KEY_RECORD
to help NCP to publish the dnssd entries (by using the mDNSPublisher on the host).