新TAP测试(TODO 解析arp)
This commit is contained in:
parent
3e115e196c
commit
9f4c58e14a
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user