ipbits

package
v26.0.0-rc1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 3 Imported by: 60

Documentation

Overview

Package ipbits contains utilities for manipulating netip.Addr values as numbers or bitfields.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(ip netip.Addr, x uint64, shift uint) netip.Addr

Add returns ip + (x << shift).

func Field

func Field(ip netip.Addr, u, v uint) uint64

Field returns the value of the bitfield [u, v] in ip as an integer, where bit 0 is the most-significant bit of ip.

The result is undefined if u > v, if v-u > 64, or if u or v is larger than ip.BitLen().

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL