corenet

package
v0.0.0-...-2561dba Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the prefix given to all the functions in this module.
	ModuleName = "net"
)

Variables

This section is empty.

Functions

func CidrToIP

func CidrToIP(ctx context.Context, input []types.Value) (types.Value, error)

CidrToIP returns the IP from a CIDR address.

func CidrToMask

func CidrToMask(ctx context.Context, input []types.Value) (types.Value, error)

CidrToMask returns the subnet mask from a CIDR address.

func CidrToPrefix

func CidrToPrefix(ctx context.Context, input []types.Value) (types.Value, error)

CidrToPrefix returns the prefix from a CIDR address. For example, if you give us 192.0.2.0/24 then we will return "24" as a string.

func IsMac

func IsMac(ctx context.Context, input []types.Value) (types.Value, error)

IsMac takes a string and returns true if it's a mac in the standard format.

func MacFmt

func MacFmt(ctx context.Context, input []types.Value) (types.Value, error)

MacFmt takes a MAC address with hyphens and converts it to a format with colons.

func Macs

func Macs(ctx context.Context, input []types.Value) (types.Value, error)

Macs returns the list of mac addresses that are seen on the machine.

XXX: These should produce new values if the list of interfaces change.

func OldMacFmt

func OldMacFmt(ctx context.Context, input []types.Value) (types.Value, error)

OldMacFmt takes a MAC address with colons and converts it to a format with hyphens. This is the old deprecated style that nobody likes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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