can-utils/isobusfs
Oleksij Rempel 4855df9af7 isobusfs: fix directory read and seek semantics to match ISO 11783-13
According to ISO 11783-13:2021 (sections C.3.4.2 and C.3.5.2), directory
operations differ significantly from standard file operations:
- The `Count` parameter in a "Read File" request represents the number of
  directory entries to read, not the number of bytes.
- The `Offset` parameter in a "Seek File" request represents the logical
  entry index, not a byte offset.

Previously, the implementation treated directories strictly as files,
using byte-based offsets and counts. This resulted in incorrect seeking
behavior and protocol violations when listing directories.

This patch aligns the implementation with the standard by:

1. Server side:
   - Introducing `isobusfs_srv_dir_entry_visible()` to consistently
     filter out invalid (unreadable, hidden, oversized) entries. This
     ensures that entry indices remain stable.
   - Implementing `isobusfs_srv_dir_skip_entries()` to advance the
     directory stream by logical visible entries rather than bytes.
   - Updating the "Read File" handler to interpret `count` as the
     maximum number of entries and return the number of entries read
     in the response header.
   - Updating the "Seek File" handler to seek by entry index.

2. Client side:
   - Calculating the request count based on the number of minimal-size
     entries that fit into the maximum data length.
   - Interpreting the response `count` as the number of entries received
     rather than the byte length of the payload.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2026-01-13 19:13:20 +01:00
..
isobusfs_cli.c isobusfs: treat interactive exit as control flow, not error 2026-01-13 19:13:20 +01:00
isobusfs_cli.h isobusfs: treat interactive exit as control flow, not error 2026-01-13 19:13:20 +01:00
isobusfs_cli_cm.c isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00
isobusfs_cli_dh.c isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00
isobusfs_cli_fa.c isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00
isobusfs_cli_int.c isobusfs: fix directory read and seek semantics to match ISO 11783-13 2026-01-13 19:13:20 +01:00
isobusfs_cli_selftests.c isobusfs: selftest: fix oversize request 2026-01-04 18:43:23 +01:00
isobusfs_cmn.c isobusfs: fix typos 2025-03-02 15:44:40 +01:00
isobusfs_cmn.h move part of isobusfs code to the libj1939 2024-06-06 13:53:19 +02:00
isobusfs_cmn_cm.h isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00
isobusfs_cmn_dh.c isobusfs: fix typos 2025-03-02 15:44:40 +01:00
isobusfs_cmn_dh.h isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00
isobusfs_cmn_fa.h isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00
isobusfs_cmn_fh.h isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00
isobusfs_cmn_va.h isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00
isobusfs_create_test_dirs.sh isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00
isobusfs_create_test_file.sh isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00
isobusfs_srv.c isobusfs: fix typos 2025-03-02 15:44:40 +01:00
isobusfs_srv.h move part of isobusfs code to the libj1939 2024-06-06 13:53:19 +02:00
isobusfs_srv_cm.c move part of isobusfs code to the libj1939 2024-06-06 13:53:19 +02:00
isobusfs_srv_cm_fss.c isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00
isobusfs_srv_dh.c treewide: fix typos 2025-03-03 10:18:25 +01:00
isobusfs_srv_fa.c isobusfs: fix directory read and seek semantics to match ISO 11783-13 2026-01-13 19:13:20 +01:00
isobusfs_srv_fh.c isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00
isobusfs_srv_vh.c isobusfs: change license to LGPL-2.0-only 2024-02-04 19:15:25 +01:00