[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [patch #9555] Add MDNS probing
From: |
Jens Nielsen |
Subject: |
[lwip-devel] [patch #9555] Add MDNS probing |
Date: |
Sun, 28 Jan 2018 02:41:51 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 |
URL:
<http://savannah.nongnu.org/patch/?9555>
Summary: Add MDNS probing
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: deft
Submitted on: Sun 28 Jan 2018 07:41:50 AM UTC
Category: apps
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
Hi
I had a go at MDNS probing, as described in RFC 6762 Section 8.1. The
implementation I have here basically just covers my needs and is barely tested
and most likely contains a few bugs, but I add it here as a request for
comments to see if we can agree on a path to get it into lwip
Patch 1 contains the basics, send 3 probe queries before responding to any
queries, and abort if someone answers. I know this breaks backwards
compatibility in the api by adding the _start() and _restart() functions but I
don't know how else I can differentiate the three distinct events: 1. User
saying "all services are added, go ahead", 2. Cable has been reconnected or
administrative interface came up after being down and probing must be
restarted, and 3. The IP address has changed, send a new announce message but
don't restart probing.
I'm also aware this doesn't comply with some other MUST requirements (such as
the 5 second delay or using the 5353 source port for queries if that applies
here) but the whole probing section is a MUST so, one step at a time...
Patch 2 contains a minimal set of what I need to handle conflict, a simple
callback with a result. If result is 0 I call mdns_resp_remove_netif() and try
again with a new name, if result is 1 I can write the name to nonvolatile
storage. This works for me since I will use same name for host and services
but probably needs to be extended to cover the case where someone has
different names, though I don't really understand the use case for that in an
embedded device... I couldn't come up with a decent api to cover that so I
left it out but should probably be considered if merging.
Patch 3 contains an approach to populate the authoritative section of the
probe request, according to Section 8.2. Strictly not needed for probing but
there was a comment somewhere in the RFC that this could be used to
differentiate a probe from a normal query.
Also attached a wireshark trace to show what it looks like. 192.168.5.44 is
some other computer on my network, 192.168.5.26 is my lwip device that I had
configured to use the same host name as that computer.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Sun 28 Jan 2018 07:41:50 AM UTC Name:
0001-MDNS-send-probes-to-verify-domain-before-use.patch Size: 14KiB By:
deft
<http://savannah.nongnu.org/patch/download.php?file_id=43096>
-------------------------------------------------------
Date: Sun 28 Jan 2018 07:41:50 AM UTC Name:
0002-Add-callback-to-user-to-notify-result-of-mdns-probe.patch Size: 3KiB
By: deft
<http://savannah.nongnu.org/patch/download.php?file_id=43097>
-------------------------------------------------------
Date: Sun 28 Jan 2018 07:41:50 AM UTC Name:
0003-Populate-MDNS-probes-authoritative-section.patch Size: 6KiB By: deft
<http://savannah.nongnu.org/patch/download.php?file_id=43098>
-------------------------------------------------------
Date: Sun 28 Jan 2018 07:41:50 AM UTC Name: mdns probe.pcap Size: 1KiB By:
deft
<http://savannah.nongnu.org/patch/download.php?file_id=43099>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?9555>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [patch #9555] Add MDNS probing,
Jens Nielsen <=