[roll pigweed] pw_transfer: Version 2 opening handshake in C++

This implements the opening handshake of pw_transfer's version 2
protocol within the C++ transfer client and server. The handshake
consists of protocol version negotiation and ephemeral session ID
assignment.

The protocol version used for a transfer session is controlled by the
client when it starts a new transfer. By default, this still remains the
legacy protocol for now, though the client API is extended to allow
specifying the desired version.

If the START chunk a transfer service receives is configured for version
2, the service will assign a transfer session ID and proceed with the
handshake. Otherwise, it will fall back to the legacy protocol.

The version 2 START chunk sent by a client retains all of the chunk
proto fields set by the legacy protocol, allowing it to be understood
by a server which is not version 2 aware. In such a case, the server
will process the chunk per the legacy protocol and send a non-handshake
response. The client will recognize the legacy response and revert to
running the legacy protocol.

As a result of this, version 2 capable transfer clients and servers
remain fully backwards-compatible with older code that only runs the
legacy protocol.

Original-Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/99500

https://pigweed.googlesource.com/pigweed/pigweed
pigweed Rolled-Commits: 400c0f3bdb19675..64a88a417ce3e29
Roller-URL: https://ci.chromium.org/b/8806003558989277377
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: I23cc6d155235647272cd5cdc425c8d87ecd804db
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/zephyr-integration/+/106380
Commit-Queue: Pigweed Integration Roller <pigweed-integration-roller@pigweed.google.com.iam.gserviceaccount.com>
Bot-Commit: Pigweed Integration Roller <pigweed-integration-roller@pigweed.google.com.iam.gserviceaccount.com>
1 file changed
tree: ffa47693a55a86f504f215b8fb602ba2629b81ba
  1. .gitmodules
  2. test.sh