Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection Information may contain a hostname #8

Open
JonathanWilbur opened this issue Nov 20, 2024 · 2 comments
Open

Connection Information may contain a hostname #8

JonathanWilbur opened this issue Nov 20, 2024 · 2 comments

Comments

@JonathanWilbur
Copy link

JonathanWilbur commented Nov 20, 2024

From IETF RFC 8866:

connection-field =    %s"c" "=" nettype SP addrtype SP connection-address CRLF

[...]

; sub-rules of 'c='
connection-address =  multicast-address / unicast-address

[...]

; generic sub-rules: addressing
unicast-address =     IP4-address / IP6-address / FQDN / extn-addr

multicast-address =   IP4-multicast / IP6-multicast / FQDN / extn-addr

[...]

extn-addr =  non-ws-string

But the type for ConnectionAddress.base is IpAddr.

I'd be happy to create a PR to fix this if you'll publish it when approved / merged.

@JonathanWilbur
Copy link
Author

JonathanWilbur commented Nov 20, 2024

I think it should have a type like

pub enum ConnectionAddressBase {
    Ip(IpAddr),
    Fqdn(String),
    Extn(String)
}

I feel like Fqdn above could use stronger typing, which I know you value in your crates, but I'm not sure what it could be other than Vec<String> to represent the DNS labels, which is more abstruse than it is worth, IMO.

@JonathanWilbur
Copy link
Author

Oh, I also just discovered this is a problem with the Origin.unicast_address type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant