iputil

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// Need 96 bytes for the largest reject packet:
	// - 20 byte ipv4 header
	// - 8 byte icmpv4 header
	// - 68 byte body (60 byte max orig ipv4 header + 8 byte orig icmpv4 header)
	MaxRejectPacketSize = ipv4.HeaderLen + 8 + 60 + 8
)

Variables

This section is empty.

Functions

func CreateICMPEchoResponse added in v1.7.0

func CreateICMPEchoResponse(packet, out []byte) []byte

func CreateRejectPacket added in v1.7.0

func CreateRejectPacket(packet []byte, out []byte) []byte

func ToNetIpAddr added in v1.6.0

func ToNetIpAddr(ip net.IP) (netip.Addr, error)

func ToNetIpPrefix added in v1.6.0

func ToNetIpPrefix(ipNet net.IPNet) (netip.Prefix, error)

Types

type VpnIp

type VpnIp uint32

func Ip2VpnIp

func Ip2VpnIp(ip []byte) VpnIp

func (VpnIp) MarshalJSON

func (ip VpnIp) MarshalJSON() ([]byte, error)

func (VpnIp) String

func (ip VpnIp) String() string

func (VpnIp) ToIP

func (ip VpnIp) ToIP() net.IP

func (VpnIp) ToNetIpAddr added in v1.6.0

func (ip VpnIp) ToNetIpAddr() netip.Addr

Jump to

Keyboard shortcuts

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