libmdns icon indicating copy to clipboard operation
libmdns copied to clipboard

Adding support to services subtypes

Open gustavowd opened this issue 3 years ago • 1 comments

Hi.

I'm trying to use the libmdns to responde mdns and dns-sd messages to an IEEE 2030.5 client. It turns out that IEEE 2030.5 standard has several subtypes: For example, tm._sub._smartenergy._tcp.local

If I send a request for this subtypes, the answer must be something like:

tm-00000000._smartenergy._tcp.local

However, there is no subtype parameter in the register function of libmdns. So, if i declare the type as tm._sub._smartenergy._tcp.local, the server returns: tm-00000000.tm._sub._smartenergy._tcp.local

that's not the right answer.

Is there any way to implement subtypes in libmdns? If not, could you consider implementing this support?

gustavowd avatar Jun 14 '21 00:06 gustavowd

It looks as though this is quite possibly the only offending line: https://github.com/librespot-org/libmdns/blob/v0.6.0/src/lib.rs#L173

I wonder if this would be a good reason to look at #9 as currently we'd need a separate (but extremely similar) method to register like register_exact_name which feels a little messy (but would be easy to do).

willstott101 avatar Jun 20 '21 13:06 willstott101