Documentation ¶
Overview ¶
Copyright 2016-2019 DutchSec (https://dutchsec.com/)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- type Flag
- type Header
- func (hdr *Header) CalcChecksum(src, dest net.IP) uint16
- func (hdr *Header) HasFlag(flagBit Flag) bool
- func (hdr *Header) Marshal() ([]byte, error)
- func (hdr *Header) MarshalWithChecksum(src, dest net.IP) ([]byte, error)
- func (hdr *Header) String() string
- func (hdr *Header) Unmarshal(data []byte) error
- func (hdr *Header) UnmarshalWithChecksum(data []byte, src, dest net.IP) error
- type Option
- type OptionKind
Constants ¶
const ( FIN Flag = 1 // 00 0001 SYN = 2 // 00 0010 RST = 4 // 00 0100 PSH = 8 // 00 1000 ACK = 16 // 01 0000 URG = 32 // 10 0000 )
Variables ¶
var ErrInvalidChecksum = fmt.Errorf("Invalid checksum")
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct { Source uint16 Destination uint16 SeqNum uint32 AckNum uint32 DataOffset uint8 // 4 bits Reserved uint8 // 3 bits ECN uint8 // 3 bits Ctrl Flag // 6 bits Window uint16 Checksum uint16 // Kernel will set this if it's 0 Urgent uint16 Options []Option Padding []byte Payload []byte // contains filtered or unexported fields }
func UnmarshalWithChecksum ¶
func (*Header) MarshalWithChecksum ¶
func (*Header) Unmarshal ¶
why EOF on ubuntu with 22? https://github.com/google/gopacket/blob/master/layers/tcp.go<Paste>
type Option ¶
type Option struct { OptionType OptionKind OptionLength uint8 OptionData []byte }
type OptionKind ¶
type OptionKind uint8
OptionKind represents a TCP option code.
func (OptionKind) String ¶
func (k OptionKind) String() string