Split usbip protocol de/serialization from server handler #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR splits all byte de/serialization from the handler into its own contained module.
This might seem like a lot of extra boilerplate right now, but I'm planning to create another PR where I'll reuse this logic.
I've also marked all of these items as public API, which might be useful for people using the package only for reading and/or writing packages, rather than the server loop. Network monitoring software similar to wireshark might find this useful.
As a by-product, these things have also been fixed:
env_logger
before every testpath
/busid
format for both default device and serverdebug_assert
thatpath
/busid
lengths don't overflowUSBIP_CMD_SUBMIT
with invalidep
USBIP_CMD_SUBMIT
USBIP_CMD_UNLINK
with no attached deviceiso_packet_descriptor
s properlydebug_assert
s during de/serialization to ensure sane behaviour