Skip to content

Function to calculate subnet block number #23

@alonbg

Description

@alonbg

Hi @apparentlymart
Well, that's not really an issue.
it would be very helpful to have a function returning the subnet position (block number) within a super-net.
func SubnetNumber(base *net.IPNet, subnet *net.IPNet) (int, error)
That's kind of a reverse to func Subnet(base *net.IPNet, newBits int, num int) (*net.IPNet, error)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions