Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19384

Some of protocol header implementation examples use 8 bytes for length

XMLWordPrintable

    • Sprint 77 (Jun 2021), Sprint 78 (Jul 2021), Sprint 79 (Aug 2021), Sprint 80 (Sep 2021), Sprint 81 (Oct 2021), Sprint 82 (Nov 2021), Sprint 83 (Dec 2021), Sprint 84 (Jan 2022), Sprint 85 (Feb 2022), Sprint 86 (Mar 2022), Sprint 87 (Apr 2022), Sprint 88 (May 2022), Sprint 89 (Jun 2022), Sprint 90 (Jul 2022), Sprint 91 (Aug 2022)
    • 1

      Some of code examples here serialize data length as 8 bytes, e.g.

      $packet = "ZBXD\1" . pack('P', strlen($data)) . $data;
      

      according to the old protocol specification:

      <DATALEN> - data length (8 bytes). 1 will be formatted as 01/00/00/00/00/00/00/00 (eight bytes, 64 bit number in little-endian format)
      

      Nowadays data length is supposed to be 4 bytes and another 4 bytes are "reserved":

      <DATALEN> - data length (4 bytes). 1 will be formatted as 01/00/00/00 (four bytes, 32 bit number in little-endian format).
      <RESERVED> - reserved for protocol extensions (4 bytes).
      

      P.S. It also says that

      When compression is enabled (0x02 flag) the <RESERVED> bytes contains uncompressed data size, 32 bit number in little-endian format.

      ...but does not say what <RESERVED> bytes should be when compression is not enabled.

      P.P.S. Use of <code> seems inappropriate to list parts of protocol header and looks a bit ugly. A list or a table would look better.

            martins-v Martins Valkovskis
            cyclone Glebs Ivanovskis
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: