mirror of
https://github.com/impact-eintr/netstack.git
synced 2025-10-16 09:50:36 +08:00
google永远的神
This commit is contained in:
11
tcpip/stack/nic.go
Normal file
11
tcpip/stack/nic.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package stack
|
||||
|
||||
type referencedNetworkEndpoint struct {
|
||||
//ilist.Entry
|
||||
//refs int32
|
||||
//ep NetworkEndpoint
|
||||
//nic *NIC
|
||||
//protocol tcpip.NetworkProtocolNumber
|
||||
//linkCache LinkAddressCache
|
||||
//holdsInserRef bool
|
||||
}
|
@@ -1,6 +1,9 @@
|
||||
package stack
|
||||
|
||||
import "github.com/impact-eintr/netstack/tcpip"
|
||||
import (
|
||||
"github.com/impact-eintr/netstack/tcpip"
|
||||
"github.com/impact-eintr/netstack/tcpip/buffer"
|
||||
)
|
||||
|
||||
// LinkEndpoint是由数据链路层协议(以太 环回 原始)实现的接口
|
||||
// 并由网络层协议用于实施者的数据链路端点发送数据包
|
||||
@@ -40,3 +43,6 @@ const (
|
||||
CapabilityDisconnectOk
|
||||
CapabilityLoopback
|
||||
)
|
||||
|
||||
type NetworkDispatcher interface {
|
||||
}
|
||||
|
26
tcpip/stack/route.go
Normal file
26
tcpip/stack/route.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package stack
|
||||
|
||||
import "github.com/impact-eintr/netstack/tcpip"
|
||||
|
||||
// 贯穿整个协议栈的路由,也就是在链路层和网络层都可以路由
|
||||
// 如果目标地址是链路层地址,那么在链路层路由
|
||||
// 如果目标地址是网络层地址,那么在网络层路由
|
||||
type Route struct {
|
||||
// 远端网络层地址 ipv4 or ipv6
|
||||
RemoteAddress tcpip.Address
|
||||
|
||||
// 远端网卡MAC地址
|
||||
RemoteLinkAddress tcpip.LinkAddress
|
||||
|
||||
// 本地网络层地址
|
||||
LocalAddress tcpip.Address
|
||||
|
||||
// 下一跳网络层地址
|
||||
NextHop tcpip.Address
|
||||
|
||||
// 网络层协议号
|
||||
NextProto tcpip.NetworkProtocolNumber
|
||||
|
||||
// 相关的网络终端
|
||||
ref *referencedNetworkEndpoint
|
||||
}
|
Reference in New Issue
Block a user