Skip to content

Commit

Permalink
arpdb: imp docs
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Aug 27, 2024
1 parent 2738383 commit 355136e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/arpdb/arpdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ func newNeighbor(host, ipStr, macStr string) (n *Neighbor, err error) {

ip, err := netip.ParseAddr(ipStr)
if err != nil {
// Don't wrap the error, as it will get annotated.
return nil, err
}

mac, err := net.ParseMAC(macStr)
if err != nil {
// Don't wrap the error, as it will get annotated.
return nil, err
}

Expand Down Expand Up @@ -155,6 +157,8 @@ func (ns *neighs) reset(with []Neighbor) {
// parseNeighsFunc parses the text from sc as if it'd be an output of some
// ARP-related command. lenHint is a hint for the size of the allocated slice
// of Neighbors.
//
// TODO(s.chzhen): Return []*Neighbor instead.
type parseNeighsFunc func(logger *slog.Logger, sc *bufio.Scanner, lenHint int) (ns []Neighbor)

// cmdARPDB is the implementation of the [Interface] that uses command line to
Expand Down

0 comments on commit 355136e

Please sign in to comment.