Documentation ¶
Index ¶
- Constants
- func Checksum(sum uint32, b []byte) (answer [2]byte)
- func ConvertIPv4ToUint32(ip net.IP) uint32
- func ConvertUint32ToIPv4(v uint32) net.IP
- func IsIPv4(packet []byte) bool
- func IsIPv6(packet []byte) bool
- func Sum(b []byte) uint32
- type ICMPPacket
- type ICMPType
- type IPProtocol
- type IPv4Packet
- func (p IPv4Packet) Checksum() uint16
- func (p IPv4Packet) DataLen() uint16
- func (p IPv4Packet) DestinationIP() net.IP
- func (p IPv4Packet) HeaderLen() uint16
- func (p IPv4Packet) Payload() []byte
- func (p IPv4Packet) Protocol() IPProtocol
- func (p IPv4Packet) PseudoSum() uint32
- func (p IPv4Packet) ResetChecksum()
- func (p IPv4Packet) SetChecksum(sum [2]byte)
- func (p IPv4Packet) SetDestinationIP(ip net.IP)
- func (p IPv4Packet) SetSourceIP(ip net.IP)
- func (p IPv4Packet) SourceIP() net.IP
- func (p IPv4Packet) TotalLen() uint16
- type TCPPacket
- func (p TCPPacket) Checksum() uint16
- func (p TCPPacket) DestinationPort() uint16
- func (p TCPPacket) ResetChecksum(psum uint32)
- func (p TCPPacket) SetChecksum(sum [2]byte)
- func (p TCPPacket) SetDestinationPort(port uint16)
- func (p TCPPacket) SetSourcePort(port uint16)
- func (p TCPPacket) SourcePort() uint16
- type UDPPacket
- func (p UDPPacket) Checksum() uint16
- func (p UDPPacket) DestinationPort() uint16
- func (p UDPPacket) ResetChecksum(psum uint32)
- func (p UDPPacket) SetChecksum(sum [2]byte)
- func (p UDPPacket) SetDestinationPort(port uint16)
- func (p UDPPacket) SetSourcePort(port uint16)
- func (p UDPPacket) SourcePort() uint16
Constants ¶
View Source
const ( ICMP IPProtocol = 0x01 TCP = 0x06 UDP = 0x11 )
Variables ¶
This section is empty.
Functions ¶
func ConvertIPv4ToUint32 ¶
func ConvertUint32ToIPv4 ¶
Types ¶
type ICMPPacket ¶
type ICMPPacket []byte
func (ICMPPacket) Checksum ¶
func (p ICMPPacket) Checksum() uint16
func (ICMPPacket) Code ¶
func (p ICMPPacket) Code() byte
func (ICMPPacket) ResetChecksum ¶
func (p ICMPPacket) ResetChecksum()
func (ICMPPacket) SetChecksum ¶
func (p ICMPPacket) SetChecksum(sum [2]byte)
func (ICMPPacket) SetType ¶
func (p ICMPPacket) SetType(v ICMPType)
func (ICMPPacket) Type ¶
func (p ICMPPacket) Type() ICMPType
type IPProtocol ¶
type IPProtocol byte
type IPv4Packet ¶
type IPv4Packet []byte
func (IPv4Packet) Checksum ¶
func (p IPv4Packet) Checksum() uint16
func (IPv4Packet) DataLen ¶
func (p IPv4Packet) DataLen() uint16
func (IPv4Packet) DestinationIP ¶
func (p IPv4Packet) DestinationIP() net.IP
func (IPv4Packet) HeaderLen ¶
func (p IPv4Packet) HeaderLen() uint16
func (IPv4Packet) Payload ¶
func (p IPv4Packet) Payload() []byte
func (IPv4Packet) Protocol ¶
func (p IPv4Packet) Protocol() IPProtocol
func (IPv4Packet) ResetChecksum ¶
func (p IPv4Packet) ResetChecksum()
func (IPv4Packet) SetChecksum ¶
func (p IPv4Packet) SetChecksum(sum [2]byte)
func (IPv4Packet) SetDestinationIP ¶
func (p IPv4Packet) SetDestinationIP(ip net.IP)
func (IPv4Packet) SetSourceIP ¶
func (p IPv4Packet) SetSourceIP(ip net.IP)
func (IPv4Packet) SourceIP ¶
func (p IPv4Packet) SourceIP() net.IP
func (IPv4Packet) TotalLen ¶
func (p IPv4Packet) TotalLen() uint16
type TCPPacket ¶
type TCPPacket []byte
func (TCPPacket) DestinationPort ¶
func (TCPPacket) ResetChecksum ¶
func (TCPPacket) SetChecksum ¶
func (TCPPacket) SetDestinationPort ¶
func (TCPPacket) SetSourcePort ¶
func (TCPPacket) SourcePort ¶
type UDPPacket ¶
type UDPPacket []byte
func (UDPPacket) DestinationPort ¶
func (UDPPacket) ResetChecksum ¶
func (UDPPacket) SetChecksum ¶
func (UDPPacket) SetDestinationPort ¶
func (UDPPacket) SetSourcePort ¶
func (UDPPacket) SourcePort ¶
Click to show internal directories.
Click to hide internal directories.