Project

General

Profile

Actions

Task #1994

closed

FaceUri canonization

Added by Junxiao Shi over 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Utils
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
4.00 h

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

Related issues 3 (0 open3 closed)

Blocked by ndn-cxx - Task #1918: DNS resolverClosedVince Lehman

Actions
Blocks NLSR - Task #1911: Create face with canonical FaceUriClosedVince Lehman

Actions
Blocks NFD - Task #1909: nfdc: ensure FaceUri is in canonical formClosedChengyu Fan

Actions
Actions #1

Updated by Junxiao Shi over 10 years ago

Actions #2

Updated by Junxiao Shi over 10 years ago

  • Blocks Task #1911: Create face with canonical FaceUri added
Actions #3

Updated by Junxiao Shi over 10 years ago

  • Blocks Task #1909: nfdc: ensure FaceUri is in canonical form added
Actions #4

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);
};
Actions #5

Updated by Alex Afanasyev about 10 years ago

I'm ok with the interface.

Actions #6

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.

Actions #7

Updated by Davide Pesavento about 10 years ago

Junxiao Shi wrote:

Change-Id: I63a459c0620f9c229e690df05de1333a8dea2bdd imports nfd::ethernet and FaceUri into ndn-cxx.

Three hours later, the change is already approved and merged. How are we supposed to review patches in so little time?

Actions #8

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

Actions #9

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.

Actions #10

Updated by Junxiao Shi about 10 years ago

  • % Done changed from 30 to 50
Actions #11

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.

Actions #12

Updated by Junxiao Shi about 10 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF