-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --frame-only
option for message output, refactoring into a Transcoder class, LengthDelimitedOutputManager
#137
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…length_delimited as OutputManager
t8dogg
approved these changes
Apr 19, 2023
@mservidio this is the last planned batch for this change, can you do a check of pypl and final approve? |
mservidio
reviewed
Apr 20, 2023
mservidio
reviewed
Apr 20, 2023
mservidio
reviewed
Apr 20, 2023
mservidio
approved these changes
Apr 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#93 requested a way to unframe messages from a Source and output the extracted payload without transcoding. This is useful in some cases, such as converting the payloads in a PCAP file into a length-prefixed binary file.
Making this change led to a refactoring of previously existing leaky abstractions. Notably, the
MessageParser
class has been refactored into aTranscoder
class that is now the entry point. The CLI interaction remains the same, for library usage the entry point becomesTranscoder.transcode()
vs.MessageParser.process()
.This also adds a new LengthDelimitedOutputManager that sends a length-prefixed stream of unframed messages to standard output (
--output_type length_delimited
). An initial test of--frame-only
manufacturing a new file yielded bit-identical files when redirected to a new file. Under--output_type diag
,--frame-only
writes base64'd payloads encapsulated in YAML to the console.message_length_byte_length
has been renamed toprefix_length
which is less of a mouthful.Markdown updates to follow.