1 Star 0 Fork 1

SillyMan/Go实用工具包

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 540 Bytes
一键复制 编辑 原始数据 按行查看 历史
SillyMan 提交于 2022-01-11 09:57 +08:00 . fixed pcapraw_linux.go
package main
import (
"flag"
"fmt"
"log"
"net"
"os"
"gitee.com/sillyman/simpleUtil/network/arpresolve"
)
var (
localIP = flag.String("lip", "", "IP address of local interface")
remoteIP = flag.String("rip", "", "IP address of host in LAN")
)
func main() {
flag.Parse()
if *localIP == "" || *remoteIP == "" {
flag.PrintDefaults()
os.Exit(1)
}
remoteMAC, err := arpresolve.Resolve(net.ParseIP(*localIP), net.ParseIP(*remoteIP), 3)
if err != nil {
log.Fatalln(err)
}
fmt.Printf("%s => %s\n", *remoteIP, remoteMAC)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/sillyman/simpleUtil.git
git@gitee.com:sillyman/simpleUtil.git
sillyman
simpleUtil
Go实用工具包
5c98b36afa10

搜索帮助