网卡对象 绑定IP地址 然后向网卡对象写入数据 数据中将包含dst和src

This commit is contained in:
impact-eintr
2022-11-25 19:25:54 +08:00
parent 4589d971fd
commit 2312813aac
10 changed files with 808 additions and 43 deletions

23
tcpip/header/ipv6.go Normal file
View File

@@ -0,0 +1,23 @@
package header
import "netstack/tcpip"
type IPv6 []byte
const (
// IPv6MinimumSize is the minimum size of a valid IPv6 packet.
IPv6MinimumSize = 40
// IPv6AddressSize is the size, in bytes, of an IPv6 address.
IPv6AddressSize = 16
// IPv6ProtocolNumber is IPv6's network protocol number.
IPv6ProtocolNumber tcpip.NetworkProtocolNumber = 0x86dd
// IPv6Version is the version of the ipv6 protocol.
IPv6Version = 6
// IPv6MinimumMTU is the minimum MTU required by IPv6, per RFC 2460,
// section 5.
IPv6MinimumMTU = 1280
)