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

Add ipcidr support #177

Merged
merged 5 commits into from
Jun 19, 2022
Merged

Conversation

MarcoPolo
Copy link
Contributor

Adds the ipcidr protocol.

Example: /ip4/1.2.3.0/ipcidr/24

Can be used by ipv6 as well

@MarcoPolo
Copy link
Contributor Author

r? @marten-seemann

net/convert_test.go Show resolved Hide resolved
transcoders.go Outdated
@@ -54,6 +54,15 @@ func (t twrp) ValidateBytes(b []byte) error {
var TranscoderIP4 = NewTranscoderFromFunctions(ip4StB, ip4BtS, nil)
var TranscoderIP6 = NewTranscoderFromFunctions(ip6StB, ip6BtS, nil)
var TranscoderIP6Zone = NewTranscoderFromFunctions(ip6zoneStB, ip6zoneBtS, ip6zoneVal)
var TranscoderIPCIDR = NewTranscoderFromFunctions(func(s string) ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the convention here was to define separate functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if there's a specific reason?

multiaddr_test.go Show resolved Hide resolved
Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, module one defensive check.

transcoders.go Show resolved Hide resolved
@MarcoPolo
Copy link
Contributor Author

@marten-seemann can you merge please? I don’t have access

@marten-seemann marten-seemann merged commit f5adc3b into multiformats:master Jun 19, 2022
@MarcoPolo MarcoPolo mentioned this pull request Jul 7, 2022
41 tasks
@ajnavarro ajnavarro mentioned this pull request Aug 24, 2022
72 tasks
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

Successfully merging this pull request may close these issues.

None yet

2 participants