2

I am trying to construct TCP packets using the golang libraries gopacket and layers. In layers there is a struct aptly called TCP. There are two ACK fields and I am unsure why there is such a distinction. One is a bool and one is a uint16. What is the purpose for this divergence. Any help is much appreciated.

type TCP struct {
    BaseLayer
    SrcPort, DstPort                           TCPPort
    Seq                                        uint32
    Ack                                        uint32
    DataOffset                                 uint8
    FIN, SYN, RST, PSH, ACK, URG, ECE, CWR, NS bool
    Window                                     uint16
    Checksum                                   uint16
    Urgent                                     uint16

    Options []TCPOption
    Padding []byte
    // contains filtered or unexported fields
}
Jan Zerebecki
  • 825
  • 7
  • 18
rpb
  • 87
  • 1
  • 8
  • 2
    One is the Acknowledgment number and the other is the ACK flag (http://packetlife.net/blog/2010/jun/7/understanding-tcp-sequence-acknowledgment-numbers/) – Arjan Jul 05 '16 at 18:47

0 Answers0