named-data / YaNFD

Yet another Named Data Networking Forwarding Daemon
https://pkg.go.dev/github.com/named-data/YaNFD
MIT License
13 stars 10 forks source link

Definition of canonical is confusing #8

Closed zjkmxy closed 3 years ago

zjkmxy commented 3 years ago

The concept of canonical in YaNFD is confusing. For ethernetURI, fdURI, internalURI, nullURI, udpURI, canonical means well-formed: https://github.com/named-data/YaNFD/blob/001755fc7bb1fb335704775f3bb910c6b14b4bc1/ndn/uri.go#L286-L302 For devURI and unixURI, canonical means existing interface, which is related to specific machine and operation system: https://github.com/named-data/YaNFD/blob/001755fc7bb1fb335704775f3bb910c6b14b4bc1/ndn/uri.go#L303-L306 This restricts that the unit test can be only executed on specific machines: https://github.com/named-data/YaNFD/blob/001755fc7bb1fb335704775f3bb910c6b14b4bc1/ndn/uri_test.go#L172 Not every machine allows building program access to this path.

Note: ndn-cxx does not check the physical existence of interface in isCanonical.

eric135 commented 3 years ago

This concept was inherited from NFD/ndn-cxx. I'd recommend looking at what they did (and trying to stay compatible) :-)

zjkmxy commented 3 years ago

This concept was inherited from NFD/ndn-cxx. I'd recommend looking at what they did (and trying to stay compatible) :-)

ndn-cxx does not check physical existence of faces. For devURI, it always succeed if there is a path; for unixURI, ndn-cxx always fails (not supported).