-
Notifications
You must be signed in to change notification settings - Fork 62
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
extras: allow options in journal export block #122
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rebase and fix the TBD?
Can't currently put options on captured log messages... (Also adding a nanosecond timestamp in the next commit.)
bb53072
to
3e86c09
Compare
done |
A URL change needs to be made:
|
So what is the algorithm that a pcapng reader would use to find the end of the journal entry? Search for a zero byte, starting at the beginning of the Journal Entry field and ending just before the beginning of the Block Total Length field. If a zero byte is not found, the entry ends before the Block Total Length field (as it's not padded). If a zero byte is found, the entry ends before the zero byte; skip over zero bytes until you're at a 4-byte boundary. If the Block Total Length field follows the entry, there are no options; otherwise, the options begin on that 4-byte boundary and run until the Block Total Length field. |
wish we could put the options first.... |
Yes — if there's any zero bytes, options start at the 4-byte boundary following the first zero byte. To be clear, if any options are present, there will be 1 to 4 zero bytes of padding. If without any zero bytes, the entry ends at a 4-byte boundary, there will be 4 bytes of zero padding. Otherwise how would you tell the entry has in fact ended…
Yup, that'd make things a lot easier 😢 … sadly the format is already established without options… |
Can't currently put options on captured log messages... (Also adding a nanosecond timestamp in the next commit.)
Really want to add a comment on some log messages 😄
I'm fully aware wireshark (aka the primary pcap-ng editing tool) doesn't support this yet, I just feel like specifying out things before implementing them. I may code this up for wireshark in a bit. It currently ignores the "trailing garbage" (my generator already tries generating comments because I didn't check that the journal block actually supports options…)
I'm 99.9% sure this shouldn't cause any compatibility problems; any reader or writer unaware of the options would still process the blocks correctly. Even if a writer was previously generating "excessive" padding (0…3 + n*4 zero bytes), it would just be read as end-of-options. Doing it this way should make existing readers just ignore the options.
No idea how to make the cross-document reference to
section_opt
work 😞