-
Notifications
You must be signed in to change notification settings - Fork 54
feat: new API to use ResolvedService instead of ServiceInfo for resolved service event #362
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
Conversation
I guess we also should consider updating the query example to use the new proposed API. |
I've updated the query example. |
Can we make the struct |
modify query example to use the new ServiceDetailed
eab38af
to
2ebc146
Compare
Exported |
Thanks, I was maybe a bit imprecise on which direction the trait goes. I wanted to implement a |
src/dns_parser.rs
Outdated
HostIp::V4(v4) => write!(f, "{}", v4.addr), | ||
HostIp::V6(v6) => { | ||
if v6.scope_id.index != 0 { | ||
write!(f, "{}%{}", v6.addr, v6.scope_id.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.
I'm not sure whether address%index would be more feasible, as for example Windows does not use interface names but rather an interface index as a scope id.
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.
I've updated it to use index
. For myself reference: RFC 4007 section 11.3
@oysteintveit-nordicsemi may I ask you help review the changes to This is a breaking change for |
Hello, this is @oysteintveit-nordicsemi from my non-work account, thank you for reaching out! I no longer work there so I don't have access to the code, but I can have a look at it and see if I can tell from memory. I currently don't have access to a computer either (not until next week), but I had a quick skim through the diff and if the only thing that changed is the wrapping struct and the address inside is still accessible to the library user in some way, I think it'll be fine 😁 |
@h7x4 thank you! I appreciated that. |
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.
I had a closer look today, the changes look good to me. Thank you for providing the to and from functions for HostIp
and IpAddr
, that should make it easy to migrate :)
Pinging @michaeljones for a heads up
This is to address issue #358. The basic approach is:
ServiceEvent::ServiceResolved
event, which returnsServiceInfo
.ServiceEvent::ServiceDetailed
to returnResolvedService
. UpdateResolvedService.addresses
to beHashSet<HostIp>
, whereHostIp
is a wrapper ofIpAddr
that includesscope_id
for IPv6 addresses.To opt in to receive
ServiceEvent::ServiceDetailed
instead ofServiceEvent::ServiceResolved
, the user would callServiceDaemon::use_service_detailed(true)
of its client daemon.So, in short, to use IPv6 address with scope (interface id), one needs to use the new
ServiceDetailed
event andResolvedService
struct instead ofServiceInfo
. In the long term, I hope to deprecate the uses ofServiceInfo
on the client (querier) side.Also note,
HostnameResolutionEvent
is also updated to useHostIp
instead ofIpAddr
. I think it's better to make this breaking change at the same time.