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:

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

Differential Revision: D65641994
  • Loading branch information
yuandagits authored and facebook-github-bot committed Nov 12, 2024
1 parent 551fc2f commit 3cc83c5
Show file tree
Hide file tree
Showing 6 changed files with 384 additions and 118 deletions.
Loading

0 comments on commit 3cc83c5

Please sign in to comment.