Task #1994
closedFaceUri canonization
100%
Description
Develop a utility class to canonize FaceUri.
FaceUri canonization may involve:
- perform DNS resolution to convert hostname to IP address
- distinguish between IPv4 and IPv6 to convert tcp or udp to tcp4|tcp6 or udp4|udp6
- add standard port number
- add or delete trailing slash
Updated by Junxiao Shi about 10 years ago
- Blocked by Task #1918: DNS resolver added
Updated by Junxiao Shi about 10 years ago
- Blocks Task #1911: Create face with canonical FaceUri added
Updated by Junxiao Shi about 10 years ago
- Blocks Task #1909: nfdc: ensure FaceUri is in canonical form added
Updated by Junxiao Shi about 10 years ago
- Status changed from New to In Progress
- Assignee set to Junxiao Shi
- % Done changed from 0 to 10
@Vince says he cannot start working on this Task anytime soon.
I'll start implementation after #1918 is closed AND the design below is reviewed.
My plan is to pull NFD FaceUri
type into ndn-cxx, and extend it with the following:
partial class FaceUri
{
/** \return true if FaceUri is in canonical form, false otherwise
* \note Only the following scheme names are supported: udp, udp4, udp6, tcp, tcp4, tcp6, fd, unix, ether, dev. false will be returned for all other scheme names.
*/
bool
isCanonical() const;
/** \brief asynchronously convert this FaceUri to the canonical form
* \note See isCanonical for supported scheme names. onFailure will be invoked for unsupported scheme names.
*/
void
startCanonize(function<FaceUri> onSuccess, function<std::string> onFailure, boost::asio::io_service& io, time::nanoseconds timeout);
};
Updated by Junxiao Shi about 10 years ago
- % Done changed from 10 to 30
Change-Id: I63a459c0620f9c229e690df05de1333a8dea2bdd imports nfd::ethernet
and FaceUri
into ndn-cxx.
ether
scheme is enabled universally regardless of whether libpcap
is enabled, because a library compiled without libpcap shall still be interoperable with a forwarder with libpcap.
unix
scheme is enabled universally, but the constructor taking Asio UNIX socket is enabled only if Asio has this feature. Unfortunately this requires #include <boost/asio.hpp>
in FaceUri header.
I'll continue with this Task after this Change is approved.
Updated by Davide Pesavento about 10 years ago
Junxiao Shi wrote:
Change-Id: I63a459c0620f9c229e690df05de1333a8dea2bdd imports
nfd::ethernet
andFaceUri
into ndn-cxx.
Three hours later, the change is already approved and merged. How are we supposed to review patches in so little time?
Updated by Alex Afanasyev about 10 years ago
Sorry, given it was just copied from NFD, I assumed there will be no problems and sped up the merge process. Are there problems with the commit? We can always amend it
Updated by Davide Pesavento about 10 years ago
Alex Afanasyev wrote:
Sorry, given it was just copied from NFD, I assumed there will be no problems and sped up the merge process. Are there problems with the commit? We can always amend it
The problem is that it's not an exact copy... I'll comment on gerrit in a minute.
Updated by Junxiao Shi about 10 years ago
- Status changed from In Progress to Code review
- % Done changed from 50 to 100
I decide to implement canonization for udp,tcp,ether only, because other schemes can't be used in faces/create
command and are rarely used in face query operation.
Updated by Junxiao Shi about 10 years ago
- Status changed from Code review to Closed