Skip to content

Commit

Permalink
Add ipprefix cast operators for ipaddr [2/n] (#11481)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #11481

Support casting ipprefix -> ipaddress, and ipaddress -> ipprefix.

We just need one new helper function, tryIpPrefixLengthFromIPAddressType, which takes in int128_t, gets the ippaddress, and then we check if the ippaddress is ipv4 or ipv6 mapped. We return 32 for ipv4 and 128 for ipv6 mapped.

Also applies suggestion from https://github.com/facebookincubator/velox/pull/11309/files

Reviewed By: Yuhta

Differential Revision: D65641994

fbshipit-source-id: aa43e1667affd73f263fedb33a101bc6aff7dea7
  • Loading branch information
yuandagits authored and facebook-github-bot committed Dec 5, 2024
1 parent e7fbaea commit 7205403
Show file tree
Hide file tree
Showing 6 changed files with 386 additions and 63 deletions.
Loading

0 comments on commit 7205403

Please sign in to comment.