mirror of
https://github.com/impact-eintr/netstack.git
synced 2025-10-19 11:04:36 +08:00
arp基本实现 创建一个网卡对象并绑定到ip1 网卡收到一个arp报文 链路层分发给arp网络端实现 arp到本地缓存中查找 该网卡是否绑定过目标ip地址ip1 没有直接放弃 有就新建一个源与目标逆置并添加了该网卡MAC的arp报文 并包装给链路层
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package buffer
|
||||
|
||||
|
||||
type View []byte
|
||||
|
||||
func NewView(size int) View {
|
||||
@@ -21,14 +20,14 @@ func (v *View) CapLength(length int) {
|
||||
*v = (*v)[:length:length]
|
||||
}
|
||||
|
||||
func (v View) ToVectoriseView() VectorisedView {
|
||||
func (v View) ToVectorisedView() VectorisedView {
|
||||
return NewVectorisedView(len(v), []View{v})
|
||||
}
|
||||
|
||||
// VectorisedView 是使用非连续内存的 View 的矢量化版本
|
||||
type VectorisedView struct {
|
||||
views []View
|
||||
size int
|
||||
size int
|
||||
}
|
||||
|
||||
func NewVectorisedView(size int, views []View) VectorisedView {
|
||||
|
Reference in New Issue
Block a user