Same RFC defines that for IPv6, square brackets should be used to distinguish
between addr and port:
A host identified by an Internet Protocol literal address, version 6
[RFC3513] or later, is distinguished by enclosing the IP literal
within square brackets ("[" and "]"). This is the only place where
square bracket characters are allowed in the URI syntax.
—
Damjan
> On 27.05.2021., at 13:00, Dave Barach <[email protected]> wrote:
>
> IIRC it's exactly because ipv6 addresses use ':' (and "::") as chunk
> separators. If you decide to change unformat_vnet_uri please test ipv6 cases
> carefully.
>
> D.
>
> -----Original Message-----
> From: [email protected] <[email protected]> On Behalf Of Florin Coras
> Sent: Thursday, May 27, 2021 1:05 AM
> To: 江 晓明 <[email protected]>
> Cc: [email protected]
> Subject: Re: [vpp-dev] unformat_vnet_uri not implemented following RFC 3986
>
> Hi,
>
> That unformat function and the associated session layer apis (e.g.,
> vnet_connect_uri) are mainly used for testing and their production use is
> discouraged. Provided that functionality is not lost, if anybody wants to do
> the work, I don’t see why we wouldn’t want to make the unformat function rfc
> compliant. At this point I can’t remember why we settled on the use of “/“
> but I suspect it may have to do with easier parsing of ipv6 ips.
>
> Regards,
> Florin
>
>> On May 26, 2021, at 8:04 PM, [email protected] wrote:
>>
>> Hi Florin:
>> Currently unformat_vnet_uri not implemented following RFC 3986. The
>> syntax `tcp://10.0.0.1/500` should be `tcp://10.0.0.1:500` in rfc 3986.
>> I noticed in there is a comment for `unformat_vent_uri` in
>> `src/vnet/session/application_interface.c`,
>> ```
>> /**
>> * unformat a vnet URI
>> *
>> * transport-proto://[hostname]ip46-addr:port
>> * eg. tcp://ip46-addr:port
>> * tls://[testtsl.fd.io]ip46-addr:port
>> *
>> ...
>> ```
>> Does it mean `unformat_vnet_uri` will be refactored following rfc in future?
>>
>>
>>
>
>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19489): https://lists.fd.io/g/vpp-dev/message/19489
Mute This Topic: https://lists.fd.io/mt/83117335/21656
Group Owner: [email protected]
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-