dhcp

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

Package dhcp parses macOS dhcpd_leases file to discover VM IP addresses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupByHostname

func LookupByHostname(hostname string) (string, error)

LookupByHostname returns the IP address for the given hostname. Returns the first match (file order = newest first in macOS dhcpd_leases).

Types

type Lease

type Lease struct {
	Name      string
	IPAddress string
	HWAddress string
	LeaseTime int64
}

Lease represents a DHCP lease entry.

func ParseLeases

func ParseLeases() ([]Lease, error)

ParseLeases reads and parses /var/db/dhcpd_leases.

func ParseLeasesData

func ParseLeasesData(data string) ([]Lease, error)

ParseLeasesData parses dhcpd_leases content.

func ParseLeasesFile

func ParseLeasesFile(path string) ([]Lease, error)

ParseLeasesFile parses a dhcpd_leases file from the given path.

Jump to

Keyboard shortcuts

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