]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/session2.h: clarify `struct session2` docs docs-develop-nits-2dntdj/deployments/4272
authorOto Šťáva <oto.stava@nic.cz>
Tue, 4 Jun 2024 08:49:49 +0000 (10:49 +0200)
committerOto Šťáva <oto.stava@nic.cz>
Tue, 4 Jun 2024 14:00:40 +0000 (16:00 +0200)
As pointed out by @lukas.ondracek, the wording could be confusing when
mentioning *bottommost* and *topmost* layers. The original wording was
meant to reference the way the arrays in `daemon/session2.c` are laid
out, but never explicitly mentioned that, so one could be implicitly
think it was in reference to the widely known ISO/OSI or TCP/IP models,
which could be interpreted incorrectly (the layers are traditionally
laid out the other way around there).

daemon/session2.h

index 931dd6ee0b1ecd658d118e483e8b172256448fea..dc602cca0411a49499d3bb47de2f116b3f55b438 100644 (file)
@@ -755,15 +755,16 @@ enum session2_transport_type {
  * A session processes data in two directions:
  *
  *  - `_UNWRAP` deals with raw data received from the session's transport. It
- *    strips the ceremony of individual protocols from the buffers. The last
- *    (bottommost) layer is generally responsible for submitting the unwrapped
- *    data to be processed by an internal system, e.g. to be resolved as a DNS
- *    query.
+ *  strips the ceremony of individual protocols from the buffers, retaining any
+ *  required metadata in an iteration context (`struct protolayer_iter_ctx`).
+ *  The last layer (as defined by a `protolayer_grp_*` array in `session2.c`) in
+ *  a sequence is generally responsible for submitting the unwrapped data to be
+ *  processed by an internal system, e.g. to be resolved as a DNS query.
  *
  *  - `_WRAP` deals with data generated by an internal system. It adds the
- *    required protocol ceremony to it (e.g. encryption). The first (topmost)
- *    layer is responsible for preparing the data to be sent through the
- *    session's transport. */
+ *  required protocol ceremony to it (e.g. encryption). The first layer (as
+ *  defined by a `protolayer_grp_*` array in `session2.c`) is responsible for
+ *  preparing the data to be sent through the session's transport. */
 struct session2 {
        /** Data for sending data out in the `wrap` direction and receiving new
         * data in the `unwrap` direction. */