utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefualtBackoff = func(r, m int) (backoff time.Duration) {
	return time.Second
}

Functions

func AddressesFromCIDR

func AddressesFromCIDR(cidr string, out chan string, quit chan int) error

AddressesFromCIDR parses a CIDR and writes individual IPs to a channel

func GetUint16Bytes

func GetUint16Bytes(v int) (elen []byte)

GetUint16Bytes return 16-bit (BE) version of the input

func IPv42UInt

func IPv42UInt(ips string) (uint32, error)

IPv42UInt converts IPv4 addresses to unsigned integers

func RandomBytes

func RandomBytes(numBytes int) (randomBytes []byte)

func RandomGrease

func RandomGrease() (grease []byte)

RandomGrease returns a randomly chosen "grease" value

func UInt2IPv4

func UInt2IPv4(ipi uint32) string

UInt2IPv4 converts unsigned integers to IPv4 addresses

func ValidPort

func ValidPort(port int) (valid bool)

ValidPort determines if a port number is valid

Types

This section is empty.

Jump to

Keyboard shortcuts

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