新TAP测试(TODO 解析arp)

This commit is contained in:
黄思敏 2022-08-31 18:23:59 +08:00
parent 3e115e196c
commit 9f4c58e14a

View File

@ -87,6 +87,7 @@ func NewNetTunnel() *NetTunnel {
switch frame.Ethertype() {
case ethernet.ARP:
log.Printf("bytes len: %d type(arp): % x", len(rbuf), frame.Ethertype()) // 数据长度
//TODO: 解析arp 回应arp
nt.clients.Range(func(key, value any) bool {
if key == nt.ipv4key {
return true
@ -160,7 +161,7 @@ func (nt *NetTunnel) Run() {
}
func (nt *NetTunnel) SendFrames(stream gen.FrameService_SendFramesServer) error {
log.Printf("Start: %v", stream)
log.Printf("Start: %v", stream.Context())
nt.shutdown.Loop(func(index int, ps *perfectshutdown.PerfectShutdown) {
request, err := stream.Recv()