net

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIPFamily

func GetIPFamily(ip net.IP) int

func GetLocalWildcardIP added in v0.0.2

func GetLocalWildcardIP(family int) net.IP

func ParseQuotedUDPHeader added in v0.0.2

func ParseQuotedUDPHeader(packet []byte, af int) (int, int, error)

ParseQuotedUDPHeader extracts UDP source and destination ports from ICMP reply request i.e. IP + ICMP Header + ICMP Payload (Quoted IP + UDP Headers)

func ResolveHostnameToIP

func ResolveHostnameToIP(dest string, preferAddressFamily int) (net.IP, error)

ResolveHostnameToIP resolves a hostname to an IP address, preferring the specified address family (e.g., IPv4Family or IPv6Family).

func ReverseLookup

func ReverseLookup(addr string, timeout time.Duration) string

Resolves IP address to hostname

func SkipICMPHeader added in v0.0.2

func SkipICMPHeader(packet []byte) []byte

SkipICMPHeader returns the slice of data after the ICMP header in the packet.

func SkipIPHeader added in v0.0.2

func SkipIPHeader(packet []byte, af int) ([]byte, error)

SkipIPHeader returns the slice of data after the IP header in the packet. It uses the address family to determine the IP header length. For IPv4, header length is variable and specified in the first byte. For IPv6, header length is fixed to 40 bytes.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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