Movatterモバイル変換


[0]ホーム

URL:


ipbits

package
v2.0.0-beta.5Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License:Apache-2.0Imports:3Imported by:0

Details

Repository

github.com/moby/moby

Links

Documentation

Overview

Package ipbits contains utilities for manipulatingnetip.Addr values asnumbers or bitfields.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcAdd

func Add(ipnetip.Addr, xuint64, shiftuint)netip.Addr

Add returns ip + (x << shift).

funcField

func Field(ipnetip.Addr, u, vuint)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 thanip.BitLen().

funcSubnetsBetween

func SubnetsBetween(a1netip.Addr, a2netip.Addr, szint)uint64

SubnetsBetween computes the number of subnets of size 'sz' available between 'a1'and 'a2'. The result is capped atmath.MaxUint64. It returns 0 when one of'a1' or 'a2' is invalid, if both aren't of the same family, or when 'a2' isless than 'a1'.

Types

This section is empty.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp