code: func (b IPv4) Encode(i *IPv4Fields) {
  	b[versIHL] = (4 << 4) | ((i.IHL / 4) & 0xf)
  	b[tos] = i.TOS
  	b.SetTotalLength(i.TotalLength)
  	binary.BigEndian.PutUint16(b[id:], i.ID)
  	b.SetFlagsFragmentOffset(i.Flags, i.FragmentOffset)
  	b[ttl] = i.TTL
  	b[protocol] = i.Protocol
  	b.SetChecksum(i.Checksum)
  	copy(b[srcAddr:srcAddr+IPv4AddressSize], i.SrcAddr)
  	copy(b[dstAddr:dstAddr+IPv4AddressSize], i.DstAddr)
  }
docs: // Encode encodes all the fields of the ipv4 header.