Skip to content
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

Update MDNS library with query support #2237

Merged
merged 52 commits into from
Mar 8, 2021

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Mar 2, 2021

Add Basic_Mdns sample to demonstrate usage

TODO:

  • Why are queries not visible in Wireshark? AP must be disabled.
  • Add support for list of queries - at present only one question may be posed
  • Add support for queries so that callback can provide responder functionality
  • Move into separate library submodule (it's optional and will likely grow)

@mikee47 mikee47 force-pushed the feature/mdns-query branch 2 times, most recently from d74540c to 58e8797 Compare March 2, 2021 23:50
@mikee47
Copy link
Contributor Author

mikee47 commented Mar 2, 2021

Like the SSDP server the Finder requires two UDP ports, one to listen and another to send. Few things to note here:

  • Callback gets all incoming messages, not just the requested ones
  • The responder will almost certainly not work whilst a Finder instances is active
  • Only one query is supported at present. This should be expanded to provide a list of queries

The responder part should be rewritten along the same lines as the finder, sharing common code, etc. That will provide a common code base for all architectures and provide more flexiblility. (Another PR)

@slaff slaff added this to the 4.3.0 milestone Mar 3, 2021
@slaff
Copy link
Contributor

slaff commented Mar 3, 2021

@mikee47 Can you check the failing CI build?

@mikee47
Copy link
Contributor Author

mikee47 commented Mar 3, 2021

Yep, just reverting some changes which don't work on ancient compiler.
Also testing on ESP8266... looks OK.

@mikee47 mikee47 force-pushed the feature/mdns-query branch 2 times, most recently from ef2b5f6 to c70f189 Compare March 3, 2021 09:38
@mikee47
Copy link
Contributor Author

mikee47 commented Mar 3, 2021

OK, so running on ESP8266 responses come in OK but cannot see the outgoing queries in Wireshark. I'm using the SSDP server code as a reference and failing to spot the problem!

@slaff slaff changed the title Update mDNS library with query support [WIP] Update mDNS library with query support Mar 3, 2021
@slaff slaff mentioned this pull request Mar 4, 2021
5 tasks
@slaff
Copy link
Contributor

slaff commented Mar 4, 2021

@mikee47 Ping me when this PR is ready for testing.

@slaff slaff changed the title [WIP] Update mDNS library with query support Update mDNS library with query support Mar 4, 2021
@mikee47
Copy link
Contributor Author

mikee47 commented Mar 4, 2021

@slaff OK ready for testing.

@mikee47
Copy link
Contributor Author

mikee47 commented Mar 4, 2021

@slaff This has grown a little, perhaps it should be in a separate library?

@mikee47
Copy link
Contributor Author

mikee47 commented Mar 5, 2021

I've been unable to get discovery working in host emulator under Linux. Likely I need to adjust the bridge configuration - any ideas?

@mikee47
Copy link
Contributor Author

mikee47 commented Mar 5, 2021

NB. Working in WSL2, so perhaps related. Here's my network info:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether c6:fe:c6:79:8a:2e brd ff:ff:ff:ff:ff:ff
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 5e:37:df:54:df:d3 brd ff:ff:ff:ff:ff:ff
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:8f:24:53 brd ff:ff:ff:ff:ff:ff
    inet 172.29.167.48/20 brd 172.29.175.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe8f:2453/64 scope link
       valid_lft forever preferred_lft forever
5: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
6: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether ba:a8:68:07:08:fe brd ff:ff:ff:ff:ff:ff
    inet 192.168.13.1/24 scope global tap0
       valid_lft forever preferred_lft forever
    inet6 fe80::b8a8:68ff:fe07:8fe/64 scope link
       valid_lft forever preferred_lft forever

@slaff
Copy link
Contributor

slaff commented Mar 5, 2021

@mikee47 This PR looks good to me. Do you plan to add more changes or I should merge it as it is?

@mikee47
Copy link
Contributor Author

mikee47 commented Mar 5, 2021

@slaff All done thanks

@mikee47
Copy link
Contributor Author

mikee47 commented Mar 5, 2021

@slaff Spotted one minor bug in the code, further updates will arrive in responder

@slaff
Copy link
Contributor

slaff commented Mar 7, 2021

Spotted one minor bug in the code, further updates will arrive in responder

Ping me when ready.

@mikee47
Copy link
Contributor Author

mikee47 commented Mar 7, 2021

@slaff OK rebased/tidied, plus relevant commits from the responder branch.

@mikee47 mikee47 changed the title Update mDNS library with query support Update MDNS library with query support Mar 7, 2021
@slaff slaff merged commit ea49ac5 into SmingHub:develop Mar 8, 2021
@mikee47 mikee47 deleted the feature/mdns-query branch March 8, 2021 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants