google永远的神

This commit is contained in:
impact-eintr
2021-09-06 21:54:27 +08:00
parent b851ceba7f
commit e02fb492fd
7 changed files with 283 additions and 7 deletions

View File

@@ -1,5 +1,11 @@
package stack
import (
"sync"
"github.com/impact-eintr/netstack/tcpip"
)
type referencedNetworkEndpoint struct {
//ilist.Entry
//refs int32
@@ -9,3 +15,25 @@ type referencedNetworkEndpoint struct {
//linkCache LinkAddressCache
//holdsInserRef bool
}
// 代表一个网卡对象
type NIC struct {
stack *Stack
// 每个网卡唯一的标识号
id tcpip.NICID
// 网卡名 可有可无
name string
// 链路层端
linkEP LinkEndpoint
// 传输层的解复用
demux *transportDemuxer
mu sync.RWMutex
spoofing bool
promiscuous bool
primary map[tcpip.NetworkProtocolNumber]*ilist.List
// 网络层端的记录
endpoints map[tcpip.NetworkEndpointID]*referencedNetworkEndpoint
// 子网的记录
subnets []tcpip.Subnet
}