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

Add an LLMNR responder implementation #2880

Merged
merged 1 commit into from
Feb 21, 2017
Merged

Add an LLMNR responder implementation #2880

merged 1 commit into from
Feb 21, 2017

Conversation

swarren
Copy link
Contributor

@swarren swarren commented Jan 19, 2017

This is a simple implementation of an LLMNR responder for the ESP8266
Arduino package. Only support for advertizing a single hostname is
currently implemented.

LLMNR is a very similar protocol to MDNS. The primary practical
difference is that Windows systems (at least Windows 7 and later;
perhaps earlier) support the protocol out-of-the-box, whereas additional
software is required to support MDNS. However, Linux support is
currently more complex, and MacOS X support appears non-existent.

@codecov-io
Copy link

codecov-io commented Jan 19, 2017

Codecov Report

Merging #2880 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #2880   +/-   ##
=======================================
  Coverage   27.82%   27.82%           
=======================================
  Files          20       20           
  Lines        3626     3626           
  Branches      656      656           
=======================================
  Hits         1009     1009           
  Misses       2441     2441           
  Partials      176      176

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2b370b...7b1055c. Read the comment docs.

@igrr
Copy link
Member

igrr commented Jan 19, 2017

Thanks for contributing this library!
I would like to know whether you plan to maintain it in the long run. Also, what is your expectations about the rate of changes to this library in the future. If you plan to make a lot of changes, it may be easier for you to distribute this library via Arduino Library Manager, which allows updating library independent of the boards manager package. As you may have noticed, our release cadence has been somewhat lacking.

@swarren
Copy link
Contributor Author

swarren commented Jan 24, 2017

I don't expect to make many more changes to the code; it seems to work as-is. Of course, there are some violations of the RFC (unimplemented features), but they shouldn't cause problems in practice. I don't know if anyone else will implement them. I'd guess that this library would see roughly the same rate of changes as the existing MDNS code, since it does roughly the same thing.

About the only changes I might guess at are:

  • Add an end() API, or an API to change the hostname. If I did this, I'd make the same change to MDNS too, so splitting this out into a separately repo/package wouldn't help your workload.
  • Implement LLMNR queries; the current code only supports responding to queries. I don't need this feature though, so I doubt I'd implement it.

I see an advantage of keeping this library with all the other ESP8266 libraries. It's easier for people to find and install just one extra thing in the Arduino IDE, rather than having to track down each library separately. It also makes it easier to test all the libraries and core ESP8266/SDK code together since everything is part of the same release, so there's no mixing/matching versions.

Honestly, I'm not really looking to pick up maintenance of anything much. As I'm sure you're aware, that rather takes time away from doing other stuff. I'm happy to answer questions or fix issues if they come up though, to keep the code working.

Copy link
Member

@igrr igrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of things I noticed when I was about to merge...

_hostname = hostname;
_hostname.toLowerCase();

WiFi.onStationModeGotIP([this](const WiFiEventStationModeGotIP& event){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to save the return value as a member variable of the class. The callback lifetime is controlled by the returned EventHandler value.
Same thing a few lines below.

_conn = new UdpContext;
_conn->ref();

if (!_conn->listen(*IP_ADDR_ANY, LLMNR_PORT))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a minor thing, but in some other places you put braces around one-line if bodies. Suggest doing the same thing everywhere.

This is a simple implementation of an LLMNR responder for the ESP8266
Arduino package. Only support for advertizing a single hostname is
currently implemented.

LLMNR is a very similar protocol to MDNS. The primary practical
difference is that Windows systems (at least Windows 7 and later;
perhaps earlier) support the protocol out-of-the-box, whereas additional
software is required to support MDNS. However, Linux support is
currently more complex, and MacOS X support appears non-existent.
@swarren
Copy link
Contributor Author

swarren commented Feb 21, 2017

New version uploaded to address the review comments, thanks.

@igrr igrr merged commit 04df3ad into esp8266:master Feb 21, 2017
@swarren
Copy link
Contributor Author

swarren commented Feb 22, 2017

Great, thanks!

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.

None yet

3 participants