mirror of
https://github.com/impact-eintr/netstack.git
synced 2025-10-06 13:26:49 +08:00
google永远的神
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user