Copyright 2019 The Prometheus Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

package procfs

import (
	
	
	
	
)
ARPEntry contains a single row of the columnar data represented in /proc/net/arp.
IP address
MAC address
Name of the device
GatherARPEntries retrieves all the ARP entries, parse the relevant columns, and then return a slice of ARPEntry's.
func ( FS) () ([]ARPEntry, error) {
	,  := ioutil.ReadFile(.proc.Path("net/arp"))
	if  != nil {
		return nil, fmt.Errorf("error reading arp %s: %s", .proc.Path("net/arp"), )
	}

	return parseARPEntries()
}

func ( []byte) ([]ARPEntry, error) {
	 := strings.Split(string(), "\n")
	 := make([]ARPEntry, 0)
	var  error
	const (
		   = 6
		 = 9
	)
	for ,  := range  {
		 := strings.Fields()
		 := len()

		if  ==  ||  == 0 {
			continue
		} else if  ==  {
			,  := parseARPEntry()
			if  != nil {
				return []ARPEntry{}, fmt.Errorf("failed to parse ARP entry: %s", )
			}
			 = append(, )
		} else {
			return []ARPEntry{}, fmt.Errorf("%d columns were detected, but %d were expected", , )
		}

	}

	return , 
}

func ( []string) (ARPEntry, error) {
	 := net.ParseIP([0])
	 := net.HardwareAddr([3])

	 := ARPEntry{
		IPAddr: ,
		HWAddr: ,
		Device: [5],
	}

	return , nil