GithubHelp home page GithubHelp logo

arp's People

Contributors

cmatsuoka avatar mostlygeek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

arp's Issues

Possible cleanup?

Hello,

This project looks useful as part of something else I'm working on. I wanted to propose a bit of cleanup and just see what your feedback on it is.

You have this PR: #1 which is still outstanding. I think that should be merged.

Also, @jstotz has his fork here: https://github.com/jstotz/arp where he's cleaned a few things up (normalized the address output across platforms, merged the PR above, and some other minor stuff). Those look like sensible changes to me and should probably be merged back here.

There are also two additional points:

  • I have a working implementation for MacOS that uses cgo to make the calls directly (see https://gist.github.com/bradleypeabody/21ab61ca639bff2008bde2e28b9f5aef), rather than shelling out to run 'arp' (I tried doing this without cgo just using syscall.Sysctl and that doesn't seem to work). This could replace the existing MacOS implementation.
  • I think it would be smart to do just a small abstraction and instead of making the lookup only be IPAddress->MACAddress, it could instead return an instance that implements an interface called something like "AddressInfo" - which could have "MACAddress() string" as a member function, as well as maybe "InterfaceName() string". The underlying implementation could be platform specific so additional fields could also be available through casting if one really so desired. Not vital, but would be nice and easy to do. Would avoid future breaking changes as well.

I can do the work described above. My main question is do you want to continue to house the "main" version here in this repo? (I can't tell if you are maintaining this or not.)

-Brad

Windows version pops up a cmd window when the arp command is run

I am using this package with the fyne UI toolkit. When the arp command is execured via exec() it pops up a command window that goes away after the arp command is run. To resolve this issue, the following command must be run before doing the exec():
syscall.SysProcAttr{HideWindow: true}

The following snippet should fix the issue:
func Table() ArpTable {
cmd := exec.Command("arp", "-a")
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
var outb bytes.Buffer
cmd.Stdout = &outb
err := cmd.Run()
data := outb.String()

Is this repository being maintained?

Hello, is this repo currently maintained? I am considering using it in an industrial project (respecting the license ofc), but I need to know whether possible PRs would be adressed/merged by the maintainer in a timely fashion.

Table fails to pad mac addr segments to 2 chars

Given the hypothetical mac address ab:bc:cd:01:02:03, this library returns a table whose values are missing leading zero padding, eg ab:bc:cd:1:2:3. This prevents values in the table from being comparable to the actual mac address.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.